"Error: Network connection lost" when calling fetch, Works fine in CURL and Browser

So when I call
fetch('https://wslgis.water.co.nz/arcgis/rest/services/Services/WastewaterComb/MapServer/2/query?f=json&geometry=%7B%22xmin%22%3A1752242.4364089235%2C%22ymin%22%3A5939768.593982927%2C%22xmax%22%3A1752548.184522064%2C%22ymax%22%3A5940074.342096068%7D&maxAllowableOffset=0.5971642834777837&orderByFields=OBJECTID&outFields=OBJECTID%2CPROCESS&outSR=2193&quantizationParameters=%7B%22extent%22%3A%7B%22spatialReference%22%3A%7B%22latestWkid%22%3A2193%2C%22wkid%22%3A2193%7D%2C%22xmin%22%3A1752242.4364089235%2C%22ymin%22%3A5939768.593982927%2C%22xmax%22%3A1752548.184522064%2C%22ymax%22%3A5940074.342096068%7D%2C%22mode%22%3A%22view%22%2C%22originPosition%22%3A%22upperLeft%22%2C%22tolerance%22%3A0.5971642834777837%7D&resultType=tile&returnExceededLimitFeatures=false&spatialRel=esriSpatialRelIntersects&where=1%3D1&geometryType=esriGeometryEnvelope&inSR=2193')
fetch('https://wslgis.water.co.nz/arcgis/rest/services/Services/WastewaterComb/MapServer/2/query?f=json&geometry=%7B%22xmin%22%3A1752242.4364089235%2C%22ymin%22%3A5939768.593982927%2C%22xmax%22%3A1752548.184522064%2C%22ymax%22%3A5940074.342096068%7D&maxAllowableOffset=0.5971642834777837&orderByFields=OBJECTID&outFields=OBJECTID%2CPROCESS&outSR=2193&quantizationParameters=%7B%22extent%22%3A%7B%22spatialReference%22%3A%7B%22latestWkid%22%3A2193%2C%22wkid%22%3A2193%7D%2C%22xmin%22%3A1752242.4364089235%2C%22ymin%22%3A5939768.593982927%2C%22xmax%22%3A1752548.184522064%2C%22ymax%22%3A5940074.342096068%7D%2C%22mode%22%3A%22view%22%2C%22originPosition%22%3A%22upperLeft%22%2C%22tolerance%22%3A0.5971642834777837%7D&resultType=tile&returnExceededLimitFeatures=false&spatialRel=esriSpatialRelIntersects&where=1%3D1&geometryType=esriGeometryEnvelope&inSR=2193')
Or any URL for that domain I just get Error: Network connection lost. without any explanation. I'm working locally, It works perfectly fine in the browser, Using CURL or PostMan. So I suspect there is an actual issue with workerd or something here. Full log:
[wrangler:error] Error: Network connection lost.
at async jsonError (file:///home/dylan/Data/CIBIT/property-report/node_modules/wrangler/templates/middleware/middleware-miniflare3-json-error.ts:22:10)
at async drainBody (file:///home/dylan/Data/CIBIT/property-report/node_modules/wrangler/templates/middleware/middleware-ensure-req-body-drained.ts:5:10)
[wrangler:error] Error: Network connection lost.
at async jsonError (file:///home/dylan/Data/CIBIT/property-report/node_modules/wrangler/templates/middleware/middleware-miniflare3-json-error.ts:22:10)
at async drainBody (file:///home/dylan/Data/CIBIT/property-report/node_modules/wrangler/templates/middleware/middleware-ensure-req-body-drained.ts:5:10)
4 Replies
tuzzmaniandevil
tuzzmaniandevilOPโ€ข3w ago
GitHub
๐Ÿ› BUG: Error: Network connection lost. ยท Issue #8087 ยท cloudfl...
Which Cloudflare product(s) does this pertain to? Miniflare What versions are you using? 3.20241106.0 [Miniflare], v18.20.4 [Node.js] What operating system and version are you using? Ubuntu 20.04.6...
tuzzmaniandevil
tuzzmaniandevilOPโ€ข3w ago
Some more details
โœ˜ [ERROR] workerd/jsg/util.c++:322: info: exception = kj/async-io-unix.c++:568: disconnected: ::read(fd, buffer, maxBytes): Connection reset by peer

โœ˜ [ERROR] workerd/io/worker.c++:2166: info: uncaught exception; source = Uncaught (in promise); stack = Error: Network connection lost.

workerd/io/worker.c++:2166: info: uncaught exception; source = Uncaught (in response); stack =
Error: Network connection lost.
โœ˜ [ERROR] workerd/jsg/util.c++:322: info: exception = kj/async-io-unix.c++:568: disconnected: ::read(fd, buffer, maxBytes): Connection reset by peer

โœ˜ [ERROR] workerd/io/worker.c++:2166: info: uncaught exception; source = Uncaught (in promise); stack = Error: Network connection lost.

workerd/io/worker.c++:2166: info: uncaught exception; source = Uncaught (in response); stack =
Error: Network connection lost.
josula
josulaโ€ข3w ago
I have a similiar issue. did you find a fix yet?
tuzzmaniandevil
tuzzmaniandevilOPโ€ข3w ago
Nope nothing ๐Ÿ™ I'm not getting any replied from CF either

Did you find this page helpful?