EXRM: Unknown command command

Hey everyone,

I’ve encountered a problem which I’m having some trouble solving. I’m working on an older Elixir/Phoenix codebase that uses EXRM for releases and I discovered yesterday that the migration task isn’t working in AWS. I’ve logged into the EC2 instance and from there have connected to a docker container where the release folders are. When I run this command: app/bin/backend command Elixir.Release.Tasks migrate I get the following error:

Usage: backend COMMAND [ARGS]

The known commands are:

    start          Starts the system
    start_iex      Starts the system with IEx attached
    daemon         Starts the system as a daemon
    daemon_iex     Starts the system as a daemon with IEx attached
    eval "EXPR"    Executes the given expression on a new, non-booted system
    rpc "EXPR"     Executes the given expression remotely on the running system
    remote         Connects to the running system via a remote shell
    restart        Restarts the running system via a remote command
    stop           Stops the running system via a remote command
    pid            Prints the operating system PID of the running system via a remote command
    version        Prints the release name and version to be booted

ERROR: Unknown command command

I suspect that I didn’t install everything for my application correctly but I’m flummoxed with how to fix it. Any help would be appreciated.


Should command be replaced by the comand you wish to use, e.g.: app/bin/backend eval "EXPR" where "EXPR" is the expression you want to execute?

I was following this example to get it working: Running migration in an Exrm release « Plataformatec Blog

So I took it as literally meaning “command” as the second argument of app/bin/backend command Elixir.Release.Tasks migrate

You can either go back to pre 1.10 elixir to continue to use exrm, or to use the newer way of migration, as per @muelthe has suggested. The official latest doc on this is here

Thanks @derek-zhou , @muelthe

I ended getting it working with this: docker exec -it fc25b2987f22 "/app/bin/backend" "rpc" "Release.Tasks.migrate" based on the docs. I didn’t know they changed it after 1.10.

1 Like

The command works but I have a weird issue. I run it in the context of docker:

docker exec -it 7e4398fc38c4 app/bin/backend "rpc" "Release.Tasks.migrate"

However if I run it a second time I get this error:
RPC failed with reason :nodedown. Then the container dies and it spawns a new one.

Does anyone know why this could be?