Can't reach webapp

I can’t reach my web app when it’s deployed to fly.io. It seems like the health check works fine because I see logs indicating that I receive requests but I can’t reach it myself. I’m listening to 0.0.0.0:8080 in the app.

This is my fly.toml:

app = "tzauth-staging"
kill_signal = "SIGINT"
kill_timeout = 5
processes = []

[[services]]
internal_port = 8080
processes = ["app"]
protocol = "tcp"
[[services.http_checks]]
grace_period = "1s"
interval = "15s"
method = "get"
path = "/healthz"
protocol = "http"
timeout = "2s"

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

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

[services.concurrency]
hard_limit = 100
soft_limit = 80

hi again @ulrikstrid :wave:t5:

Can you run the fly logs command and paste the logs that you see?

Hello @rahmatjunaid thanks for pointing me to this forum :pray:

Our app prints the routing table on every request because we need to clean up so what I’m seeing is just a bunch of routing tables with no errors.These seems to correspond to when the healthcheck is running and I’m not seeing anything when I refresh my browser.

@rahmatjunaid I have now updated the logging handling so it’s at least somewhat resonable.
And as you can see we only have requests to the /healthz endpoint

2022-08-12T18:25:26.023 app[ba057140] fra [info] tzauth: [INFO] GET /healthz HTTP/1.1
2022-08-12T18:25:26.023 app[ba057140] fra [info] Host: 172.19.7.98:8080
2022-08-12T18:25:26.023 app[ba057140] fra [info] User-Agent: Consul Health Check
2022-08-12T18:25:26.023 app[ba057140] fra [info] Accept: text/plain, text/*, */*
2022-08-12T18:25:26.023 app[ba057140] fra [info] Accept-Encoding: gzip
2022-08-12T18:25:26.023 app[ba057140] fra [info] Connection: close
2022-08-12T18:25:41.023 app[ba057140] fra [info] tzauth: [INFO] GET /healthz HTTP/1.1
2022-08-12T18:25:41.023 app[ba057140] fra [info] Host: 172.19.7.98:8080
2022-08-12T18:25:41.023 app[ba057140] fra [info] User-Agent: Consul Health Check
2022-08-12T18:25:41.023 app[ba057140] fra [info] Accept: text/plain, text/*, */*
2022-08-12T18:25:41.023 app[ba057140] fra [info] Accept-Encoding: gzip
2022-08-12T18:25:41.023 app[ba057140] fra [info] Connection: close
2022-08-12T18:25:56.024 app[ba057140] fra [info] tzauth: [INFO] GET /healthz HTTP/1.1
2022-08-12T18:25:56.024 app[ba057140] fra [info] Host: 172.19.7.98:8080
2022-08-12T18:25:56.024 app[ba057140] fra [info] User-Agent: Consul Health Check
2022-08-12T18:25:56.024 app[ba057140] fra [info] Accept: text/plain, text/*, */*
2022-08-12T18:25:56.024 app[ba057140] fra [info] Accept-Encoding: gzip
2022-08-12T18:25:56.024 app[ba057140] fra [info] Connection: close
2022-08-12T18:26:11.025 app[ba057140] fra [info] tzauth: [INFO] GET /healthz HTTP/1.1
2022-08-12T18:26:11.025 app[ba057140] fra [info] Host: 172.19.7.98:8080
2022-08-12T18:26:11.025 app[ba057140] fra [info] User-Agent: Consul Health Check
2022-08-12T18:26:11.025 app[ba057140] fra [info] Accept: text/plain, text/*, */*
2022-08-12T18:26:11.025 app[ba057140] fra [info] Accept-Encoding: gzip
2022-08-12T18:26:11.025 app[ba057140] fra [info] Connection: close
2022-08-12T18:26:26.026 app[ba057140] fra [info] tzauth: [INFO] GET /healthz HTTP/1.1
2022-08-12T18:26:26.026 app[ba057140] fra [info] Host: 172.19.7.98:8080
2022-08-12T18:26:26.026 app[ba057140] fra [info] User-Agent: Consul Health Check
2022-08-12T18:26:26.026 app[ba057140] fra [info] Accept: text/plain, text/*, */*
2022-08-12T18:26:26.026 app[ba057140] fra [info] Accept-Encoding: gzip
2022-08-12T18:26:26.026 app[ba057140] fra [info] Connection: close
2022-08-12T18:26:41.027 app[ba057140] fra [info] tzauth: [INFO] GET /healthz HTTP/1.1
2022-08-12T18:26:41.027 app[ba057140] fra [info] Host: 172.19.7.98:8080
2022-08-12T18:26:41.027 app[ba057140] fra [info] User-Agent: Consul Health Check
2022-08-12T18:26:41.027 app[ba057140] fra [info] Accept: text/plain, text/*, */*
2022-08-12T18:26:41.027 app[ba057140] fra [info] Accept-Encoding: gzip
2022-08-12T18:26:41.027 app[ba057140] fra [info] Connection: close 

This seems to be a DNS issue because I can’t even dig for the address.
Not sure if it’s OK to tag you, but @eli could you look at this?

Hi! Happy to help look into things. If you’re not getting the answer you’d expect to see to your dig queries, I’d be curious to see what IPs flyctl thinks that your app is running. What does fly ips list say? (you can also allocate IP addresses to your app with the ips subcommand).

Hey, just before you posted this I saw that I was never assigned any IP for the app. I created another one (we’re doing a staging/production setup) which got a IP assigned immediately and worked.

I’ll try to assign an IP to the staging app and see if it works.

2 Likes

Allocated IPs and now that app works as well, thank you!

Of course! Thank you for bringing it up :slightly_smiling_face: