ECONNRESET Error - was working yesterday (deployed SurrealDB)

Hi I have had a SurrealDB database deployed on fly.io for a while now but as of today my app in development can no longer make calls to the database.

In my vscode terminal i can see this error:

UnexpectedConnectionError: Error: read ECONNRESET
    at WebSocket.<anonymous> (file:///D:/CODE/Surreal/unofficials/surrealdb-svelte-auth-template/node_modules/surrealdb/dist/index.mjs:1:43870)
    at callListener (D:\CODE\Surreal\unofficials\surrealdb-svelte-auth-template\node_modules\ws\lib\event-target.js:290:14)
    at WebSocket.onError (D:\CODE\Surreal\unofficials\surrealdb-svelte-auth-template\node_modules\ws\lib\event-target.js:230:9)
    at WebSocket.emit (node:events:518:28)
    at emitErrorAndClose (D:\CODE\Surreal\unofficials\surrealdb-svelte-auth-template\node_modules\ws\lib\websocket.js:1041:13)
    at ClientRequest.<anonymous> (D:\CODE\Surreal\unofficials\surrealdb-svelte-auth-template\node_modules\ws\lib\websocket.js:881:5)
    at ClientRequest.emit (node:events:518:28)
    at TLSSocket.socketErrorListener (node:_http_client:495:9)
    at TLSSocket.emit (node:events:518:28)
    at emitErrorNT (node:internal/streams/destroy:169:8) {
  error: Error: read ECONNRESET
      at TLSWrap.onStreamRead (node:internal/stream_base_commons:217:20)
      at TLSWrap.callbackTrampoline (node:internal/async_hooks:130:17) {
    errno: -4077,
    code: 'ECONNRESET',
    syscall: 'read'
  }
}

Has something changed in the last 24hrs on fly.io or is there an outage in SYD location/region? I’m not sure what/where to investigate to solve this issue.

I’m also seeing weird messages in Terminal when making a flyctl command:

PS> fly version
WARN failed querying for new release: Get "https://api.fly.io/app/flyctl_releases/windows/amd64/latest": read TCP [ ***** ]:57381->[ ***** ]:443: wsarecv: An existing connection was forcibly closed by the remote host.
PS> fly apps list
Error: Post "https://api.fly.io/graphql": read TCP [ ***** ]:57839->[ ***** ]:443: wsarecv: An existing connection was forcibly closed by the remote host.

I don’t know if this is also related, but when i go to the fly.io website/my app dashboard it displays this on screen for a few seconds before the Dashboard actually Loads! >>>

Does anyone know what might be going on?

Hey @hgoona

Could you post the output of the following commands, please?

This will call our debug app via ipv4

curl -4 -sS -I -H "flyio-debug: doit"  http://debug.fly.dev

This one via ipv6:

curl -6 -sS -I -H "flyio-debug: doit"  http://debug.fly.dev

On Windows it may need to be curl.exe instead of curl.

Ok, is that info safe to display here?

PS D:\CODE> curl.exe -4 -sS -I -H "flyio-debug: doit"  http://debug.fly.dev
HTTP/1.1 200 OK
fly-region: syd
remote-addr: 172.******:64030
date: Thu, 09 Jan 2025 13:35:48 GMT
content-length: 465
content-type: text/plain; charset=utf-8
server: Fly/d5****6e2 (2024-12-18)
via: 1.1 fly.io
fly-request-id: ****************************-syd
flyio-debug: {"n":"edge-nac-syd1-b10d","nr":"syd","ra":"122.150.190.126","rf":"Verbatim","sr":"syd","sdc":"syd1","sid":"*****************","st":0,"nrtt":0,"bn":"worker-cf-syd1-76ba","mhn":null,"mrtt":null}

PS D:\CODE> curl.exe -6 -sS -I -H "flyio-debug: doit"  http://debug.fly.dev
curl: (56) Recv failure: Connection was reset
PS D:\CODE> curl.exe -6 -sS -I -H "flyio-debug: doit"  http://debug.fly.dev
curl: (56) Recv failure: Connection was reset

@pavel The last one seems to fail

When you try fly apps list it also tries to talk to the API via ipv6, right?

Are you able to reach any ipv6-only websites, for example ipv6.google.com?

When i did this right now, i got my list all of a sudden!

PS> fly apps list
NAME                                    OWNER           STATUS          LATEST DEPLOY     
******************************** 

@pavel Yes it seem i can visit https://ipv6.google.com/ on my browser…

What does that mean??

I also just did that again and it errors:

 fly apps list
Error: Post "https://api.fly.io/graphql": read tcp
...

Could you post the output of the following commands, please?

Route to api.fly.io via ipv4:

tracert /4 api.fly.io

Route to api.fly.io via ipv6:

tracert /6 api.fly.io

@pavel


Tracing route to api.fly.io [77.83.143.220]
over a maximum of 30 hops:

  1     3 ms     2 ms     1 ms  belong.gateway [10.0.0.138] 
  2    11 ms    14 ms    10 ms  lo0-30.bng31.melbvoc.vic.vocus.network [203.134.31.5] 
  3     *        *        *     Request timed out.
  4     *        *        *     Request timed out.
  5     *        *        *     Request timed out.
  6    21 ms    20 ms    19 ms  be203.lsr01.melb.vic.vocus.network [103.1.77.78] 
  7     *        *        *     Request timed out.
  8    21 ms     *        *     be200.cor03.syd14.nsw.vocus.network [103.1.77.39] 
  9     *        *        *     Request timed out.
 10     *        *        *     Request timed out.
 11     *        *        *     Request timed out.
 12    19 ms    19 ms    28 ms  77.83.143.220 
PS> tracert /6 api.fly.io

Tracing route to api.fly.io [2a09:8280:1:f28:246e:d6a:949:dbbf]
over a maximum of 30 hops:

  1     2 ms     2 ms     2 ms  2403:9e00:31cf:3900::1 
  2     8 ms     8 ms   125 ms  2403-4800--315.core.vocus.network [2403:4800::315] 
  3     8 ms   125 ms     9 ms  2403-4800-3000-2--2.core.vocus.network [2403:4800:3000:2::2] 
  4    15 ms    10 ms    10 ms  2402-7800-20-2--1b5.core.vocus.network [2402:7800:20:2::1b5] 
  5     *        *        *     Request timed out.
  6     *        *        *     Request timed out.
  7     *        *        *     Request timed out.
  8     *        *        *     Request timed out.
  9    20 ms    19 ms    20 ms  2a09:8280:1:f28:246e:d6a:949:dbbf 

@pavel does that help? any idea what’s going on?? Is it an issue with fly.io??

I’m not sure yet. It seems like an issue with ipv6, though it’s not yet clear whether it’s something on our side or something on the side of your internet provider.

@pavel Is there a course of action to find out more?? It’s nothing to do with my code, right? That’s the part that has been confusing me over the last 12hrs trying to solve this mystery

Yeah, I don’t think it has anything to do with your code.

I’m trying to find out more. I’ll get back to you once I find something new.

Any updates on this @pavel ? I’m wondering if i need to re-deploy my database or do something severe?

When trying to connect to fly using flyctl in powershell i still see this sporadic behaviour / failed connection:

Why is it inconsistent in submitting the cmd via flyctl?

EDIT:
I get these same errors if i even try to fly deploy my same deployment toml. (AGAIN, this was all working fine up until yesterday. Has something happened to the SYD region / server or something?)

@pavel @rubys @lubien tagged you guys because I saw you addressing potentially related issues>>>

I’m additionally getting this error when simply trying to use flyctl in an attempt to redeploy from scratch:

PS D:\CODE\> flyctl launch
? Would you like to copy its configuration to the new app? Yes
Error: Post "https://api.fly.io/graphql": read tcp [2403:9e00:31cf:3900:940:e7e9:a02b:477c]:59677->[2a09:8280:1:f28:246e:d6a:949:dbbf]:443: wsarecv: An existing connection was forcibly closed by the remote host.

Even when i open your fly.io docs i get weird errors “This site can’t be reached” before the page finally renders seconds later. Has something on fly.io service changed approximately on the 9/Jan/2025 ? <<<Roughly when i began receiving these issues.

Update: I have just now disabled IPv6 in my computer’s Wifi Connection settings on win10, and it appears the fly.io website links are appearing without that error msg above AND the flyctl commands appear to be working consistently!!

I’ll report back in if the errors come back, but I think this was the issue!

@hgoona residential IPv6 usually suffers from MTU misconfigurations that exhibits as the connectivity issues you are describing. I had this same issue at home an year ago, after much digging found the cause and used this website to diagnose it and read this other to fix it. I hope it helps :crossed_fingers:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.