jdj_dk

jdj_dk

My app does not pick up the changed hostname on my VPS

Hi everyone.

I’m trying to setup a small cluster with three nodes. I’m using libcluster as I have before. But my nodes doesn’t have a usable hostname. The VPS came with a hostname like this: ip-123-123-123-123. I’ve changed the hostname on the VPS but it doesn’t get picked up in the app when I restart it. I’ve restarted the server. And i can see that the hostname has changed on the server it self.

I’m seeing in the logs when it starts that it’s using the old hostname, which included the IP of the vps. So I get this error:

21:36:48.538 [error] ** System running to use fully qualified hostnames **
: ** Hostname ip-x-x-x-x is illegal **

The app is built using Mix release. From the docs I can see that I should be able to set RELEASE_DISTRIBUTION and RELEASE_NODE env variables. I’ve set them to the following:

RELEASE_DISTRIBUTION=name
RELEASE_NODE=app_name@host.url.com

I would assume doing so would force change the hostname in the app as well. But it doesn’t seem to be the case. What am I missing. Thanks in advance :slightly_smiling_face:

Most Liked

LostKobrakai

LostKobrakai

This is what I found when looking for what makes an hostname valid as opposed to illegal. Maybe you’re missing the resolvable and reachable part.

Long names need the hostname to be resolvable and reachable, in other words it needs to either be an IP address or a valid DNS name. In the case of an IP address, it is already resolved so it only needs to be reachable from the current host. In the case of a DNS name, it needs to be resolvable by any one of the DNS resolution mechanisms on the host (/etc/hosts, /etc/resolve.conf, etc.) to an IP address which is reachable from the current host.

NobbZ

NobbZ

No, the s in sname is for “short”. Some check in the BEAM will even error if there is a dot in a sname.

fsa

fsa

More straw grasping - you can try to put this at the top/start of some/any scripts you would like to debug:

set -x

it echoes results of the commands in the script file as it executes…

( you can also run it as:
sh -x scriptname
if you can’t/don’t want to edit the scripts themselves)

Best of luck.

Where Next?

Popular in Troubleshooting Top

alexlanderzander
Hello everyone, I’m working on a blockchain project in Elixir and I’m implementing some of the core cryptography in a Rust NIF using Rus...
New
chocolatedonut
Besides (over)logging every code-path leading to Repo.insert_all, is it possible to make Postgrex and/or ecto_sql log the exact, failing ...
New
Ferenc
I have installed it on Phoenix 1.8.1 (without authentication or other packages and got 2 problems). I had to set up things manually the ...
New
mooreryan
In a project I’m working on, I cannot get tests with breakpoints or pry working. Here is an example in a new mix project. Create a fresh...
New
harmon25
Hi All, I am bumping into a weird issue with an umbrella app while upgrading to latest Elixir 1.19.x + otp28. A couple apps in the umbr...
New
runyonave
We have been stuck on this for a few days now and I am really not sure what could be missing. I can get chromic_pdf to work perfectly fin...
New
jason.o
I don’t get an error directly related to Paraxial, but removing that dependency stopped the crash. Has anyone experienced a similar issu...
New
michaelterryio
Hey, I’ve got a project with several path dependencies. Some are phoenix apps, but this likely isn’t relevant. I don’t fully understand...
New
arnoldwolfe
I’ve been unable to deploy apps for over a week now due to the following error. It all started when Github has issues with GitHub Actions...
New
onelastdance
Hey there, Using the install script method recommended here on Ubuntu 24.04: And then running the following commands: iex> :obser...
New

Other popular topics Top

senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 35421 110
New
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers' Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New

We're in Beta

About us Mission Statement