It looks you have 2 services configured that are listening on ports 80 and 443: one in the [http_service] section using internal port 3000 and another in [[services]] using internal port 8080. The [http_service] section is like a shortcut for services that listen on ports 80 and 443, so you don’t need both. See Fly Launch configuration (fly.toml) · Fly Docs.
You can delete the [http_service] section and make sure you set the [[services]]internal_port to whatever your app’s port should be. If you change it from 8080, make sure you change the [env] section too.
I’m curious how you got your fly.toml file? Did you use a fly.toml from another source or did you modify a fly.toml that was generated when you ran fly launch? We want to make sure this works better for you!
Whenever I delete http_service, flyctl will add it back automatically.
I changed the app to listen on 3000 but still get the same result (502). And with this config my healthchecks are not even being called anymore. But when I ssh into the machine, I can curl the app just fine.
I also tried the opposite, where I only use the http_server but that doesn’t work either. Except that now I’m getting a 503. The app automatically downscales, so seemingly my requests are not even hitting the app:
That second fly.toml you posted should work! In looking at logs, I see a Error: Invariant failed. Digging around, it looks like this error can pop up in remix apps on Fly.io when the SESSION_SECRET isn’t set.
You can set secrets with fly secrets set [flags] NAME=VALUE NAME=VALUE ...
Check the readme for the stack you’re using and see if that step was missed or is missing from the readme. For example, the indie stack readme has the following:
Add a SESSION_SECRET to your fly app secrets, to do this you can run the following commands: fly secrets set SESSION_SECRET=$(openssl rand -hex 32) --app indie-stack-template fly secrets set SESSION_SECRET=$(openssl rand -hex 32) --app indie-stack-template-staging
Before adding all the secrets, I wanted to get a working deployment first (verifying via the healthcheck, which requires no env vars) which so far I haven’t been able to. The error you’re seeing only pops up when I’m inside the machine and curl a localhost API.
This is me curling the healthcheck from inside the machine, which produces no errors
It also looks good to me. Can you try again, there was some sort of network overload incident that appears to have been addressed: Fly.io Status - App Logs Delayed
Suggest emailing support using the support email that you can find in your dashboard under Support. We can’t really help you in this thread (which I think is a different issue from yours).
I think your affected app is also in an org with a plan that includes email support. Suggest emailing support at the email address you can find in your dashboard under Support.
Hi @andie ,
Thanks for the help but the application am trying to restore belong to org that doesn’t have email support, Also I tried to fork the volume attached to it instead of using snapshot since there was no good news with them till now and suddenly am getting this log error:
fly vol fork vol_e628r6p873nvwmnp -r cdg -a homegas
Error: failed to get volume: failed to get volume vol_e628r6p873nvwmnp: deadline_exceeded: Post "http://[fc01:a7b:28df::]:3593/flyd.v1.VolumeService/Get": dial tcp [fc01:a7b:28df::]:3593: i/o timeout (Request ID: 01HTFK5EJ8AFACC84SYH6GHE50-cdg)
@dedsec could you try listing your snapshots now? The issue preventing that should be fixed now. Although your host is still down, you may be able to follow Troubleshoot apps when a host is unavailable · Fly Docs if you can get your volume snapshots now.
That ended up working for me and lead me to something else. Previously I had a bash scrip that would be the entrypoint of my docker image, which would call npm run start (which calls remix-server un the hood). Now I’m calling npm run start as the entrypoint directly and it seems. Seems like running it the way I was previously, messes with the port detection or something
It probably wasn’t your port, but rather your listen/bind address. If you end up only listening to localhost, you only will be able to accept connections originating from that machine. Listening to either 0.0.0.0 or [::] will enable you to accept connections from outside of the machine. I’m not entirely clear why healthchecks would work (the would originate from with the network, but I didn’t think they would originate from your actual machine).