yeah, ive done that but i keep getting

yeah, ive done that but i keep getting Error: internal error
37 Replies
Larry
Larry4mo ago
What's the id? Could it be some character in the id itself?
jcheese
jcheeseOP4mo ago
the durable object ID of the affected instance?
Larry
Larry4mo ago
Yes. Since you are using Agent, I'm assuming you are using a human readable name rather than an opaque GUID
jcheese
jcheeseOP4mo ago
the ID is smol-brains-10985. the DO id is 0d98a1818d13e963b905dc11f22eddd1e51869ab8243bb9401b8085469576833 if that helps. appreciate the help.
Larry
Larry4mo ago
I should have said, "name". Is that smol-brains-10985
jcheese
jcheeseOP4mo ago
yep
Larry
Larry4mo ago
Is there any data in that instance?
jcheese
jcheeseOP4mo ago
cant check, because trying to access RPC methods just gives me internal server error
1984 Ford Laser
1984 Ford Laser4mo ago
could check that instance's databaseSize in the GraphQL API
Larry
Larry4mo ago
Can you push an update with an onRequest handler and hit that instead of using RPC? That may not work because partyserver/set-name might actually be involved even with onRequest, but just giving you some more ideas to try
jcheese
jcheeseOP4mo ago
is this to just check if the request passes to onRequest or not?
onRequest(request: Request): Response | Promise<Response> {
console.log('request', request);

return super.onRequest(request);
}
onRequest(request: Request): Response | Promise<Response> {
console.log('request', request);

return super.onRequest(request);
}
something like this will suffice?
Larry
Larry4mo ago
Sure But if that works, then you can use that to inspect the data Upgrade onRequest with code to inspect the data Actually, I don't think you need to call super.onRequest onRequest is a callback so the data comes through the Agent class's fetch handler so it gets a chance to do whatever it needs to do. This is why I don't think you should call super.onRequest
jcheese
jcheeseOP4mo ago
oh ok. what should i return here then?
Larry
Larry4mo ago
return new Response("Hello from Agent!"); or something like that
jcheese
jcheeseOP4mo ago
got it
Larry
Larry4mo ago
I'm not familiar with CharacterAgent. I just use fetch to get to my Agent's onRequest callback
jcheese
jcheeseOP4mo ago
ok, still getting
GET http://dummy-example.cloudflare.com/cdn-cgi/partyserver/set-name/ - Exception Thrown @ 4/30/2025, 10:16:38 AM
(error) Error: internal error; reference = 51a83596v7mruuigsoqssufi
GET http://dummy-example.cloudflare.com/cdn-cgi/partyserver/set-name/ - Exception Thrown @ 4/30/2025, 10:16:38 AM
(error) Error: internal error; reference = 51a83596v7mruuigsoqssufi
this is the code:
// characterAgent.ts
onRequest(request: Request): Response | Promise<Response> {
console.log('got request:', request);
return new Response('Hello from Agent!');
}
// characterAgent.ts
onRequest(request: Request): Response | Promise<Response> {
console.log('got request:', request);
return new Response('Hello from Agent!');
}
server.ts

const characterStub = await getAgentByName<Env, CharacterAgent>(
c.env.CharacterAgent,
agentName,
);

const reconstructedRequest = new Request(c.req.raw.url, {
method: c.req.raw.method,
headers: c.req.raw.headers,
body: JSON.stringify(c.req.valid('json')),
});

console.log(
'agent state',
await characterStub.onRequest(reconstructedRequest),
);
server.ts

const characterStub = await getAgentByName<Env, CharacterAgent>(
c.env.CharacterAgent,
agentName,
);

const reconstructedRequest = new Request(c.req.raw.url, {
method: c.req.raw.method,
headers: c.req.raw.headers,
body: JSON.stringify(c.req.valid('json')),
});

console.log(
'agent state',
await characterStub.onRequest(reconstructedRequest),
);
its not going to the onRequest at all it seems like the DO for this ID is just broken
Larry
Larry4mo ago
What about await characterStub.fetch(reconstructedRequest),
jcheese
jcheeseOP4mo ago
will try that out
Larry
Larry4mo ago
Sorry, I cut and paste without editing. It's changed now. It now says, .fetch(... instead of .onRequest(...
jcheese
jcheeseOP4mo ago
yep but failed again:
✘ [ERROR] Error: internal error; reference = 11o94fcmsaha77j6g20r3ur1


✘ [ERROR] Error: internal error; reference = 11o94fcmsaha77j6g20r3ur1


✘ [ERROR] Error: internal error; reference = 11o94fcmsaha77j6g20r3ur1
✘ [ERROR] Error: internal error; reference = 11o94fcmsaha77j6g20r3ur1


✘ [ERROR] Error: internal error; reference = 11o94fcmsaha77j6g20r3ur1


✘ [ERROR] Error: internal error; reference = 11o94fcmsaha77j6g20r3ur1
doesnt log
Larry
Larry4mo ago
I'm out of ideas for now
jcheese
jcheeseOP4mo ago
gotta be borked can a cf employee examine the issue using the reference id?
POST https://cf-api.com/admin/get-agent - Ok @ 4/30/2025, 10:29:56 AM
(log) got request: [object Request]
POST https://cf-api.com/admin/get-agent - Ok @ 4/30/2025, 10:29:56 AM
(log) got request: [object Request]
other "name"s log properly cc @lambrospetrou
lambrospetrou
lambrospetrou4mo ago
Firstly, don't tag individual CF people. Secondly, I assume all the URLs you posted above are just fake/placeholders right, since they are under the main cloudflare domain?
jcheese
jcheeseOP4mo ago
Yes, placeholders
lambrospetrou
lambrospetrou4mo ago
I shared the error with the team to see why it happens.
jcheese
jcheeseOP4mo ago
thank you, its urgent. this is the reference ID if it helps, (error) Error: internal error; reference = 51a83596v7mruuigsoqssufi i can share more details on DMs if it helps
lambrospetrou
lambrospetrou4mo ago
The underlying root cause is the same as the other errors above. Can you describe a bit the workload? How many queries, how often, etc?
jcheese
jcheeseOP4mo ago
well, I can't even access this durable object ID's fetch handler
lambrospetrou
lambrospetrou4mo ago
Did you create any virtual tables (FTS5) or any other schema on the actor's SQLite storage? Any insight into the workload will help the team find the root cause faster.
jcheese
jcheeseOP4mo ago
no virtual tables. we are using SQLite schema migrations from your https://github.com/lambrospetrou/durable-utils
GitHub
GitHub - lambrospetrou/durable-utils: Utilities for Cloudflare Dura...
Utilities for Cloudflare Durable Objects and Workers - lambrospetrou/durable-utils
lambrospetrou
lambrospetrou4mo ago
OK, thanks for the info.
jcheese
jcheeseOP4mo ago
fyi, it happened again on a different DO instance
(error) Could not set server name: Error: internal error; reference = jqjgbhjjs0nqh90t434308pm
(error) Error: Internal error in Durable Object storage caused object to be reset.
(error) Could not set server name: Error: internal error; reference = jqjgbhjjs0nqh90t434308pm
(error) Error: Internal error in Durable Object storage caused object to be reset.
paulc
paulc2mo ago
@jcheese are you still experiencing the same DO internal error? I started getting them yesterday a few minutes after 11a EDT. I have an hourly cron trigger that invokes a websocket. Every time it fires, I get this message: internal error; reference = kig34utl9ep9b0h2snkjpteo The reference value is different each hour. Guessing that's simply a GUID for the internal error.
jcheese
jcheeseOP2mo ago
U doing any migrations? That was the issue for me
paulc
paulc2mo ago
If by migrations you mean including this in my wrangler.toml, then yes: durable_objects.bindings = [ { name = "WEBSOCKET_HIBERNATION_SERVER", class_name = "WebSocketHibernationServer" } ] migrations = [ { tag = "V1_WEBSOCKET_HIBERNATION_SERVER", new_sqlite_classes = ["WebSocketHibernationServer"] } ] How did you solve @jcheese ?
jcheese
jcheeseOP2mo ago
no, i mean sql migrations directly inside the DO

Did you find this page helpful?