Frequent ERR_CONNECTION_CLOSED errors

I frequently get ERR_CONNECTION_CLOSED errors when I deploy or make scaling changes to my fly.io app. It’s a RoR app with a custom domain and certificate. Any help on how to debut would be greatly appreciated.

More context: the application was previously working. The change I made recently that caused the error was to scale from 256mb to 512mb or RAM

hey there-- thanks for the extra context! A couple of things that might help you narrow this down further (since you noticed it happened after a resize):

  • you can view all instances an app has had over the past 7 days with fly status --all
  • then, you can grab logs on any instance with either fly logs -i <alloc-id> (ephemeral) or fly vm stattus <alloc-id> (permanent)
1 Like

Thanks! Very helpful, and I will do some experimenting to try to recreate the issue and report back here with what I learn.

Interesting update: opening a console (fly ssh console) and then a rails console (cd app and bin/rails c) causes the app to go into this state. If I use curl it returns a totally normal response, but the browser does not (same as the screenshot above). Mysterious.

$ curl -vvv https://codesprout.com > foo.html
...
< HTTP/2 200
< x-frame-options: SAMEORIGIN
< x-xss-protection: 0
< x-content-type-options: nosniff
< x-download-options: noopen
< x-permitted-cross-domain-policies: none
< referrer-policy: strict-origin-when-cross-origin
< link: </assets/application-f38d7e99dfc140c4207d2c202a47ff3315b5570f20d59361e3e39799f992c036.css>; rel=preload; as=style; nopush,</assets/main-1cbc97a7bc4fce2cc687b5de228e68cb1796e22acda2227ceec03b6cfd66a9fe.css>; rel=preload; as=style; nopush
< content-type: text/html; charset=utf-8
< vary: Accept
< etag: W/"80721ba8d2b0bf82362ad88eaba4c4fb"
< cache-control: max-age=0, private, must-revalidate
< set-cookie: _codesprout_session=<XXX>; path=/; HttpOnly; SameSite=Lax
< x-request-id: 05caaa27-6ff6-4af3-901f-343e28487b4c
< x-runtime: 0.006631
< fly-cache-status: MISS
< date: Fri, 03 Jun 2022 21:09:50 GMT
< server: Fly/0dfe4d5d3 (2022-05-31)
< via: 2 fly.io
< fly-request-id: 01G4NPE9XFG4YSFSN8KKBJR2TG-lga
<

The resulting foo.html is totally normal.

Also, an incognito browser window returns a normal response. So it’s session-based, I guess :interrobang: