Trying to deploy an app and getting this error: Could not proxy HTTP request.

I’m trying to deploy an app, and when trying to access it, the browser keep loading for a while and in the logs I just saw this message:

Could not proxy HTTP request. Retrying in 20 ms (attempt 1)
Could not proxy HTTP request. Retrying in 1000 ms (attempt 10)
Could not proxy HTTP request. Retrying in 1000 ms (attempt 20)
Could not proxy HTTP request. Retrying in 1000 ms (attempt 30)
Could not proxy HTTP request. Retrying in 972 ms (attempt 40)
Could not proxy HTTP request. Retrying in 1000 ms (attempt 50)
Could not proxy HTTP request. Retrying in 1000 ms (attempt 60)

Any idea what could be? Where I can get more info?

Had the same issue. Restarted the computer. It works fine now.

1 Like

What do you mean by restarting the computer? This is the logs from the app in the fly.io monitoring tab

I was trying to access my web app on my browser on my computer because it has a URL. I couldn’t access it, check the monitoring and saw I was getting the same error as you. But I checked on another device and it was working fine. So, I restarted my computer and the error is gone.

hmmm tried this, and didn’t work

2023-02-02T18:58:12.193 proxy[b4fd25b3] gru [error] instance refused connection
2023-02-02T18:58:16.601 proxy[b4fd25b3] gru [warn] Could not proxy HTTP request. Retrying in 1000 ms (attempt 60)
1 Like

are you using uptash redis? my problem went away after migrating from uptash.

no… just the app and a postgres

I was facing the same issue this morning, but only on one instance of my application.
Restarting does seem to work.
I restarted postgres, but that might be unnecessary.
I restarted the application itself with: flyctl apps restart APP_NAME

same issue :confused:

2023-02-03T02:12:11.902 proxy[494ebfbc] gru [error] instance refused connection
2023-02-03T02:12:16.205 proxy[494ebfbc] gru [warn] Could not proxy HTTP request. Retrying in 1000 ms (attempt 10)
2023-02-03T02:12:22.214 proxy[494ebfbc] gru [error] instance refused connection

Maybe it helps to restart postgres too: fly pg restart

same error :confused:
I have no idea how can I get more info about what is going on

Try incognito or a different browser. I think there is some caching at play here.

I just had the same problem and using incognito on Chrome worked

Logs are now:

Could not proxy HTTP request. Retrying in 1000 ms (attempt 20)

Could not proxy HTTP request. Retrying in 1000 ms (attempt 30)

2023-02-03T03:56:49.958 app[56334732] yyz [info] 03:56:49.957 request_id=F0A0VxJp4Mhu6NUAAAER [info] GET /

2023-02-03T03:56:49.958 app[56334732] yyz [info] 03:56:49.958 request_id=F0A0VxJp4Mhu6NUAAAER [info] Sent 200 in 576µs

2023-02-03T03:56:50.557 app[56334732] yyz [info] 03:56:50.556 request_id=F0A0VzYfNqIx-S4AAAEh [info] GET /

2023-02-03T03:56:50.557 app[56334732] yyz [info] 03:56:50.557 request_id=F0A0VzYfNqIx-S4AAAEh [info] Sent 200 in 548µs


Have the same issue. Deploying web app via docker and exposing 8080

If your application is listening on port 8080, before fly.toml uses that as the internal port.

The [services] section should define internal_port as well as “external” ports that it listens on.

This is from a Laravel app which listens on port 8080 (Fly will accept external connections on port 80 and 443):

 [[services]]
   http_checks = []
   internal_port = 8080
   processes = ["app"]
   protocol = "tcp"
   script_checks = []
   [services.concurrency]
     hard_limit = 25
     soft_limit = 20
     type = "connections"

   [[services.ports]]
     force_https = true
     handlers = ["http"]
     port = 80

   [[services.ports]]
     handlers = ["tls", "http"]
     port = 443

   [[services.tcp_checks]]
     grace_period = "1s"
     interval = "15s"
     restart_limit = 0
     timeout = "2s"

Hello, here is the config, I think it’s correct JsonPath/fly.toml at fly-io · vividus-framework/JsonPath · GitHub isn’t ?

This error means our proxy can’t get an HTTP response from your app.

The best way to troubleshoot this is to run fly ssh console, and then test your app with curl. If your app is listening on port 8080, you can test with curl like this:

curl http://0.0.0.0:8080 -v

If you’re running multiple instances, you may need to ssh to the one you see erroring in the logs. fly ssh console -s will let you pick a specific VM.

1 Like

Hi Kurt, thank you for the advice. Just tried this and it looks like app is working

Any idea where to dig in?

Thanks! my fly.toml configuration was wrong and I didn’t notice

1 Like

Hi! i´m having the same problem, what did you do? change??

Having the exat same thing, had any progress on it? Cheers!