Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot open /machines, /routes or /overview #131

Open
esticle opened this issue Jan 9, 2024 · 3 comments
Open

Cannot open /machines, /routes or /overview #131

esticle opened this issue Jan 9, 2024 · 3 comments

Comments

@esticle
Copy link

esticle commented Jan 9, 2024

Hi - this issue appears a bit like #84 - a unclean reboot has ensured my UI is broken whilst headscale appears to be operating OK. I can see /users however the machines and routing pages do not work.

Here's the logs in debug mode for hitting /machines:

[2024-01-09 17:18:55,746] INFO in helper: All startup checks passed.
[2024-01-09 17:18:55,751] INFO in helper: Testing API key validity.
[2024-01-09 17:18:55,974] INFO in helper: Key check passed.
[2024-01-09 17:18:55,978] INFO in headscale: Getting API key information
[2024-01-09 17:18:56,152] INFO in headscale: Looking for valid API Key...
[2024-01-09 17:18:56,154] INFO in headscale: Key found.
[2024-01-09 17:18:56,158] INFO in renderer: Rendering machine cards
[2024-01-09 17:18:56,159] INFO in headscale: Getting machine information
[2024-01-09 17:18:56,329] ERROR in app: Exception on /machines [GET]
Traceback (most recent call last):
  File "/app/.venv/lib/python3.11/site-packages/flask/app.py", line 2190, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.11/site-packages/flask/app.py", line 1486, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.11/site-packages/flask/app.py", line 1484, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.11/site-packages/flask/app.py", line 1469, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/server.py", line 114, in decorated
    return view_func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/server.py", line 207, in machines_page
    cards = renderer.render_machines_cards()
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/renderer.py", line 490, in render_machines_cards
    num_threads = len(machines_list["machines"])
                      ~~~~~~~~~~~~~^^^^^^^^^^^^
KeyError: 'machines'
[2024-01-09 17:18:56 +0000] [8] [ERROR] Error handling request /favicon.ico
Traceback (most recent call last):
  File "/app/.venv/lib/python3.11/site-packages/gunicorn/workers/sync.py", line 136, in handle
    self.handle_request(listener, req, client, addr)
  File "/app/.venv/lib/python3.11/site-packages/gunicorn/workers/sync.py", line 169, in handle_request
    resp, environ = wsgi.create(req, client, addr,
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.11/site-packages/gunicorn/http/wsgi.py", line 183, in create
    path_info = path_info.split(script_name, 1)[1]
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range

For /routes and /overview the same error occurs on the same KeyError of 'machines'.

root@3236c4f5fc02:/# headscale machines ls
2024-01-09T17:20:55Z TRC DNS configuration loaded dns_config={"Domains":["lan.redcated.net","redcated.net"],"Nameservers":["1.1.1.1"],"Proxied":true,"Resolvers":[{"Addr":"1.1.1.1"}],"Routes":{"lan.redcated.net":[{"Addr":"192.168.3.1"}]}}
ID | Hostname  | Name             | MachineKey | NodeKey | User      | IP addresses                   | Ephemeral | Last seen           | Expiration          | Connected | Expired
1  | device1   | device1          | [2monD]    | [udw6D] | user1     | 100.64.0.1, fd7a:115c:a1e0::1  | false     | 2024-01-09 14:38:25 | 0001-01-01 00:00:00 | offline   | no
2  | tailscale | device2          | [BGGVi]    | [KurFF] | user2     | 100.64.0.2, fd7a:115c:a1e0::2  | false     | 2024-01-09 17:20:52 | 0001-01-01 00:00:00 | online    | no
4  | device3   | device3          | [5zyE0]    | [HdbqD] | user1     | 100.64.0.4, fd7a:115c:a1e0::4  | false     | 2024-01-09 17:20:52 | 0001-01-01 00:00:00 | online    | no
5  | tailscale | device4          | [c+I4J]    | [5uC+B] | user2     | 100.64.0.3, fd7a:115c:a1e0::3  | false     | 2024-01-09 17:20:52 | 0001-01-01 00:00:00 | online    | no
6  | tailscale | device5          | [nVgKv]    | [am3ir] | hosted15  | 100.64.0.5, fd7a:115c:a1e0::5  | false     | 2024-01-09 17:20:51 | 0001-01-01 00:00:00 | online    | no
8  | localhost | device6          | [vpup1]    | [8D0NL] | user1     | 100.64.0.7, fd7a:115c:a1e0::7  | false     | 2024-01-09 14:38:15 | 0001-01-01 00:00:00 | offline   | no
9  | device7   | device7          | [aGYSx]    | [tuwRG] | device7   | 100.64.0.6, fd7a:115c:a1e0::6  | false     | 2024-01-09 17:20:52 | 0001-01-01 00:00:00 | online    | no
10 | device8   | device8          | [MA4kM]    | [cj74G] | device8   | 100.64.0.8, fd7a:115c:a1e0::8  | false     | 2024-01-09 17:20:54 | 0001-01-01 00:00:00 | online    | no
11 | device9   | device9          | [KWZOT]    | [jhQno] | device9   | 100.64.0.9, fd7a:115c:a1e0::9  | false     | 2024-01-09 17:20:52 | 0001-01-01 00:00:00 | online    | no
12 | device10  | device10         | [kNFV7]    | [oAQY3] | device10  | 100.64.0.10, fd7a:115c:a1e0::a | false     | 2024-01-09 17:20:54 | 0001-01-01 00:00:00 | online    | no

And here's the routes and machines ls:

root@3236c4f5fc02:/# headscale routes ls
2024-01-09T17:21:23Z TRC DNS configuration loaded dns_config={"Domains":["lan.redcated.net","redcated.net"],"Nameservers":["1.1.1.1"],"Proxied":true,"Resolvers":[{"Addr":"1.1.1.1"}],"Routes":{"lan.redcated.net":[{"Addr":"192.168.3.1"}]}}
ID | Node               | Prefix         | Advertised | Enabled | Primary
1  | device2            | 0.0.0.0/0      | true       | true    | -
2  | device2            | ::/0           | true       | true    | -
13 | device3            | 0.0.0.0/0      | true       | true    | -
14 | device3            | ::/0           | true       | true    | -
15 | device3            | 10.10.102.0/24 | false      | false   | false
16 | device3            | 10.10.103.0/24 | false      | false   | false
17 | device3            | 10.10.104.0/24 | false      | false   | false
18 | device3            | 192.168.3.0/24 | false      | false   | false
19 | device3            | 10.10.101.0/24 | false      | false   | false
20 | device4            | 0.0.0.0/0      | true       | true    | -
21 | device4            | ::/0           | true       | true    | -
22 | device4            | 192.168.3.0/24 | true       | true    | true
23 | device4            | 10.10.101.0/24 | true       | true    | true
24 | device4            | 10.10.102.0/24 | true       | true    | true
25 | device4            | 10.10.103.0/24 | true       | true    | true
26 | device4            | 10.10.104.0/24 | true       | true    | true
27 | device5            | 0.0.0.0/0      | true       | true    | -
28 | device5            | ::/0           | true       | true    | -
29 | device7            | 0.0.0.0/0      | true       | true    | -
30 | device7            | ::/0           | true       | true    | -
31 | device4            | 10.42.42.0/24  | true       | true    | true
32 | device8            | 0.0.0.0/0      | true       | true    | -
33 | device8            | ::/0           | true       | true    | -
34 | device9            | 0.0.0.0/0      | true       | true    | -
35 | device9            | ::/0           | true       | true    | -

Any ideas?

@esticle esticle changed the title Cannot open /machines, /routes or /orerview Cannot open /machines, /routes or /overview Jan 9, 2024
@Kurty00
Copy link

Kurty00 commented Jan 16, 2024

I am having the same issue.

@wenco
Copy link

wenco commented Apr 22, 2024

yes,i try to compatible with headscale:v0.23.0-alpha8, other ditn't test. view this url main...wenco:headscale-webui:main

@Sinister646
Copy link

can you specify exactly where you change that for a super beginner ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants