Error: failed to spawn command: /app/bin/migrate: No such file or directory (os error 2)

For some reason, the following error started today. If I build the docker file locally, the file is there and the permissions are correct.

2023-05-21T02:48:33Z runner[9080e690a53318] iad [info]Configuring firecracker
2023-05-21T02:48:33Z app[9080e690a53318] iad [info]Starting init (commit: 15f6405)...
2023-05-21T02:48:33Z app[9080e690a53318] iad [info]Preparing to run: `/app/bin/migrate` as nobody
2023-05-21T02:48:33Z app[9080e690a53318] iad [info]Error: failed to spawn command: /app/bin/migrate: No such file or directory (os error 2)
2023-05-21T02:48:33Z app[9080e690a53318] iad [info]        does `/app/bin/migrate` exist and is it executable?
2023-05-21T02:48:33Z app[9080e690a53318] iad [info][    0.103642] reboot: Restarting system
2023-05-21T02:48:33Z app[9080e690a53318] iad [warn]Virtual machine exited abruptly
2023-05-21T02:48:33Z runner[9080e690a53318] iad [info]machine restart policy set to 'no', not restarting

If I remove the release command, the error is presented with by with /app/bin/server

[deploy]
  release_command = "/app/bin/migrate"

I’ve tried various version on Elixir and nothing works. Also, I tried deploying from GitHub Actions and the same error persists.

Any guidance would be super helpful. By the way, I’m running on V2 apps.

The issue is resolved. The files were using the CRLF line endings which does not play well with the container. Cloning the repo to my Mac and running the git add --renormalize . fixed the issue.

The long term solution is to add a .gitattributes file to the root of the project. That way, the line endings will be correct for both Windows and Mac development machines.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.