workers-sdk
workers-sdk copied to clipboard
🐛 BUG: workerd exception when debugging large project
Which Cloudflare product(s) does this pertain to?
Workers Runtime, Wrangler core
What version(s) of the tool(s) are you using?
3.36.0
What version of Node are you using?
18.16.0
What operating system and version are you using?
Mac Sonoma 14.3.1
Describe the Bug
Observed behavior
When running a local server via wrangler dev, breakpoints are hit once after the application starts, and then the program immediately resumes and never hits a breakpoint again, indicating a failure in the debugger code
When running with wrangler dev with --log-level debug, the following stack trace was observed, indicating a websocket message greater than 1MB was sent
workerd/jsg/util.c++:281: error: e = kj/compat/http.c++:5754: failed: WebSocket protocol error; protocolError.statusCode = 1009; protocolError.description = Message is too large: 1498317 > 1048576
stack: 101372e84 1013730cf 10272cf07 100ba42d8 10138f72c 100ba42d8 100d96b7f; sentryErrorContext = jsgInternalError
workerd/jsg/util.c++:281: error: e = kj/compat/http.c++:5754: failed: WebSocket protocol error; protocolError.statusCode = 1009; protocolError.description = Message is too large: 1498317 > 1048576
stack: 101372e84 1013730cf 10272cf07 100ba42d8 10138f72c 100ba42d8 100d96b7f 100d8f0af 101477c03 101574d77 10149cb5f 1014734b7 10174af93 10174b943 10174baab 101761a67 1017618db 1009f611b 1009f5cc3 1009ed117 1009ea82f 1009e582b 100d8d5d3 100d8e213 100d8df9f 10272cf07 102731b27 102734973 10272bd7f 1004b911b 1004bd76b 1004bd653; sentryErrorContext = jsgInternalError
workerd/io/worker.c++:1816: info: uncaught exception; source = Uncaught (in promise); exception = Error: internal error
workerd/io/io-context.c++:359: info: uncaught exception; exception = workerd/jsg/_virtual_includes/jsg/workerd/jsg/value.h:1343: failed: jsg.Error: internal error
[InspectorProxyWorker] RUNTIME WEBSOCKET ERROR {
message: 'internal error',
name: 'Error',
stack: 'Error: internal error'
}
[InspectorProxyWorker] 'runtime websocket' error {
message: 'internal error',
name: 'Error',
stack: 'Error: internal error'
}
Expected behavior
The debugger feature works correctly
Steps to reproduce
This is failing for my code with just wrangler dev
Unclear what message is causing the debugger to choke, but it seems like it's related to sending code or source code over the websockets
debugger still broken on wrangler 3.59.0 3 months later :(
still broken on 3.62.0 with the experimental dev server
[InspectorProxyWorker] SEND TO RUNTIME {"id":19,"method":"Runtime.getProperties","params":{"objectId":"9134283823374983007.322011361.1","ownProperties":false,"accessorPropertiesOnly":false,"nonIndexedPropertiesOnly":false,"generatePreview":true}}
[InspectorProxyWorker] RUNTIME WEBSOCKET ERROR {
message: 'internal error',
name: 'Error',
stack: 'Error: internal error'
}
[InspectorProxyWorker] 'runtime websocket' error {
message: 'internal error',
name: 'Error',
stack: 'Error: internal error'
}
[wrangler-ProxyWorker:inf] GET /quote/1e18/eth/usdc 200 OK (185ms)
[wrangler-ProxyWorker:inf] GET /favicon.ico 400 Bad Request (2ms)
[InspectorProxyWorker] DEVTOOLS INCOMING MESSAGE { method: 'Runtime.getIsolateId', id: 20 }
[InspectorProxyWorker] SEND TO RUNTIME {"method":"Runtime.getIsolateId","id":20}
workerd/io/io-context.c++:355: info: uncaught exception; exception = workerd/jsg/_virtual_includes/jsg/workerd/jsg/value.h:1358: failed: jsg.Error: Network connection lost.
stack: 102a1b0a4 102a1bf0b 1047bcd13 1028c2768 1028c2dc8
workerd/io/io-context.c++:355: info: uncaught exception; exception = workerd/jsg/_virtual_includes/jsg/workerd/jsg/value.h:1358: failed: jsg.Error: Network connection lost.
stack: 102a1b0a4 102a1bf0b 1047bcd13 1028c2768 1028c2dc8
workerd/io/io-context.c++:355: info: uncaught exception; exception = workerd/jsg/_virtual_includes/jsg/workerd/jsg/value.h:1358: failed: jsg.Error: Network connection lost.
stack: 102a1b0a4 102a1bf0b 1047bcd13 1028c2768 1028c2dc8
workerd/io/io-context.c++:355: info: uncaught exception; exception = workerd/jsg/_virtual_includes/jsg/workerd/jsg/value.h:1358: failed: jsg.Error: Network connection lost.
stack: 102a1b0a4 102a1bf0b 1047bcd13 1028c2768 1028c2dc8
[InspectorProxyWorker] FAILED TO SEND PROXY CONTROLLER REQUEST {
message: 'Network connection lost.',
name: 'Error',
stack: 'Error: Network connection lost.\n' +
' at async InspectorProxyWorker.sendProxyControllerRequest (file:///Users/moody/IdeaProjects/ekubo/api/node_modules/wrangler/wrangler-dist/InspectorProxyWorker.js:148:19)'
}
[InspectorProxyWorker] FAILED TO SEND PROXY CONTROLLER REQUEST {
message: 'Network connection lost.',
name: 'Error',
stack: 'Error: Network connection lost.\n' +
' at async InspectorProxyWorker.sendProxyControllerRequest (file:///Users/moody/IdeaProjects/ekubo/api/node_modules/wrangler/wrangler-dist/InspectorProxyWorker.js:148:19)'
}
[InspectorProxyWorker] FAILED TO SEND PROXY CONTROLLER REQUEST {
message: 'Network connection lost.',
name: 'Error',
stack: 'Error: Network connection lost.\n' +
' at async InspectorProxyWorker.sendProxyControllerRequest (file:///Users/moody/IdeaProjects/ekubo/api/node_modules/wrangler/wrangler-dist/InspectorProxyWorker.js:148:19)'
}
[InspectorProxyWorker] FAILED TO SEND PROXY CONTROLLER REQUEST {
message: 'Network connection lost.',
name: 'Error',
stack: 'Error: Network connection lost.\n' +
' at async InspectorProxyWorker.sendProxyControllerRequest (file:///Users/moody/IdeaProjects/ekubo/api/node_modules/wrangler/wrangler-dist/InspectorProxyWorker.js:148:19)'
}
[InspectorProxyWorker] FAILED TO SEND PROXY CONTROLLER REQUEST {
message: 'Network connection lost.',
name: 'Error',
stack: 'Error: Network connection lost.\n' +
' at async InspectorProxyWorker.sendProxyControllerRequest (file:///Users/moody/IdeaProjects/ekubo/api/node_modules/wrangler/wrangler-dist/InspectorProxyWorker.js:148:19)'
}
[InspectorProxyWorker] FAILED TO SEND PROXY CONTROLLER REQUEST {
message: 'Network connection lost.',
name: 'Error',
stack: 'Error: Network connection lost.\n' +
' at async InspectorProxyWorker.sendProxyControllerRequest (file:///Users/moody/IdeaProjects/ekubo/api/node_modules/wrangler/wrangler-dist/InspectorProxyWorker.js:148:19)'
}
[InspectorProxyWorker] FAILED TO SEND PROXY CONTROLLER REQUEST {
message: 'Network connection lost.',
name: 'Error',
stack: 'Error: Network connection lost.\n' +
' at async InspectorProxyWorker.sendProxyControllerRequest (file:///Users/moody/IdeaProjects/ekubo/api/node_modules/wrangler/wrangler-dist/InspectorProxyWorker.js:148:19)'
}
[InspectorProxyWorker] FAILED TO SEND PROXY CONTROLLER REQUEST {
message: 'Network connection lost.',
name: 'Error',
stack: 'Error: Network connection lost.\n' +
' at async InspectorProxyWorker.sendProxyControllerRequest (file:///Users/moody/IdeaProjects/ekubo/api/node_modules/wrangler/wrangler-dist/InspectorProxyWorker.js:148:19)'
}
[InspectorProxyWorker] FAILED TO SEND PROXY CONTROLLER REQUEST {
message: 'Network connection lost.',
name: 'Error',
stack: 'Error: Network connection lost.\n' +
' at async InspectorProxyWorker.sendProxyControllerRequest (file:///Users/moody/IdeaProjects/ekubo/api/node_modules/wrangler/wrangler-dist/InspectorProxyWorker.js:148:19)'
}
[InspectorProxyWorker] FAILED TO SEND PROXY CONTROLLER REQUEST {
message: 'Network connection lost.',
name: 'Error',
stack: 'Error: Network connection lost.\n' +
' at async InspectorProxyWorker.sendProxyControllerRequest (file:///Users/moody/IdeaProjects/ekubo/api/node_modules/wrangler/wrangler-dist/InspectorProxyWorker.js:148:19)'
}
[InspectorProxyWorker] FAILED TO SEND PROXY CONTROLLER REQUEST {
message: 'Network connection lost.',
name: 'Error',
stack: 'Error: Network connection lost.\n' +
' at async InspectorProxyWorker.sendProxyControllerRequest (file:///Users/moody/IdeaProjects/ekubo/api/node_modules/wrangler/wrangler-dist/InspectorProxyWorker.js:148:19)'
}
[InspectorProxyWorker] FAILED TO SEND PROXY CONTROLLER REQUEST {
message: 'Network connection lost.',
name: 'Error',
stack: 'Error: Network connection lost.\n' +
' at async InspectorProxyWorker.sendProxyControllerRequest (file:///Users/moody/IdeaProjects/ekubo/api/node_modules/wrangler/wrangler-dist/InspectorProxyWorker.js:148:19)'
}
[InspectorProxyWorker] FAILED TO SEND PROXY CONTROLLER REQUEST {
message: 'Network connection lost.',
name: 'Error',
stack: 'Error: Network connection lost.\n' +
' at async InspectorProxyWorker.sendProxyControllerRequest (file:///Users/moody/IdeaProjects/ekubo/api/node_modules/wrangler/wrangler-dist/InspectorProxyWorker.js:148:19)'
}
[InspectorProxyWorker] FAILED TO SEND PROXY CONTROLLER REQUEST {
message: 'Network connection lost.',
name: 'Error',
stack: 'Error: Network connection lost.\n' +
' at async InspectorProxyWorker.sendProxyControllerRequest (file:///Users/moody/IdeaProjects/ekubo/api/node_modules/wrangler/wrangler-dist/InspectorProxyWorker.js:148:19)'
}
[InspectorProxyWorker] FAILED TO SEND PROXY CONTROLLER REQUEST {
message: 'Network connection lost.',
name: 'Error',
stack: 'Error: Network connection lost.\n' +
' at async InspectorProxyWorker.sendProxyControllerRequest (file:///Users/moody/IdeaProjects/ekubo/api/node_modules/wrangler/wrangler-dist/InspectorProxyWorker.js:148:19)'
}
[InspectorProxyWorker] FAILED TO SEND PROXY CONTROLLER REQUEST {
message: 'Network connection lost.',
name: 'Error',
stack: 'Error: Network connection lost.\n' +
' at async InspectorProxyWorker.sendProxyControllerRequest (file:///Users/moody/IdeaProjects/ekubo/api/node_modules/wrangler/wrangler-dist/InspectorProxyWorker.js:148:19)'
}
[InspectorProxyWorker] FAILED TO SEND PROXY CONTROLLER REQUEST {
message: 'Network connection lost.',
name: 'Error',
stack: 'Error: Network connection lost.\n' +
' at async InspectorProxyWorker.sendProxyControllerRequest (file:///Users/moody/IdeaProjects/ekubo/api/node_modules/wrangler/wrangler-dist/InspectorProxyWorker.js:148:19)'
}
[InspectorProxyWorker] FAILED TO SEND PROXY CONTROLLER REQUEST {
message: 'Network connection lost.',
name: 'Error',
stack: 'Error: Network connection lost.\n' +
' at async InspectorProxyWorker.sendProxyControllerRequest (file:///Users/moody/IdeaProjects/ekubo/api/node_modules/wrangler/wrangler-dist/InspectorProxyWorker.js:148:19)'
}
[InspectorProxyWorker] FAILED TO SEND PROXY CONTROLLER REQUEST {
message: 'Network connection lost.',
name: 'Error',
stack: 'Error: Network connection lost.\n' +
' at async InspectorProxyWorker.sendProxyControllerRequest (file:///Users/moody/IdeaProjects/ekubo/api/node_modules/wrangler/wrangler-dist/InspectorProxyWorker.js:148:19)'
}
[InspectorProxyWorker] FAILED TO SEND PROXY CONTROLLER REQUEST {
message: 'Network connection lost.',
name: 'Error',
stack: 'Error: Network connection lost.\n' +
' at async InspectorProxyWorker.sendProxyControllerRequest (file:///Users/moody/IdeaProjects/ekubo/api/node_modules/wrangler/wrangler-dist/InspectorProxyWorker.js:148:19)'
}
[InspectorProxyWorker] FAILED TO SEND PROXY CONTROLLER REQUEST {
message: 'Network connection lost.',
name: 'Error',
stack: 'Error: Network connection lost.\n' +
' at async InspectorProxyWorker.sendProxyControllerRequest (file:///Users/moody/IdeaProjects/ekubo/api/node_modules/wrangler/wrangler-dist/InspectorProxyWorker.js:148:19)'
}
[InspectorProxyWorker] FAILED TO SEND PROXY CONTROLLER REQUEST {
message: 'Network connection lost.',
name: 'Error',
stack: 'Error: Network connection lost.\n' +
' at async InspectorProxyWorker.sendProxyControllerRequest (file:///Users/moody/IdeaProjects/ekubo/api/node_modules/wrangler/wrangler-dist/InspectorProxyWorker.js:148:19)'
}
This should be addressed by https://github.com/cloudflare/workerd/commit/fc77758796a0cb0b416cc8c609c054c3bad4dad4, which we'll need to add locally
This was fixed in https://github.com/cloudflare/workers-sdk/pull/6424