[Bug] If a computer set an invalid hostname, the entire network will be unavailable (re-emerging) #1097

Closed
opened 2025-12-29 02:28:15 +01:00 by adam · 3 comments
Owner

Originally created by @yanranxiaoxi on GitHub (Sep 10, 2025).

Is this a support request?

  • This is not a support request

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I have already learned that this issue was fixed in v0.25.0 #2343 #2393 , but it has reappeared in the current v0.26.1 version.

Expected Behavior

Automatically replace node name with the correct string format.

Steps To Reproduce

Just need to register a pure CJK character name Tailnet node on Headscale.

Environment

- OS: AlmaLinux 9
- Headscale version: v0.26.1
- Tailscale version: v1.86.2

Runtime environment

  • Headscale is behind a (reverse) proxy
  • Headscale runs in a container

Debug information

Headscale Version:

Image

Error Logs:

Image

My Nodes:

Image

After I executed the following command, all nodes immediately returned to normal:

podman exec -it headscale headscale nodes rename -i 8 abc

Originally created by @yanranxiaoxi on GitHub (Sep 10, 2025). ### Is this a support request? - [x] This is not a support request ### Is there an existing issue for this? - [x] I have searched the existing issues ### Current Behavior I have already learned that this issue was fixed in v0.25.0 #2343 #2393 , but it has reappeared in the current v0.26.1 version. ### Expected Behavior Automatically replace node name with the correct string format. ### Steps To Reproduce Just need to register a pure CJK character name Tailnet node on Headscale. ### Environment ```markdown - OS: AlmaLinux 9 - Headscale version: v0.26.1 - Tailscale version: v1.86.2 ``` ### Runtime environment - [x] Headscale is behind a (reverse) proxy - [x] Headscale runs in a container ### Debug information Headscale Version: <img width="475" height="42" alt="Image" src="https://github.com/user-attachments/assets/c590954e-e5af-4db7-826a-2b3303cb4715" /> Error Logs: <img width="930" height="303" alt="Image" src="https://github.com/user-attachments/assets/dae9de08-9687-48fd-ab0c-079e37c75fc3" /> My Nodes: <img width="934" height="317" alt="Image" src="https://github.com/user-attachments/assets/010db2c8-9d63-48ec-aa74-d2f915b94811" /> After I executed the following command, all nodes immediately returned to normal: `podman exec -it headscale headscale nodes rename -i 8 abc`
adam added the bugno-stale-bot labels 2025-12-29 02:28:15 +01:00
adam closed this issue 2025-12-29 02:28:15 +01:00
Author
Owner

@spymobilfon commented on GitHub (Oct 6, 2025):

I have the same issue with another symbol

Image

@spymobilfon commented on GitHub (Oct 6, 2025): I have the same issue with another symbol ![Image](https://github.com/user-attachments/assets/d3e6f05f-a97d-4631-a850-eb0f4a3388a6)
Author
Owner

@nblock commented on GitHub (Oct 10, 2025):

The proposed fix was not merged.

Just need to register a pure CJK character name Tailnet node on Headscale.

Can you provide more details, please? I could not reproduce this on a Debian 13 host:

  • tailscale up --hostname='aa的aa' is refused by the client
  • hostnamectl hostname 的 sets the transient hostname to localhost and the client uses localhost as hostname during registration.
  • Setting /etc/hostname to aa的aa sets the hostname to aaaa which the client also uses during registration
@nblock commented on GitHub (Oct 10, 2025): The [proposed fix was not merged](https://github.com/juanfont/headscale/pull/2383). > Just need to register a pure CJK character name Tailnet node on Headscale. Can you provide more details, please? I could not reproduce this on a Debian 13 host: - `tailscale up --hostname='aa的aa'` is refused by the client - `hostnamectl hostname 的` sets the transient hostname to `localhost` and the client uses `localhost` as hostname during registration. - Setting `/etc/hostname` to `aa的aa` sets the hostname to `aaaa` which the client also uses during registration
Author
Owner

@spymobilfon commented on GitHub (Oct 13, 2025):

Environment:

  • Headscale 0.26.1, Ubuntu 22.04
  • Tailscale 1.84.2, Windows 11 Pro 23H2

Step to reproduce:

  1. Set emoji in hostname
  2. Reboot laptop
  3. Check hostname (see screenshots)
Image Image
  1. Login in Tailscale
  2. VPN doesn't work, you can't open sites which are routing via VPN

I can't reproduce in Headscale with PostgreSQL, as far as I understand this issue affects only sqlite.

What I found in the sqlite database

sqlite> select * from nodes where id = '2424';
2424|mkey:c73d7352c0164b44070e690bc9acf3c1c24c24399742e9e06c9e5982ac524f16|nodekey:9d1f2eb55a7c9114beb76844111b507dbba038a8cabbc7e9381ef00a7541bf6d|discokey:0000000000000000000000000000000000000000000000000000000000000000||{"IPNVersion":"1.84.2-t5d271bebf-gfb9977414","BackendLogID":"ca903e15f2328a2d67ed26341bdf4ee075f795e09c5984fa26385b29baf32621","OS":"windows","OSVersion":"10.0.22631.5909","Package":"msi","Hostname":"𓂀","NoLogsNoSupport":true,"GoArch":"amd64","GoArchVar":"v1","GoVersion":"go1.24.2","Services":[{"Proto":"peerapi4","Port":57166},{"Proto":"peerapi6","Port":53902},{"Proto":"peerapi-dns-proxy","Port":1}],"Userspace":false,"UserspaceRouter":true,"AppConnector":false}|XXX|XXX|𓂀||1393|oidc|||2025-10-13 12:19:46.388546217+00:00|2025-10-14 12:17:45.708340613+00:00||2025-10-13 12:17:45.737119618+00:00|2025-10-13 12:19:46.38858028+00:00|
sqlite> select hostname, given_name from nodes where id = '2424';
𓂀|
sqlite> select given_name from nodes where id = '2424';

What I found in the Headscale logs

Oct 13 12:17:45 headscale headscale[3348249]: 2025-10-13T12:17:45.741Z INF github.com/juanfont/headscale/hscontrol/db/node.go:525 > Node registered with the database machine_key=[xz1zU] node="𓂀" node_id=2424 node_key=[nR8ut] sumsub=true user=XXX
Oct 13 12:17:45 headscale headscale[3348249]: 2025-10-13T12:17:45.861Z TRC github.com/juanfont/headscale/hscontrol/poll.go:618 > a node sending a MapRequest with Noise protocol node="𓂀" node.id=2424 omitPeers=true readOnly=false stream=false
Oct 13 12:17:45 headscale headscale[3348249]: 2025-10-13T12:17:45.861Z TRC github.com/juanfont/headscale/hscontrol/poll.go:618 > received endpoint update node="𓂀" node.id=2424 omitPeers=true readOnly=false stream=false
Oct 13 12:17:45 headscale headscale[3348249]: 2025-10-13T12:17:45.861Z TRC github.com/juanfont/headscale/hscontrol/poll.go:573 > PeerChange received disco_key=d:cc0268511bbff4d9 endpoints=["XXX:20103","XXX:41641","XXX:41641","XXX:41641"] hostname="𓂀" last_seen=1760357865861 node.id=2424 online=false
Oct 13 12:17:45 headscale headscale[3348249]: 2025-10-13T12:17:45.864Z TRC github.com/juanfont/headscale/hscontrol/poll.go:618 > a node sending a MapRequest with Noise protocol node="𓂀" node.id=2424 omitPeers=false readOnly=false stream=true
Oct 13 12:17:45 headscale headscale[3348249]: 2025-10-13T12:17:45.865Z TRC github.com/juanfont/headscale/hscontrol/notifier/notifier.go:95 > added new channel node.id=2424 open_chans=3
Oct 13 12:17:45 headscale headscale[3348249]: 2025-10-13T12:17:45.865Z INF github.com/juanfont/headscale/hscontrol/poll.go:608 > node has connected, mapSession: 0xc0017cc000, chan: 0xc000244d20 node="𓂀" node.id=2424 omitPeers=false readOnly=false stream=true
Oct 13 12:17:45 headscale headscale[3348249]: 2025-10-13T12:17:45.865Z TRC github.com/juanfont/headscale/hscontrol/poll.go:618 > received stream update: StateFullUpdate  node="𓂀" node.id=2424 omitPeers=false readOnly=false stream=true
Oct 13 12:17:45 headscale headscale[3348249]: 2025-10-13T12:17:45.867Z TRC github.com/juanfont/headscale/hscontrol/poll.go:618 > Sending Full MapResponse node="𓂀" node.id=2424 omitPeers=false readOnly=false stream=true
Oct 13 12:17:46 headscale headscale[3348249]: 2025-10-13T12:17:46.101Z ERR github.com/juanfont/headscale/hscontrol/poll.go:629 > Could not get the create map update error="tailNode, failed to create FQDN: failed to create valid FQDN: node has no given name" node="𓂀" node.id=2424 omitPeers=false readOnly=false stream=true
Oct 13 12:17:46 headscale headscale[3348249]: 2025-10-13T12:17:46.101Z TRC github.com/juanfont/headscale/hscontrol/notifier/notifier.go:95 > removed channel node.id=2424 open_chans=1
Oct 13 12:17:46 headscale headscale[3348249]: 2025-10-13T12:17:46.102Z INF github.com/juanfont/headscale/hscontrol/poll.go:608 > node has disconnected, mapSession: 0xc0017cc000, chan: 0xc000244d20 node="𓂀" node.id=2424 omitPeers=false readOnly=false stream=true

and next many errors like this

Could not get the create map update error="tailNode, failed to create FQDN: failed to create valid FQDN: node has no given name" node="𓂀" node.id=2424 omitPeers=false readOnly=false stream=true
@spymobilfon commented on GitHub (Oct 13, 2025): Environment: - Headscale 0.26.1, Ubuntu 22.04 - Tailscale 1.84.2, Windows 11 Pro 23H2 Step to reproduce: 1. Set emoji in hostname 2. Reboot laptop 3. Check hostname (see screenshots) <img width="252" height="179" alt="Image" src="https://github.com/user-attachments/assets/5a7ecbbd-9687-4c01-81d7-78c21cbdeb26" /> <img width="340" height="89" alt="Image" src="https://github.com/user-attachments/assets/70e7266e-1e1f-49d3-85f0-a7292fb941d7" /> 4. Login in Tailscale 5. VPN doesn't work, you can't open sites which are routing via VPN I can't reproduce in Headscale with PostgreSQL, as far as I understand this issue affects only sqlite. What I found in the sqlite database ``` sqlite> select * from nodes where id = '2424'; 2424|mkey:c73d7352c0164b44070e690bc9acf3c1c24c24399742e9e06c9e5982ac524f16|nodekey:9d1f2eb55a7c9114beb76844111b507dbba038a8cabbc7e9381ef00a7541bf6d|discokey:0000000000000000000000000000000000000000000000000000000000000000||{"IPNVersion":"1.84.2-t5d271bebf-gfb9977414","BackendLogID":"ca903e15f2328a2d67ed26341bdf4ee075f795e09c5984fa26385b29baf32621","OS":"windows","OSVersion":"10.0.22631.5909","Package":"msi","Hostname":"𓂀","NoLogsNoSupport":true,"GoArch":"amd64","GoArchVar":"v1","GoVersion":"go1.24.2","Services":[{"Proto":"peerapi4","Port":57166},{"Proto":"peerapi6","Port":53902},{"Proto":"peerapi-dns-proxy","Port":1}],"Userspace":false,"UserspaceRouter":true,"AppConnector":false}|XXX|XXX|𓂀||1393|oidc|||2025-10-13 12:19:46.388546217+00:00|2025-10-14 12:17:45.708340613+00:00||2025-10-13 12:17:45.737119618+00:00|2025-10-13 12:19:46.38858028+00:00| sqlite> select hostname, given_name from nodes where id = '2424'; 𓂀| sqlite> select given_name from nodes where id = '2424'; ``` What I found in the Headscale logs ``` Oct 13 12:17:45 headscale headscale[3348249]: 2025-10-13T12:17:45.741Z INF github.com/juanfont/headscale/hscontrol/db/node.go:525 > Node registered with the database machine_key=[xz1zU] node="𓂀" node_id=2424 node_key=[nR8ut] sumsub=true user=XXX Oct 13 12:17:45 headscale headscale[3348249]: 2025-10-13T12:17:45.861Z TRC github.com/juanfont/headscale/hscontrol/poll.go:618 > a node sending a MapRequest with Noise protocol node="𓂀" node.id=2424 omitPeers=true readOnly=false stream=false Oct 13 12:17:45 headscale headscale[3348249]: 2025-10-13T12:17:45.861Z TRC github.com/juanfont/headscale/hscontrol/poll.go:618 > received endpoint update node="𓂀" node.id=2424 omitPeers=true readOnly=false stream=false Oct 13 12:17:45 headscale headscale[3348249]: 2025-10-13T12:17:45.861Z TRC github.com/juanfont/headscale/hscontrol/poll.go:573 > PeerChange received disco_key=d:cc0268511bbff4d9 endpoints=["XXX:20103","XXX:41641","XXX:41641","XXX:41641"] hostname="𓂀" last_seen=1760357865861 node.id=2424 online=false Oct 13 12:17:45 headscale headscale[3348249]: 2025-10-13T12:17:45.864Z TRC github.com/juanfont/headscale/hscontrol/poll.go:618 > a node sending a MapRequest with Noise protocol node="𓂀" node.id=2424 omitPeers=false readOnly=false stream=true Oct 13 12:17:45 headscale headscale[3348249]: 2025-10-13T12:17:45.865Z TRC github.com/juanfont/headscale/hscontrol/notifier/notifier.go:95 > added new channel node.id=2424 open_chans=3 Oct 13 12:17:45 headscale headscale[3348249]: 2025-10-13T12:17:45.865Z INF github.com/juanfont/headscale/hscontrol/poll.go:608 > node has connected, mapSession: 0xc0017cc000, chan: 0xc000244d20 node="𓂀" node.id=2424 omitPeers=false readOnly=false stream=true Oct 13 12:17:45 headscale headscale[3348249]: 2025-10-13T12:17:45.865Z TRC github.com/juanfont/headscale/hscontrol/poll.go:618 > received stream update: StateFullUpdate node="𓂀" node.id=2424 omitPeers=false readOnly=false stream=true Oct 13 12:17:45 headscale headscale[3348249]: 2025-10-13T12:17:45.867Z TRC github.com/juanfont/headscale/hscontrol/poll.go:618 > Sending Full MapResponse node="𓂀" node.id=2424 omitPeers=false readOnly=false stream=true Oct 13 12:17:46 headscale headscale[3348249]: 2025-10-13T12:17:46.101Z ERR github.com/juanfont/headscale/hscontrol/poll.go:629 > Could not get the create map update error="tailNode, failed to create FQDN: failed to create valid FQDN: node has no given name" node="𓂀" node.id=2424 omitPeers=false readOnly=false stream=true Oct 13 12:17:46 headscale headscale[3348249]: 2025-10-13T12:17:46.101Z TRC github.com/juanfont/headscale/hscontrol/notifier/notifier.go:95 > removed channel node.id=2424 open_chans=1 Oct 13 12:17:46 headscale headscale[3348249]: 2025-10-13T12:17:46.102Z INF github.com/juanfont/headscale/hscontrol/poll.go:608 > node has disconnected, mapSession: 0xc0017cc000, chan: 0xc000244d20 node="𓂀" node.id=2424 omitPeers=false readOnly=false stream=true ``` and next many errors like this ``` Could not get the create map update error="tailNode, failed to create FQDN: failed to create valid FQDN: node has no given name" node="𓂀" node.id=2424 omitPeers=false readOnly=false stream=true ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#1097