hanpolo
CDCloudflare Developers
•Created by hanpolo on 11/23/2024 in #pages-help
Durable Object '503 Service Unavailable'
I have developed a Pages application that connects to a Durable Object via a Pages Function. This all used to work as of 2 or 3 months ago. When I came back from my break and upgraded wrangler yesterday, the function is no longer able to connect to the DO on my local server.
1. When I run the pages function is says that the durable object is 'not connected'
2. When I start a browser I get a '503 Service Unavailable'
I have defined my durable object in a worker with a .toml file with:
name = "decision-do-dev"
[durable_objects]
bindings = [ { name="DECISION_DO", class_name="DecisionDO" } ]
I run this separately on a terminal with npx wrangler pages dev
I then run my pages application with npx wrangler pages dev [directory] --do=DECISION_DO=DecisionDO@decision-do-dev
I open the durable object with the following code in the function:
const id = this.context.env.DECISION_DO.idFromString("id-string-looked-up");
const stub = this.context.env.DECISION_DO.get(doId);
const doResponse = await stub.fetch(this.context.request);
doResponse comes back with status 503 Service Unavailable.
Any thoughts on what may have changed?
4 replies