Elixir: Can’t set short node name! Please check your configuration

When deploying a preview environment for the first time, a command set in the render.yaml to afterFirstDeployCommand: _build/prod/rel/redacted/bin/redacted rpc "Redacted.Seed.run()" is failing with the error saying Can’t set short node name! Please check your configuration

Calling hostname -s | wc -m in the shell tab returns 41, which seems to be too long, but calling the same command (_build/prod/rel/redacted/bin/redacted rpc "Redacted.Seed.run") in the shell tab of that same PR env is working OK. Also the app itself is deployed successfully and running OK.

I am wondering if the hostname is empty at the moment the afterFirstDeployCommand is being run, or what could be wrong.

Any help would be really appreciated. :slight_smile:

We’re looking at the issue and will respond soon!

1 Like

This could help you with the investigation.

I tried to use this command instead:

_build/prod/rel/redacted/bin/redacted rpc "IO.inspect(System.cmd(\"hostname\", [])); IO.inspect(System.cmd(\"hostname\", [\"-s\"]))"

And there was the same error.

But then I tried this one (eval instead of rpc):

_build/prod/rel/redacted/bin/redacted eval "IO.inspect(System.cmd(\"hostname\", [])); IO.inspect(System.cmd(\"hostname\", [\"-s\"]))"

And it worked.

I guess there’s an issue, that calling rpc doesn’t know where the build is actually running. It’s probably on some other node or something similar. Am I right?

Hi Stefan,

Thanks for reporting this issue. We’ve updated the Elixir environment and you should now be able to specify rpc commands as part of the afterFirstDeployCommand.

1 Like

It’s working now. Thanks a lot for your help. :ok_hand:

2 Likes