# Interactive apps launching with wrong host

**URL:** https://discourse.openondemand.org/t/interactive-apps-launching-with-wrong-host/4235
**Category:** Get Help
**Created:** [May 5, 2025, 6:15pm UTC](https://discourse.openondemand.org/t/interactive-apps-launching-with-wrong-host/4235 "2025-05-05T18:15:04Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![kstine](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/kstine/32/2539_2.png) [@kstine](https://discourse.openondemand.org/u/kstine)
#### Post date: [May 5, 2025, 6:15pm UTC](https://discourse.openondemand.org/t/interactive-apps-launching-with-wrong-host/4235/1 "2025-05-05T18:15:04Z")

</div>

We’re currently running into an odd issue where apps aren’t launching with the correct hostname.

The output.log for Jupyter for instance lists the following:

```auto
[I 2025-05-05 10:41:06.653 ServerApp] Jupyter Server 2.14.2 is running at:
[I 2025-05-05 10:41:06.653 ServerApp] http://n01:6808/node/n01.cm.cluster/6808/lab
[I 2025-05-05 10:41:06.653 ServerApp] http://127.0.0.1:6808/node/n01.cm.cluster/6808/lab
[I 2025-05-05 10:41:06.653 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[W 2025-05-05 10:41:06.657 ServerApp] No web browser found: Error('could not locate runnable browser').
[I 2025-05-05 10:41:06.668 ServerApp] Skipped non-installed server(s): bash-language-server, dockerfile-language-server-nodejs, javascript-typescript-langserver, jedi-language-server, julia-language-server, pyright, python-language-server, python-lsp-server, r-languageserver, sql-language-server, texlab, typescript-language-server, unified-language-server, vscode-css-languageserver-bin, vscode-html-languageserver-bin, vscode-json-languageserver-bin, yaml-language-server
Discovered server listening on port 6808!
Generating connection YAML file...

```

However, `http://n01:6808` should say `http://n01.<sitename>.edu:6808` instead. I can verify that manually accessing the url with `http://n01.<sitename>.edu:6808` works fine.

This happens on every app, not just Jupyter.

Any help figuring this out is appreciated.

---

<div class="post-metadata">

### Author: ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)
#### Post date: [May 5, 2025, 8:59pm UTC](https://discourse.openondemand.org/t/interactive-apps-launching-with-wrong-host/4235/2 "2025-05-05T20:59:31Z")

</div>

I’m sure it has something to do with `/etc/resolve.conf` and how your hostnames are being generated as just the shortname instead of the FQDN.

I tried to find the source code for where this is, but it’s too buried for me to find how exactly they come to that hostname, but I’m sure it’s out of the python’s socket library which is pretty low level.

---

<div class="post-metadata">

### Author: ![kstine](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/kstine/32/2539_2.png) [@kstine](https://discourse.openondemand.org/u/kstine)
#### Post date: [May 5, 2025, 9:51pm UTC](https://discourse.openondemand.org/t/interactive-apps-launching-with-wrong-host/4235/3 "2025-05-05T21:51:18Z")

</div>

Changing `host=$(hostname)` in the cluster yml doesn’t change the hostname either. All it does is modify the `n01.cm.cluster` portion.

---

<div class="post-metadata">

### Author: ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)
#### Post date: [May 6, 2025, 3:27pm UTC](https://discourse.openondemand.org/t/interactive-apps-launching-with-wrong-host/4235/4 "2025-05-06T15:27:47Z")

</div>

If you run a script like this on a compute node, what does it return? The FQDN or the simple name?

```python
#!/usr/bin/env python3

import socket

print(socket.gethostname())

```

---

<div class="post-metadata">

### Author: ![kstine](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/kstine/32/2539_2.png) [@kstine](https://discourse.openondemand.org/u/kstine)
#### Post date: [May 6, 2025, 5:06pm UTC](https://discourse.openondemand.org/t/interactive-apps-launching-with-wrong-host/4235/5 "2025-05-06T17:06:06Z")

</div>

> [@jeff.ohrstrom](#):
>
> `print(socket.gethostname())`

It gives the short name, so `n01` instead of `n01.<sitename>`

---

<div class="post-metadata">

### Author: ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)
#### Post date: [May 6, 2025, 5:14pm UTC](https://discourse.openondemand.org/t/interactive-apps-launching-with-wrong-host/4235/6 "2025-05-06T17:14:25Z")

</div>

Seems like it’s an issue with your compute nodes more than OnDemand. Also, the `/etc/hosts` file is another file you’ll need to reference.

Here’s a stackexchange question I found that may be helpful.

[https://unix.stackexchange.com/questions/530064/dnsdomainname-and-hostname-f-does-not-return-fqdn](https://unix.stackexchange.com/questions/530064/dnsdomainname-and-hostname-f-does-not-return-fqdn)

Of course this seems like it’s an issue on your systems which may require a larger change that you may not want to accommodate. There’s no configuration in OnDemand that can change this - this is related to how you’re compute nodes are networked.

As to the issue with OnDemand - does it affect the applications if they boot with the short name? Do you have issues with OnDemand because you’re not using the FQDN?

---

<div class="post-metadata">

### Author: ![snowbird294](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/snowbird294/32/2099_2.png) [@snowbird294](https://discourse.openondemand.org/u/snowbird294)
#### Post date: [May 13, 2025, 4:26pm UTC](https://discourse.openondemand.org/t/interactive-apps-launching-with-wrong-host/4235/7 "2025-05-13T16:26:08Z")

</div>

I will note that I had similar issues in reverse, and you can tinker with the hostname command in your clusters.d/name.yml

Example that fixes to use only shortname and fixes some capitalization weirdness from a DNS upgrade that wasn’t propagating at expected speed.

```auto
set_host: "host=$(hostname | awk -F. '{print $1}' | tr A-Z a-z )"

```

You could try

```auto
set_host: "host=$(hostname -f | tr A-Z a-z )"

```

which should give the full name and then lowercase it.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex015/uploads/osc/original/2X/b/bae70bd0ed39a3ae769c2108155f4cb3e9da8385.png) [@system](https://discourse.openondemand.org/u/system)
#### Post date: [November 9, 2025, 4:27pm UTC](https://discourse.openondemand.org/t/interactive-apps-launching-with-wrong-host/4235/8 "2025-11-09T16:27:05Z")

</div>

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