Hello!
I’m consistently getting the “Failed due to unhealthy allocations” error when deploying an Elixir app from Windows, but not from my MacOS machine.
The Windows machine does not have docker installed, and when deploying via Mac I turn off the Docker deamon so in both cases I’m using a remote builder.
The best topic on the issue I’ve found is: Failed due to unhealthy allocations which seems to be an issue with ports mismatching.
My fly.toml has
[[services]]
internal_port = 4000
protocol = "tcp"
My runtime.exs has this in the endpoint config
http: [
# Enable IPv6 and bind on all interfaces.
# Set it to {0, 0, 0, 0, 0, 0, 0, 1} for local network only access.
# See the documentation on https://hexdocs.pm/plug_cowboy/Plug.Cowboy.html
# for details about using IPv6 vs IPv4 and loopback vs public addresses.
ip: {0, 0, 0, 0, 0, 0, 0, 0},
port: String.to_integer(System.get_env("PORT") || "4000"),
],
I’m not sure what this can be – but I did try deploying on Windows 3 times in a row and failed, and then succeeded the first try on the Mac.
Any advice as to how to debug this further?
Thank you!
We’ll that’s strange. There shouldn’t be any difference between macOS and Windows as far as the deployed image is concerned, especially if you use the remote builder. Is there anything relevant in the logs of the failing VM? What’s the app name? We can poke at the logs and see if anything stands out.
Also, you can force flyctl to use the remote builder with the —remote-only
flag without stopping Docker.
Thanks Michael!
The app is called little-hill-2533
please do tell me if the logs are relevant! I didn’t see anything relevant or any difference really other than the failure at the end.
The failing VMs have this in the logs right before they crash:
Running: `bin/pref start` as nobody
bin/pref: /app/releases/0.1.0/env.sh: line 2:
: not found
Main child exited normally with code: 127
I’m not sure what that means, but it looks like the images from Windows don’t work. Are you able to build and run them locally with Docker?
Thanks for catching this, I will look into this.
When debugging it would be helpful to know what is being actually executed on my machine before it gets sent to the build server? Both builds are from the same commit on a clean working tree, so I’m trying to figure out what operation is failing on windows
Thanks!