502 - Gateway error

Hi,

i’m new to fly.io and i habe a problem :frowning:

Sometimes my website response fast - but sometimes the gateway don’t send my requests to the backend.

*   Trying 66.241.125.43:443...
* Connected to www.feurwehr.de (66.241.125.43) port 443 (#0)
* ALPN: offers h2
* ALPN: offers http/1.1
*  CAfile: /etc/ssl/cert.pem
*  CApath: none
* (304) (OUT), TLS handshake, Client hello (1):
* (304) (IN), TLS handshake, Server hello (2):
* (304) (IN), TLS handshake, Unknown (8):
* (304) (IN), TLS handshake, Certificate (11):
* (304) (IN), TLS handshake, CERT verify (15):
* (304) (IN), TLS handshake, Finished (20):
* (304) (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / AEAD-CHACHA20-POLY1305-SHA256
* ALPN: server accepted h2
* Server certificate:
*  subject: CN=www.feurwehr.de
*  start date: Jan 11 12:48:30 2023 GMT
*  expire date: Apr 11 12:48:29 2023 GMT
*  subjectAltName: host "www.feurwehr.de" matched cert's "www.feurwehr.de"
*  issuer: C=US; O=Let's Encrypt; CN=R3
*  SSL certificate verify ok.
* Using HTTP2, server supports multiplexing
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* h2h3 [:method: GET]
* h2h3 [:path: /]
* h2h3 [:scheme: https]
* h2h3 [:authority: www.feurwehr.de]
* h2h3 [user-agent: curl/7.85.0]
* h2h3 [accept: */*]
* Using Stream ID: 1 (easy handle 0x123811e00)
> GET / HTTP/2
> Host: www.feurwehr.de
> user-agent: curl/7.85.0
> accept: */*
>
* Connection state changed (MAX_CONCURRENT_STREAMS == 32)!

The logfile don’t show any hints. I already increased the amount of web-workers (but there has no connections). I don’t know whats wrong with my setup.

Best regards,
Sebastian

Just an update:

After a few hours later everythings is smooth again. That’s very frustrating - because i don’t know what was the core of the problem.

Hi,

There are a lot of variables and without any log lines to work with, it’s hard to diagnose.

It may be worth investigating whether your app is prematurely closing the connection. Experiment with any timeout values. That idea was from this post. It seemed to resolve their 502 issue (which may be unrelated of course):

I think it has something todo with the location FRA.
I switched everything to AMS and it runs smooth.