when run remote in container (only one node), get noconnection error
nobody@8:/app$ bin/pome_server_v2 remote
14:39:09.721 [error] Process #PID<0.103.0> on node :"rem-4673-pome_server_v2@8" raised an exception
** (MatchError) no match of right hand side value: {:error, :noconnection}
lib/iex.ex:923: IEx.cli/1
query pid also faild
nobody@8:/app$ bin/pome_server_v2 pid
--rpc-eval : RPC failed with reason :noconnection
run epmd -names
nobody@8:/app$ erts-14.0.1/bin/epmd -names
epmd: up and running on port 4369 with data:
name pome_server_v2 at port 40331
i’m a bit confused here. it seems to me that the guide is not about deployment but about building a release inside a docker container. it just uses a container to create the build so there’s nothing running in there. to use remote the app needs to run.
anyway in the same directory where you ran remote you should be able to run the server also. don’t have time atm to remind myself of the command.
overall if you’re new to this i’d suggest using fly.io - they deploy both app and database with a single command, create all the build configurations (also using docker). it just works.
I ran into the same issue when deploying via mrsk. They prefix the docker hostname with the ip address of the host. This will then lead to incomplete hostnames because :inet.gethostname() returns just the short name which would be the first part of the ip address (see inet:gethostname removes text after "." in hostnames · Issue #5265 · erlang/otp · GitHub).
And breaks the ./bin/app remote command because it tries to connect to the wrong host (app@123 instead of app@123.123.123.123-hash).
To fix this, you need to configure your release to use name isntead.