Hi, I’m a newbie to the platform and I want to migrate over from Heroku.
I followed the docker quickstart information and am having trouble accessing my service.
I have a java application running inside a docker container that connects to a postgres database. The database is fine, my container can access that internally and I can access it externally from my tooling, but I’ve tried everything I can see in the docs to get the service itself available externally and am running in to issues.
Here is my fly.toml:
app = "valuable-api" kill_signal = "SIGINT" kill_timeout = 5 processes =  [build] image = "registry.fly.io/valuable-api:latest" [env] [experimental] allowed_public_ports =  auto_rollback = true [[services]] internal_port = 8080 processes = ["app"] protocol = "tcp" script_checks =  [services.concurrency] hard_limit = 25 soft_limit = 20 type = "connections" [[services.ports]] handlers = ["http"] port = 80 [[services.ports]] handlers = ["tls", "http"] port = 443 [[services.http_checks]] interval = 10000 grace_period = "60s" method = "get" path = "/actuator/health" protocol = "http" timeout = 5000 tls_skip_verify = false
The health check on
/actuator/health is working, and I can see traces forming out of that and into Honeycomb. When I deploy it takes a long time, but the container is eventually marked as healthy.
When I make a request to
https://valuable-api.fly.dev/actuator/health the request yields
Error: Exceeded maxRedirects. Probably stuck in a redirect loop https://valuable-api.fly.dev/actuator/health. When I make a request to the IP address of the service I get the same (using https for the fly.dev URL and HTTP for the IP address) I get the same thing.
The output of
fly info is:
App Name = valuable-api Owner = personal Version = 19 Status = running Hostname = valuable-api.fly.dev Services PROTOCOL PORTS TCP 80 => 8080 [HTTP] 443 => 8080 [TLS, HTTP] IP Adresses TYPE ADDRESS REGION CREATED AT v4 18.104.22.168 12h50m ago v6 2a09:8280:1::1:1b41 12h50m ago
Everything looks like it is configured correctly, so I don’t know why I would be getting this issue (I have a
PORT environment variable that defines the port my application inside the container listens to, that is set to 8080). I know that my container is indeed listening on 8080 because
fly logs gives:
2022-01-22T10:45:37.545 app[87cb4e8f] syd [info]2022-01-22 10:45:37.539 INFO 516 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
So I have a running container on a URL and IP, where the listeners appear to be taking traffic and pointing it towards my container, but somewhere the request gives
Error: Exceeded maxRedirects. Probably stuck in a redirect loop https://valuable-api.fly.dev/actuator/health regardless of the listeners.
So how come the Fly platform can access my healthchecks, see mark them as healthy while my application writes that traffic out to Honeycomb and yet I can’t access it?
Would love some help as it would be great to move entirely away from Heroku. The platform isn’t well suited for me as they lack availability zones in my area, but without solving this problem I won’t be able to migrate.
Thanks so much for any help you might have!