user_id column within machines table are not migrated from the namespace_id column after upgrade to 0.19.0-beta1 #420

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

Originally created by @bekcpear on GitHub (Jan 25, 2023).

Bug description

After upgrade to 0.19.0-beta1, any node cannot access to any of others nodes. When I turn on the debug log, it shows:

WRN No IPs found with the alias <the username, not the alias>
WRN No IPs found with the alias <the username, not the alias>
WRN No IPs found with the alias <the username, not the alias>
...

the corresponding ACL config is like:

{
  "acls": [
    { "action": "accept", "src": ["username0"], "dst": ["username0:*"] },
    { "action": "accept", "src": ["username1"], "dst": ["username1:*"] },
    { "action": "accept", "src": ["username1"], "dst": ["*:*"] }                                                                                                                             
  ]
}

then I tried to debug by add a new line like:

diff --git a/machine.go b/machine.go
index 2d3a076..bd300a0 100644
--- a/machine.go
+++ b/machine.go
@@ -347,6 +347,7 @@ func (h *Headscale) ListMachines() ([]Machine, error) {
 		return nil, err
 	}
 
+	fmt.Printf("%#v\n", machines)
 	return machines, nil
 }

and I got the log shows the Name field in the structure headscale.User are all "",

To Reproduce

restart headscale with 0.19.0-beta1

Context info

  • Version of headscale used: 0.19.0-beta1
  • Version of tailscale client: 1.34.2, 1.36.0
  • OS: Gentoo Linux
  • Kernel version: 5.15.88
  • db_type: sqlite3
Originally created by @bekcpear on GitHub (Jan 25, 2023). <!-- Headscale is a multinational community across the globe. Our common language is English. Please consider raising the bug report in this language. --> **Bug description** After upgrade to 0.19.0-beta1, any node cannot access to any of others nodes. When I turn on the debug log, it shows: ``` WRN No IPs found with the alias <the username, not the alias> WRN No IPs found with the alias <the username, not the alias> WRN No IPs found with the alias <the username, not the alias> ... ``` the corresponding ACL config is like: ```json { "acls": [ { "action": "accept", "src": ["username0"], "dst": ["username0:*"] }, { "action": "accept", "src": ["username1"], "dst": ["username1:*"] }, { "action": "accept", "src": ["username1"], "dst": ["*:*"] } ] } ``` then I tried to debug by add a new line like: ```diff diff --git a/machine.go b/machine.go index 2d3a076..bd300a0 100644 --- a/machine.go +++ b/machine.go @@ -347,6 +347,7 @@ func (h *Headscale) ListMachines() ([]Machine, error) { return nil, err } + fmt.Printf("%#v\n", machines) return machines, nil } ``` and I got the log shows the `Name` field in the structure `headscale.User` are all `""`, **To Reproduce** restart headscale with 0.19.0-beta1 **Context info** - Version of headscale used: 0.19.0-beta1 - Version of tailscale client: 1.34.2, 1.36.0 - OS: Gentoo Linux - Kernel version: 5.15.88 - db_type: sqlite3
adam added the bug label 2025-12-29 01:28:39 +01:00
adam closed this issue 2025-12-29 01:28:39 +01:00
Author
Owner

@bekcpear commented on GitHub (Jan 25, 2023):

I check the sqlite3 database, and found there is a namespace_id column within the machines table but the user_id is empty, and the value of namespace_id matches the id colume within the new users table.

@bekcpear commented on GitHub (Jan 25, 2023): I check the sqlite3 database, and found there is a `namespace_id` column within the `machines` table but the `user_id` is empty, and the value of `namespace_id` matches the `id` colume within the new `users` table.
Author
Owner

@bekcpear commented on GitHub (Jan 25, 2023):

After updating the user_id value with the namespace_id value manually, it looks working well now.

@bekcpear commented on GitHub (Jan 25, 2023): After updating the user_id value with the namespace_id value manually, it looks working well now.
Author
Owner

@kradalby commented on GitHub (Jan 26, 2023):

Thank you!, that is very true and a horrible mistake, I have submitted a fix in https://github.com/juanfont/headscale/pull/1171, but it might still require some manual intervention.

@kradalby commented on GitHub (Jan 26, 2023): Thank you!, that is very true and a horrible mistake, I have submitted a fix in https://github.com/juanfont/headscale/pull/1171, but it might still require some manual intervention.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#420