yeah, ive done that but i keep getting

yeah, ive done that but i keep getting Error: internal error
23 Replies
Larry
Larry10h ago
What's the id? Could it be some character in the id itself?
jcheese
jcheeseOP10h ago
the durable object ID of the affected instance?
Larry
Larry10h ago
Yes. Since you are using Agent, I'm assuming you are using a human readable name rather than an opaque GUID
jcheese
jcheeseOP10h ago
the ID is smol-brains-10985. the DO id is 0d98a1818d13e963b905dc11f22eddd1e51869ab8243bb9401b8085469576833 if that helps. appreciate the help.
Larry
Larry10h ago
I should have said, "name". Is that smol-brains-10985
jcheese
jcheeseOP10h ago
yep
Larry
Larry10h ago
Is there any data in that instance?
jcheese
jcheeseOP10h ago
cant check, because trying to access RPC methods just gives me internal server error
1984 Ford Laser
1984 Ford Laser10h ago
could check that instance's databaseSize in the GraphQL API
Larry
Larry10h 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
jcheeseOP10h 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
Larry10h 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
jcheeseOP10h ago
oh ok. what should i return here then?
Larry
Larry10h ago
return new Response("Hello from Agent!"); or something like that
jcheese
jcheeseOP10h ago
got it
Larry
Larry10h ago
I'm not familiar with CharacterAgent. I just use fetch to get to my Agent's onRequest callback
jcheese
jcheeseOP10h 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
Larry10h ago
What about await characterStub.fetch(reconstructedRequest),
jcheese
jcheeseOP10h ago
will try that out
Larry
Larry10h ago
Sorry, I cut and paste without editing. It's changed now. It now says, .fetch(... instead of .onRequest(...
jcheese
jcheeseOP10h 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
Larry10h ago
I'm out of ideas for now
jcheese
jcheeseOP10h ago
gotta be borked can a cf employee examine the issue using the reference id?

Did you find this page helpful?