My application deploys successfully. Tonight I am trying to add service and machine checks to my config files but having no luck - they always fail. I noticed the error below in the deploy responses, which I guess explains the check failures:
WARNING The app is not listening on the expected address and will not be reachable by fly-proxy.
You can fix this by configuring your app to listen on the following addresses:
- 0.0.0.0:3000
Found these processes inside the machine with open listening sockets:
PROCESS | ADDRESSES
-----------------*---------------------------------------
/.fly/hallpass | [fdaa:9:61c2:a7b:348:224e:7b79:2]:22
But I am deploying a rails app with the following:
Hey there, I think this might be because you have two process groups app and worker, and your fly.toml doesn’t specify that the http_service section applies only to the app Machines.
So the worker Machines are being started and our proxy is expecting them to be listening on port 3000 but they’re not because they’re worker nodes!
If you have a look at these docs (second code block), you’ll see what I think is needed, which is:
I thought about that and I think I made the change you suggest last night to check, with no luck, but I will give it a try today again just to make sure. Thanks for the response!
So, I managed to get the checks running successfully, with your advice and also make some changes in Rails config for the healthcheck URL. So everything appears to be running well, with the toml file below.
However, that message is still in the deployment logs. I don’t know, I guess just ignore it.
So that seems like the problem. Did you leave some old Machines hanging around after a weird deploy possibly?
If you’re using bluegreen and it fails half way through, you can end up with up to twice as many Machines as you had before the deploy began, because the deletion of the old Machines is the final step taken by a bluegreen deploy.
Well that’s interesting, but sounds likely. I’m not using bluegreen (yet) but I have been bringing machines up and down like crazy in the staging env for the past few days. Still learning a bunch here. How do I update the machines to have the latest - just drop them and rebuild them?
Yeh I’d identify the Machines with the wrong command: use fly m ls and look at the IMAGE column - the old Machines are probably running an old image (you can determine the most recent image using fly status; near the top you’ll see Image = ...).
Once you know the 6 old Machines, use fly m destroy --force [MACHINE_IDS].
Then if you want, you can fly scale count ... back to the right number of Machines.
Great, done. I’ve dropped and recreated all the machines, and added bluegreen deployment config setting. Seems to have done the trick. Thanks so much for the help.