I’m trying to deploy a Phoenix app on Fly.io with a PostgreSQL database, but I keep running into a problem during the release phase — the release command just never finishes and ends up timing out.
Here’s what I’ve got in my fly.toml:
[deploy]
release_command = '/app/bin/migrate'
This is the error log:
INFO Preparing to run: `/app/bin/migrate` as nobody
INFO SSH listening listen_address=[...]
❌ release command failed - aborting deployment. timeout reached
and this is my runtime.ex
if config_env() == :prod do
config :server, Server.Repo,
url: System.get_env("DATABASE_URL"),
ssl: true,
pool_size: 10
end
I even tried increasing the timeout to 30 minutes using --release-command-timeout, but the command still hangs with no output and eventually fails.
Is there a way to debug what’s going wrong? Maybe I’m missing something obvious — this is my first time setting up deployment like this.
I’d start off with removing that line from your config, redeploying your site so it is operational, shell in, then run that command manually. Does it work then?
Great, that helps narrow things down; we can assume this is why it won’t run automatically. Does this command have a --help switch, or maybe a --verbose mode?
Right, but you can’t give up there; you’re just getting started in a nice debugging session. Consider making some observations here, by way of experimentation, to help us help you.
Is /app/bin/migrate a binary, or does it have a hashbang? If the latter, what is its runtime?
I assume Phoenix is a web framework and migrate is part of a built-in ORM. Point us to the docs; that should indicate what switches would be helpful.
Is this library open source and on GitHub? If so, is there a relevant bug report?
Can you spin up this machine locally in Docker? If so, does the migrate command behave differently there?
I tried running /app/bin/migrate manually from the Fly.io SSH console. The binary is definitely there (I can see it listed in /app/bin), but as soon as I run it, the terminal just exits and throws me back into my local shell
So it doesn’t freeze anymore, but it also doesn’t do anything visible, no logs, no error, just exits immediately. Not sure if it crashed silently or if something is misconfigured.
Urgh, this looks like you’re trying to run a Windows binary in Linux. That definitely ain’t gonna work. Or, at any rate, maybe a Windows path (“C:\…”) is configured somewhere.
OK. Say more? It helps if you expand on what you’ve tried, in substantial detail, otherwise it requires me to expend another question loop asking you what you tried.
It looks like Ecto is a Python system. So, as a baseline, you need to get some Ecto code running in Python to print out the state of your migrations.
Final question for this evening; what base Docker image are you using? If it is Debian you should be fine, if it is something lightweight, like Alpine, there are subtle differences in some libraries that make things a bit harder to get going.