[Bug] Cannot add nodes #833

Closed
opened 2025-12-29 02:24:38 +01:00 by adam · 6 comments
Owner

Originally created by @gregoryca on GitHub (Oct 14, 2024).

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

When adding new nodes i get the following error:
Unspecified Error: {"code":2,"message":"key hex string doesn't have expected type prefix mkey:","details":[]}

The generated key looks like the following: headscale nodes register --user USERNAME --key mkey:d012f16242dc4b760d811c10e73dfbc3c4d3a0ba409f149713d45168e886017e

When inserting the mkey in the portal it fails.

I tried to execute a shell to the container, but i get an error message that "sh" is not available in the container
OCI runtime exec failed: exec failed: unable to start container process: exec: "sh": executable file not found in $PATH: unknown

Expected Behavior

Add a new node via the UI or terminal

Steps To Reproduce

  1. install tailscale on windows from the headscale/windows page
  2. start tailscale and run the command to login
  3. retrieve the generated command, and extract the mkey.
  4. insert the mkey in the headscale-admin UI

Environment

- OS: Ubuntu 20.0.4
- Headscale version: 0.23.0
- Tailscale version: 1.76.0

Runtime environment

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

Anything else?

No response

Originally created by @gregoryca on GitHub (Oct 14, 2024). ### 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 When adding new nodes i get the following error: Unspecified Error: {"code":2,"message":"key hex string doesn't have expected type prefix mkey:","details":[]} The generated key looks like the following: headscale nodes register --user USERNAME --key mkey:d012f16242dc4b760d811c10e73dfbc3c4d3a0ba409f149713d45168e886017e When inserting the mkey in the portal it fails. I tried to execute a shell to the container, but i get an error message that "sh" is not available in the container OCI runtime exec failed: exec failed: unable to start container process: exec: "sh": executable file not found in $PATH: unknown ### Expected Behavior Add a new node via the UI or terminal ### Steps To Reproduce 1. install tailscale on windows from the headscale/windows page 2. start tailscale and run the command to login 3. retrieve the generated command, and extract the mkey. 4. insert the mkey in the headscale-admin UI ### Environment ```markdown - OS: Ubuntu 20.0.4 - Headscale version: 0.23.0 - Tailscale version: 1.76.0 ``` ### Runtime environment - [X] Headscale is behind a (reverse) proxy - [X] Headscale runs in a container ### Anything else? _No response_
adam added the bug label 2025-12-29 02:24:38 +01:00
adam closed this issue 2025-12-29 02:24:38 +01:00
Author
Owner

@hopleus commented on GitHub (Oct 14, 2024):

I tried to execute a shell to the container, but i get an error message that "sh" is not available in the container
OCI runtime exec failed: exec failed: unable to start container process: exec: "sh": executable file not found in $PATH: unknown

It has nothing to do with HeadScale. I assume that you did not write the docker command correctly

  1. insert the mkey in the headscale-admin UI

headscale-admin is a third party application and the problem should be written to their repository

@hopleus commented on GitHub (Oct 14, 2024): >I tried to execute a shell to the container, but i get an error message that "sh" is not available in the container OCI runtime exec failed: exec failed: unable to start container process: exec: "sh": executable file not found in $PATH: unknown It has nothing to do with HeadScale. I assume that you did not write the docker command correctly > 4. insert the mkey in the headscale-admin UI headscale-admin is a third party application and the problem should be written to their repository
Author
Owner

@gregoryca commented on GitHub (Oct 14, 2024):

Thank you very much for your quick answer !

I am not exectuting any commands. If i try to attach a shell via vs-code, a bash terminal or portainer i get the error message that "sh" is not available in the container.

headscale-admin is a third party application and the problem should be written to their repository

Correct, but that one was a workaround because i cannot access the container CLI. I mainly use the CLI but since switching to 0.23.0 i cannot execute or connect the the headscale docker container CLI.

@gregoryca commented on GitHub (Oct 14, 2024): Thank you very much for your quick answer ! I am not exectuting any commands. If i try to attach a shell via vs-code, a bash terminal or portainer i get the error message that "sh" is not available in the container. > headscale-admin is a third party application and the problem should be written to their repository Correct, but that one was a workaround because i cannot access the container CLI. I mainly use the CLI but since switching to 0.23.0 i cannot execute or connect the the headscale docker container CLI.
Author
Owner

@hopleus commented on GitHub (Oct 14, 2024):

I am not exectuting any commands. If i try to attach a shell via vs-code, a bash terminal or portainer i get the error message that "sh" is not available in the container.

This is correct as there is no sh, bash, etc in the container.

Incorrect: docker exec -it <HS_ID_CONTAINER> sh headscale nodes list
Correct: docker exec -it <HS_ID_CONTAINER> headscale nodes list

@hopleus commented on GitHub (Oct 14, 2024): > I am not exectuting any commands. If i try to attach a shell via vs-code, a bash terminal or portainer i get the error message that "sh" is not available in the container. This is correct as there is no sh, bash, etc in the container. **Incorrect**: docker exec -it <HS_ID_CONTAINER> **_sh_ headscale** nodes list **Correct**: docker exec -it <HS_ID_CONTAINER> **headscale** nodes list
Author
Owner

@gregoryca commented on GitHub (Oct 14, 2024):

I tried, even if i do the manual command i cannot access the container. Both commands yield the same error message.

docker exec -it headscale bash
docker exec -it headscale sh

The container is named headscale. I have added the inspect result, maybe you can see something that's wrong on my side.
headscale-portainer-inspect.txt

@gregoryca commented on GitHub (Oct 14, 2024): I tried, even if i do the manual command i cannot access the container. Both commands yield the same error message. docker exec -it headscale bash docker exec -it headscale sh The container is named headscale. I have added the inspect result, maybe you can see something that's wrong on my side. [headscale-portainer-inspect.txt](https://github.com/user-attachments/files/17362788/headscale-portainer-inspect.txt)
Author
Owner

@gregoryca commented on GitHub (Oct 14, 2024):

Thank you very much for your answer, i will try that and report back !

@gregoryca commented on GitHub (Oct 14, 2024): Thank you very much for your answer, i will try that and report back !
Author
Owner

@gregoryca commented on GitHub (Oct 14, 2024):

That was it ! i revised my command and it works again. Looking further into the frond-end, the issue has been reported 2 weeks ago.

For the people using the headscale-admin front-end, the fix lies in the request body. The request uses the older "nodekey" which should have been changed to "mkey" to reflect the change in the new headscale 0.23.0 version.

Thanks for the quick help !

@gregoryca commented on GitHub (Oct 14, 2024): That was it ! i revised my command and it works again. Looking further into the frond-end, the issue has been reported 2 weeks ago. For the people using the headscale-admin front-end, the fix lies in the request body. The request uses the older "nodekey" which should have been changed to "mkey" to reflect the change in the new headscale 0.23.0 version. Thanks for the quick help !
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#833