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

I am having this issue now, running this Dockerfile:

FROM alpine:latest

RUN apk add --no-cache \
  unzip \
  # this is needed only if you want to use scp to copy later your pb_data locally
  openssh

ARG PB_VERSION=0.12.2

# download and unzip PocketBase
ADD https://github.com/pocketbase/pocketbase/releases/download/v${PB_VERSION}/pocketbase_${PB_VERSION}_linux_amd64.zip /tmp/pb.zip
RUN unzip /tmp/pb.zip -d /pb/

EXPOSE 8080

COPY "/pb_migrations" "/pb/pb_migrations" 

# start PocketBase
CMD ["/pb/pocketbase", "serve", "--http=0.0.0.0:8080"]

Can’t see any status errors on https://status.flyio.net/

This issue came out of nowhere (it was working previously). I have been creating and destroying apps with the same name, and deploying. Experimenting with using Fly.io for my CI/CD/testing-flow (but then it has to be reliable :confused: )

EDIT

I ran restart, and monitored the logs on the dashboard. I can see that pocketbase is started correctly

2023-02-14T14:13:26.000 runner[4068f602] ams [info] Shutting down virtual machine
2023-02-14T14:13:26.119 app[4068f602] ams [info] Sending signal SIGINT to main child process w/ PID 520
2023-02-14T14:13:27.080 app[4068f602] ams [info] Starting clean up.
2023-02-14T14:13:30.010 runner[89163a1b] ams [info] Starting instance
2023-02-14T14:13:30.107 runner[89163a1b] ams [info] Configuring virtual machine
2023-02-14T14:13:30.121 runner[89163a1b] ams [info] Pulling container image
2023-02-14T14:13:33.165 runner[89163a1b] ams [info] Unpacking image
2023-02-14T14:13:35.157 runner[89163a1b] ams [info] Preparing kernel init
2023-02-14T14:13:35.691 runner[89163a1b] ams [info] Configuring firecracker
2023-02-14T14:13:35.803 runner[89163a1b] ams [info] Starting virtual machine
2023-02-14T14:13:36.175 app[89163a1b] ams [info] Starting init (commit: c19b424)...
2023-02-14T14:13:36.221 app[89163a1b] ams [info] Preparing to run: `/pb/pocketbase serve --http=0.0.0.0:8080` as root
2023-02-14T14:13:36.243 app[89163a1b] ams [info] 2023/02/14 14:13:36 listening on [fdaa:1:346f:a7b:c6ef:8916:3a1b:2]:22 (DNS: [fdaa::3]:53)
2023-02-14T14:13:36.456 app[89163a1b] ams [info] > Server started at: http://0.0.0.0:8080
2023-02-14T14:13:36.456 app[89163a1b] ams [info] - REST API: http://0.0.0.0:8080/api/
2023-02-14T14:13:36.456 app[89163a1b] ams [info] - Admin UI: http://0.0.0.0:8080/_/
Could not proxy HTTP request. Retrying in 23 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 1000 ms (attempt 40)
Could not proxy HTTP request. Retrying in 1000 ms (attempt 50)
Could not proxy HTTP request. Retrying in 23 ms (attempt 1)
Could not proxy HTTP request. Retrying in 1000 ms (attempt 60)

Help plz…

Also: CLI version is flyctl v0.0.456 linux/amd64 Commit: 43371b58 BuildDate: 2023-02-08T22:32:29Z

I have the same issue. I checked the port on toml config and dockerfile, no mistakes on port. Plus, it’s been running smoothly before I deployed this particular commit.


2023-02-16T07:40:03.669 app[82dc0178] sin [info] /___/\__/_//_/\___/ v4.10.0

2023-02-16T07:40:03.669 app[82dc0178] sin [info] High performance, minimalist Go web framework

2023-02-16T07:40:03.669 app[82dc0178] sin [info] https://echo.labstack.com

2023-02-16T07:40:03.669 app[82dc0178] sin [info] ____________________________________O/_______

2023-02-16T07:40:03.669 app[82dc0178] sin [info] O\

2023-02-16T07:40:03.669 app[82dc0178] sin [info] ⇨ http server started on [::]:9000

2023-02-16T07:40:05.779 proxy[82dc0178] sin [warn] Could not proxy HTTP request. Retrying in 1000 ms (attempt 20)

2023-02-16T07:40:12.042 proxy[82dc0178] sin [warn] Could not proxy HTTP request. Retrying in 1000 ms (attempt 40)

2023-02-16T07:40:15.786 proxy[82dc0178] sin [warn] Could not proxy HTTP request. Retrying in 947 ms (attempt 30)

2023-02-16T07:40:22.062 proxy[82dc0178] sin [warn] Could not proxy HTTP request. Retrying in 1000 ms (attempt 50)

2023-02-16T07:40:25.765 proxy[82dc0178] sin [warn] Could not proxy HTTP request. Retrying in 1000 ms (attempt 40)

2023-02-16T07:40:32.015 proxy[82dc0178] sin [warn] Could not proxy HTTP request. Retrying in 1000 ms (attempt 60)

I’m running into similar problems.

I logged into the console of my application and installed lsof to see what was actually going on, and found

atuin   513 atuin   11u     IPv4               4381      0t0  TCP *:8080 (LISTEN)

as the port I’m listening to; I’ve also installed curl and was able to verify
that I can get bits when I do curl http://0.0.0.0:8080/.

Getting the same problem. What’s happening here? My app is listening on 80, when I ssh in and do curl http://0.0.0.0.0 it works fine.

Your internal_port is set to 8080, not 80. That means our proxy and the health checks are failing to connect on port 8080.

Either you need to make your app listen on 8080 or change your internal_port in your fly.toml to 80.

THANK YOU, I should’ve seen that. It is working now.

Same problem. Yesterday I deployed and everything was working fine.

Today

2023-03-05T11:14:26.798 proxy[fe664dcb] waw [warn] Could not proxy HTTP request. Retrying in 1000 ms

Configuration:

Dockerfile

EXPOSE 8000

Fly config

[[services]]
http_checks =
internal_port = 8000
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”

Entrypoint

gunicorn config.wsgi:application --workers 2 --bind 0.0.0.0:8000 --reload --access-logfile ‘-’ --log-level ‘info’ --capture-output --enable-stdio-inheritance

After redeploying the app (without ANY changes) everything is working fine.

@tomwojcik They are saying expect more proxy retries for instances of new deployments on the status page. It’s an ongoing issue for the last 24 hours or so

1 Like

if it helps, explicitly defining the port under [env] fixed this for me:

[env]
  PORT = "8080"

[experimental]
  cmd = "start_with_migrations.sh"
  entrypoint = "sh"

[[services]]
  internal_port = 8080
  processes = ["app"]
  protocol = "tcp"
  [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