avaer
avaer
CDCloudflare Developers
Created by avaer on 6/5/2024 in #workers-help
"internal error" calling .fetch on bound Durable Object
Also, I know my migrations are taking effect because if I put the wrong class name in there it will cause an error:
Cannot apply new-class migration to class DurableObject3 that is not exported by script [code:
10070]
Cannot apply new-class migration to class DurableObject3 that is not exported by script [code:
10070]
25 replies
CDCloudflare Developers
Created by avaer on 6/5/2024 in #workers-help
"internal error" calling .fetch on bound Durable Object
Note that this all works in wrangler dev
25 replies
CDCloudflare Developers
Created by avaer on 6/5/2024 in #workers-help
"internal error" calling .fetch on bound Durable Object
the class is exported:
export {
DurableObject,
main_default as default
};
export {
DurableObject,
main_default as default
};
25 replies
CDCloudflare Developers
Created by avaer on 6/5/2024 in #workers-help
"internal error" calling .fetch on bound Durable Object
This is what I have in my list of migrations in wrangler.toml:
[[migrations]]
tag = "v1"
new_classes = [ "DurableObject" ]
[[migrations]]
tag = "v1"
new_classes = [ "DurableObject" ]
I tried both via the API and wrangler. The support team says that the problem is that this is not configured as a durable object -- but my impression is the above is the correct way to configure a durable object. There are no errors other than the "internal error".
25 replies
CDCloudflare Developers
Created by avaer on 6/5/2024 in #workers-help
"internal error" calling .fetch on bound Durable Object
thanks, please keep me updated, it's a blocker to shipping 🙏
25 replies
CDCloudflare Developers
Created by avaer on 6/5/2024 in #workers-help
"internal error" calling .fetch on bound Durable Object
I have a few workers deployed there, but all of the recent ones suffer from this configuration problem
25 replies
CDCloudflare Developers
Created by avaer on 6/5/2024 in #workers-help
"internal error" calling .fetch on bound Durable Object
and Zone ID is a1f842607bf1d6725b1054e4185a14ff
25 replies
CDCloudflare Developers
Created by avaer on 6/5/2024 in #workers-help
"internal error" calling .fetch on bound Durable Object
8d093faf5772cff838a12d1c9bc87afd
25 replies
CDCloudflare Developers
Created by avaer on 6/5/2024 in #workers-help
"internal error" calling .fetch on bound Durable Object
@Walshy @Hello, I’m Allie! any ideas here? sorry to ping you but you seem knowledgeable about the stack internals
25 replies
CDCloudflare Developers
Created by avaer on 6/5/2024 in #workers-help
"internal error" calling .fetch on bound Durable Object
here is the built worker module script
25 replies
CDCloudflare Developers
Created by avaer on 6/5/2024 in #workers-help
"internal error" calling .fetch on bound Durable Object
{
"message": [
"Error: internal error\n at async handleAgentRequest (worker.mjs:56038:10)\n at async Object.fetch (worker.mjs:56043:14)"
],
"level": "warn",
"timestamp": 1717579573799
}
{
"message": [
"Error: internal error\n at async handleAgentRequest (worker.mjs:56038:10)\n at async Object.fetch (worker.mjs:56043:14)"
],
"level": "warn",
"timestamp": 1717579573799
}
25 replies
CDCloudflare Developers
Created by avaer on 6/5/2024 in #workers-help
"internal error" calling .fetch on bound Durable Object
does this have something to do with namespace_id on the DO? that's the only difference I see between this and a working worker with DO binding
25 replies
CDCloudflare Developers
Created by avaer on 6/5/2024 in #workers-help
"internal error" calling .fetch on bound Durable Object
gotten from curl https://api.cloudflare.com/client/v4/accounts/8d093faf5772cff838a12d1c9bc87afd/workers/scripts/agent-worker-afb1bb7b-233a-4d2d-9999-35914f25f673/settings
25 replies
CDCloudflare Developers
Created by avaer on 6/5/2024 in #workers-help
"internal error" calling .fetch on bound Durable Object
here are my worker settings as reported from the API:
{
"result": {
"placement": {},
"compatibility_date": "",
"compatibility_flags": [],
"usage_model": "standard",
"tags": [],
"tail_consumers": [
{
"service": "agent-worker-afb1bb7b-233a-4d2d-9999-35914f25f673"
}
],
"logpush": false,
"bindings": [
{
"class_name": "DurableObject",
"name": "AGENT",
"namespace_id": "dd92e03be01d4c01940207dd6c0d81b9",
"type": "durable_object_namespace"
},
{
"name": "AGENT_JSON",
"type": "secret_text"
},
{
"name": "AGENT_TOKEN",
"type": "secret_text"
},
{
"bucket_name": "data",
"name": "DATA",
"type": "r2_bucket"
},
{
"name": "GUID",
"type": "secret_text"
},
{
"name": "SUPABASE_PUBLIC_API_KEY",
"type": "secret_text"
},
{
"name": "SUPABASE_URL",
"type": "secret_text"
},
{
"name": "WALLET_MNEMONIC",
"type": "secret_text"
}
]
},
"success": true,
"errors": [],
"messages": []
}
{
"result": {
"placement": {},
"compatibility_date": "",
"compatibility_flags": [],
"usage_model": "standard",
"tags": [],
"tail_consumers": [
{
"service": "agent-worker-afb1bb7b-233a-4d2d-9999-35914f25f673"
}
],
"logpush": false,
"bindings": [
{
"class_name": "DurableObject",
"name": "AGENT",
"namespace_id": "dd92e03be01d4c01940207dd6c0d81b9",
"type": "durable_object_namespace"
},
{
"name": "AGENT_JSON",
"type": "secret_text"
},
{
"name": "AGENT_TOKEN",
"type": "secret_text"
},
{
"bucket_name": "data",
"name": "DATA",
"type": "r2_bucket"
},
{
"name": "GUID",
"type": "secret_text"
},
{
"name": "SUPABASE_PUBLIC_API_KEY",
"type": "secret_text"
},
{
"name": "SUPABASE_URL",
"type": "secret_text"
},
{
"name": "WALLET_MNEMONIC",
"type": "secret_text"
}
]
},
"success": true,
"errors": [],
"messages": []
}
25 replies
CDCloudflare Developers
Created by avaer on 6/5/2024 in #workers-help
"internal error" calling .fetch on bound Durable Object
I am manually deploying this worker via the API, not wrangler.
25 replies
CDCloudflare Developers
Created by avaer on 6/4/2024 in #workers-help
Workers for platforms authentication
I uploaded the built worker file to the ticket as well
24 replies
CDCloudflare Developers
Created by avaer on 6/4/2024 in #workers-help
Workers for platforms authentication
(also note that the documentation says that source maps are supported, Source maps may also be included using the application/source-map content type., which is why I was confused why that causes the crash.
24 replies
CDCloudflare Developers
Created by avaer on 6/4/2024 in #workers-help
Workers for platforms authentication
presumably this should allow the worker to be detected as ESM and therefore export shouldn't be a syntax error but the backend tells me it is
24 replies
CDCloudflare Developers
Created by avaer on 6/4/2024 in #workers-help
Workers for platforms authentication
const form = new FormData();
form.append('worker.mjs', Buffer.from(mainJsString, 'utf8'), {
filename: 'worker.mjs',
filepath: 'worker.mjs',
contentType: 'application/javascript',
});
form.append(
'metadata',
Buffer.from(
JSON.stringify({
main_module: 'worker.mjs',
}),
'utf8',
),
);
const form = new FormData();
form.append('worker.mjs', Buffer.from(mainJsString, 'utf8'), {
filename: 'worker.mjs',
filepath: 'worker.mjs',
contentType: 'application/javascript',
});
form.append(
'metadata',
Buffer.from(
JSON.stringify({
main_module: 'worker.mjs',
}),
'utf8',
),
);
24 replies
CDCloudflare Developers
Created by avaer on 6/4/2024 in #workers-help
Workers for platforms authentication
I tried using both/either CF-WORKER-MAIN-MODULE-PART and the metadata JSON field main_module in the FormData
24 replies