You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Scale Manager fails to connect to Headscale v0.27+ servers with "invalid api key" error, even when the API key is valid and works correctly in the Headscale Web UI.
Root Cause
Headscale v0.27 changed all API endpoint paths from plural to singular:
Scale Manager requests
Headscale v0.27 actual route
GET /api/v1/nodes
GET /api/v1/node
GET /api/v1/users
GET /api/v1/user
GET /api/v1/apikeys
GET /api/v1/apikey
GET /api/v1/preauthkeys
GET /api/v1/preauthkey
GET /api/v1/healthz
GET /api/v1/health
All plural endpoints return 404 Not Found, causing the app to display "invalid api key".
The correct routes can be verified via the OpenAPI spec at /swagger/v1/openapiv2.json on any running Headscale instance.
Reproduction Steps
Deploy Headscale v0.27.1
Create an API key via headscale apikeys create
Enter server URL and API key in Scale Manager
App shows "invalid api key"
Environment
Headscale version: v0.27.1
Scale Manager version: 1.2.5
Platform: iOS
Suggested Fix
Update the API client to use singular endpoint names matching the v0.27+ API spec. Consider supporting both formats for backward compatibility with older Headscale versions.
After testing, the latest APK and iOS builds still display the "invalid token" prompt—the same issue as before. Please look into it again. Thank you.
发自我的iPhone
------------------ Original ------------------
From: gm852 ***@***.***>
Date: Tue,Jul 7,2026 5:51 AM
To: loqtek/ScaleManager ***@***.***>
Cc: simplify123 ***@***.***>, Mention ***@***.***>
Subject: Re: [loqtek/ScaleManager] Incompatible with Headscale v0.27 API (singular endpoint names) (Issue #12)
Closed #12 as completed.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you were mentioned.Message ID: ***@***.***>
@simplify123 i cannot recreate this issue, and the code is set to call the singular endpoints for Headscale v0.27. If possible, can you share any proxy access logs showing plural hits or the status codes of the singular requests? In addition ensure your app is on the proper version as that could also be a issue.
(sorry for delay in response, day job and life have been super busy)
I'm running Headscale v0.28.0 and ScaleManager can not log in. I think the cause is the API key format change in v0.28.0.
Since v0.28.0, Headscale stores API keys as bcrypt hashes and expects the new prefixed format hskey-api-{prefix}-{secret} instead of the old plain 64-character secret. The server logs show the app is still sending the old format:
failed to validate token error="failed to parse ApiKey: key too short, expected at least 77 chars after prefix, got 64"
failed to validate token error="failed to parse ApiKey: secret length mismatch, expected 64 chars, got 70"
failed to validate token error="invalid API key: crypto/bcrypt: hashedPassword is not the hash of the given password"
Could you update the app to support the new key format? Headplane already fixed the same issue in v0.6.2, so it should be straightforward.
Headscale: v0.28.0 (commit 97fa117c48a58bee3941e5e8b4393873501afe14)
The full server log is in my previous comment.
The previous API key(headscale v0.27.1) format was: TXp1jpD.CppZBvSvtDzgvHgN7IDrRF_STlNbn2tb
The current API key(headscale v0.28.0) format is: hskey-api-oOfm0YYCkAP3-PzFqpnpKG6dZbdunXjb21qeUj1ptBpSsYvYOqdgmaT8noeHIfDYAeq7KJyqquHs2
@simplify123 i cannot recreate this issue, and the code is set to call the singular endpoints for Headscale v0.27. If possible, can you share any proxy access logs showing plural hits or the status codes of the singular requests? In addition ensure your app is on the proper version as that could also be a issue.
(sorry for delay in response, day job and life have been super busy)
Root cause 100% confirmed: iOS ATS (App Transport Security) is blocking the plaintext HTTP requests from ScaleManager. Since the app’s release build does not include the NSAllowsArbitraryLoads entry, iOS blocks all http:// connections at the system level—requests never reach the server. Safari has an exemption (it prompts a warning but still allows the connection), which is why the page loads in the browser but the app cannot connect.
okay @simplify123 thanks for the logs, although lets please try to avoid using large amounts of AI generated diagnoses please. This clutters everything up, is not super accurate, and makes my job a bit harder. Lets break this down properly so we can close this out asap and apply any actually needed fixes.
What’s already in the app (including 1.2.6):
API calls use singular Headscale paths (/api/v1/node, /user, /apikey, etc.)
There’s a singular/plural fallback on 404
Auth is sent as Authorization: Bearer with the key pasted as-is (no reformatting)
In your logs:
invalid token means the request did reach Headscale so this isn’t App Transport Security blocking the connection (ATS would prevent the request from arriving at all)
The missing "Bearer " and some of the key-parse errors look like they may be from other clients/manual tests mixed into the same log. Scale Manager always sends the Bearer prefix
Originally you claimed this issue was happening on Headscale v0.27 but now claiming v0.28. Headscale did change the key formatting in v0.28 so yes this is a issue that will need to be addressed and i am currently working on a fix in addition to support for v0.29. I appreciate the patience while we get this update out, thanks for your issue.
okay @simplify123 thanks for the logs, although lets please try to avoid using large amounts of AI generated diagnoses please. This clutters everything up, is not super accurate, and makes my job a bit harder. Lets break this down properly so we can close this out asap and apply any actually needed fixes.好的,谢谢你提供的日志。不过,请尽量避免使用大量的 AI 生成的诊断结果。这会让系统变得混乱,准确率也不高,而且会增加我的工作难度。我们来仔细分析一下这个问题,以便尽快解决并进行必要的修复。
What’s already in the app (including 1.2.6):应用内已有的功能(包括 1.2.6 版本):
API calls use singular Headscale paths (/api/v1/node, /user, /apikey, etc.)API 调用使用单个 Headscale 路径(/api/v1/node、/user、/apikey 等)。
There’s a singular/plural fallback on 404404 错误有单数/复数回退机制
Auth is sent as Authorization: Bearer with the key pasted as-is (no reformatting)授权信息以 Authorization: Bearer 的形式发送,密钥原封不动地粘贴进去(不进行任何格式调整)。
In your logs: 在您的日志中:
invalid token means the request did reach Headscale so this isn’t App Transport Security blocking the connection (ATS would prevent the request from arriving at all)无效令牌意味着请求已到达 Headscale,因此这不是应用传输安全机制 (ATS) 阻止连接导致的(ATS 会阻止请求到达)。
The missing "Bearer " and some of the key-parse errors look like they may be from other clients/manual tests mixed into the same log. Scale Manager always sends the Bearer prefix缺失的“Bearer”前缀和一些密钥解析错误看起来像是其他客户端/手动测试的日志混杂在一起造成的。Scale Manager 始终会发送 Bearer 前缀。
Originally you claimed this issue was happening on Headscale v0.27 but now claiming v0.28. Headscale did change the key formatting in v0.28 so yes this is a issue that will need to be addressed and i am currently working on a fix in addition to support for v0.29. I appreciate the patience while we get this update out, thanks for your issue.您最初声称此问题出现在 Headscale v0.27 版本中,但现在又说出现在 v0.28 版本中。Headscale 在 v0.28 版本中确实更改了按键格式,所以这确实是一个需要解决的问题。我目前正在修复此问题,同时也在努力支持 v0.29 版本。感谢您在我们发布此更新期间的耐心等待,也感谢您反馈此问题。
I manually tested this and confirmed that iOS ATS (App Transport Security) was blocking the plaintext HTTP requests being sent by ScaleManager. When I switched to using Cloudflare's HTTPS address, I was able to log in successfully. However, using HTTP resulted in failure.
This issue has been addressed and fixed as of Scale Manager release 1.2.7. The iOS app is currently being distributed and the APK is on the releases page.
Activity
gm852 commentedon Jul 1, 2026
Thank you @simplify123! This issue will be addressed in the next update soon.
gm852 commentedon Jul 5, 2026
Updated v1.2.6 .apk is now available here. iOS version is under review and should be released within 48 hours.
simplify123 commentedon Jul 16, 2026
gm852 commentedon Aug 16, 2026
@simplify123 i cannot recreate this issue, and the code is set to call the singular endpoints for Headscale v0.27. If possible, can you share any proxy access logs showing plural hits or the status codes of the singular requests? In addition ensure your app is on the proper version as that could also be a issue.
(sorry for delay in response, day job and life have been super busy)
simplify123 commentedon Aug 17, 2026
scale manager version:1.2.6
tailscale client version:1.102.2(ios)
device: iphone 17 pro
headscale v0.28.0 log:
simplify123 commentedon Aug 17, 2026
I'm running Headscale v0.28.0 and ScaleManager can not log in. I think the cause is the API key format change in v0.28.0.
Since v0.28.0, Headscale stores API keys as bcrypt hashes and expects the new prefixed format
hskey-api-{prefix}-{secret}instead of the old plain 64-character secret. The server logs show the app is still sending the old format:Could you update the app to support the new key format? Headplane already fixed the same issue in v0.6.2, so it should be straightforward.
Headscale: v0.28.0 (commit 97fa117c48a58bee3941e5e8b4393873501afe14)
The full server log is in my previous comment.
The previous API key(headscale v0.27.1) format was: TXp1jpD.CppZBvSvtDzgvHgN7IDrRF_STlNbn2tb
The current API key(headscale v0.28.0) format is: hskey-api-oOfm0YYCkAP3-PzFqpnpKG6dZbdunXjb21qeUj1ptBpSsYvYOqdgmaT8noeHIfDYAeq7KJyqquHs2
[-]Incompatible with Headscale v0.27 API (singular endpoint names)[/-][+]Incompatible with Headscale v0.28 API[/+]simplify123 commentedon Aug 17, 2026
Root cause 100% confirmed: iOS ATS (App Transport Security) is blocking the plaintext HTTP requests from ScaleManager. Since the app’s release build does not include the NSAllowsArbitraryLoads entry, iOS blocks all http:// connections at the system level—requests never reach the server. Safari has an exemption (it prompts a warning but still allows the connection), which is why the page loads in the browser but the app cannot connect.
gm852 commentedon Aug 25, 2026
okay @simplify123 thanks for the logs, although lets please try to avoid using large amounts of AI generated diagnoses please. This clutters everything up, is not super accurate, and makes my job a bit harder. Lets break this down properly so we can close this out asap and apply any actually needed fixes.
What’s already in the app (including 1.2.6):
In your logs:
Originally you claimed this issue was happening on Headscale v0.27 but now claiming v0.28. Headscale did change the key formatting in v0.28 so yes this is a issue that will need to be addressed and i am currently working on a fix in addition to support for v0.29. I appreciate the patience while we get this update out, thanks for your issue.
simplify123 commentedon Sep 14, 2026
I manually tested this and confirmed that iOS ATS (App Transport Security) was blocking the plaintext HTTP requests being sent by ScaleManager. When I switched to using Cloudflare's HTTPS address, I was able to log in successfully. However, using HTTP resulted in failure.
gm852 commentedon Sep 30, 2026
This issue has been addressed and fixed as of Scale Manager release 1.2.7. The iOS app is currently being distributed and the APK is on the releases page.