Giter Club home page Giter Club logo

Comments (15)

iFargle avatar iFargle commented on May 19, 2024

Do you have any machines added to Headscale currently?

from headscale-webui.

iFargle avatar iFargle commented on May 19, 2024

These are a bit weird to troubleshoot... I need to figure out how to get the futures threads to log to console or something. I'm pretty sure it's failing there somewhere -- The only thing I can think of right off the bat is no machines in Headscale. If that's the case, it should be a pretty easy fix.

from headscale-webui.

spomata avatar spomata commented on May 19, 2024

Do you have any machines added to Headscale currently?

Yes there's about 40 machines added to the setup.
Let me know if any command issued on the container could help debugging.

from headscale-webui.

iFargle avatar iFargle commented on May 19, 2024

Another possibility:
Do you have any weird content (like emoji?) in machine names / tags?
It's failing to get one of these:

headscale-webui/renderer.py

Lines 369 to 390 in 110ee90

'machines_card.html',
given_name = machine["givenName"],
machine_id = machine["id"],
hostname = machine["name"],
ns_name = machine["user"]["name"],
ns_id = machine["user"]["id"],
ns_created = machine["user"]["createdAt"],
last_seen = str(last_seen_print),
last_update = str(last_update_print),
machine_ips = Markup(machine_ips),
advertised_routes = Markup(routes),
exit_node_badge = Markup(exit_node_badge),
status_badge = Markup(status_badge),
user_badge = Markup(user_badge),
last_update_time = str(last_update_time),
last_seen_time = str(last_seen_time),
created_time = str(created_time),
expiry_time = str(expiry_time),
preauth_key = str(preauth_key),
expiration_badge = Markup(expiration_badge),
machine_tags = Markup(tags),
)))

I think I know an ok-ish way of doing some troubleshooting. It will require a new build though.
When I get some time (hopefully tomorrow) i'll push a new build and have you do some testing

from headscale-webui.

spomata avatar spomata commented on May 19, 2024

Ok.

At a glance, all tags have at most a ":" (colon) character, while machines are standard (although some phones have a whitespace in their name).

from headscale-webui.

spomata avatar spomata commented on May 19, 2024

I was checking the code and noted that the section you pointed above is before the future threads execution, while in my log the "Finished futures" message is being printed correctly and the issue might lie around line 425.

from headscale-webui.

iFargle avatar iFargle commented on May 19, 2024

From experience it's usually caused by a failure in futures. You should see a log for each future that ran. It doesn't populate sorted_machines properly. I'm redoing my builds at the moment. I should have a build ready for you to test in the next few hours.

from headscale-webui.

iFargle avatar iFargle commented on May 19, 2024

Apologies for the delay. Pull :v0.5.4 and set the environment variable LOG_LEVEL to debug, it should give more detailed info on where it's failing! (It will also render the machines page much more slowly, as it doesn't do threading -- just runs through all of your machines serially)

from headscale-webui.

spomata avatar spomata commented on May 19, 2024

Apologies for the delay. Pull :v0.5.4 and set the environment variable LOG_LEVEL to debug, it should give more detailed info on where it's failing! (It will also render the machines page much more slowly, as it doesn't do threading -- just runs through all of your machines serially)

No problem at all. Here's the log (spoiler: some date/time conversion from UTC gone wrong, maybe our headscale config is missing a parameter?)

[2023-03-17 11:49:59,500] ERROR in app: Exception on /machines [GET] Traceback (most recent call last): File "/app/.venv/lib/python3.11/site-packages/flask/app.py", line 2528, in wsgi_app response = self.full_dispatch_request() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/.venv/lib/python3.11/site-packages/flask/app.py", line 1825, in full_dispatch_request rv = self.handle_user_exception(e) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/.venv/lib/python3.11/site-packages/flask/app.py", line 1823, in full_dispatch_request rv = self.dispatch_request() ^^^^^^^^^^^^^^^^^^^^^^^ File "/app/.venv/lib/python3.11/site-packages/flask/app.py", line 1799, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/server.py", line 115, in decorated return view_func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/server.py", line 180, in machines_page cards = renderer.render_machines_cards() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/renderer.py", line 411, in render_machines_cards for idx in iterable: thread_machine_content(machines_list["machines"][idx], machine_content, idx) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/renderer.py", line 339, in thread_machine_content expiry_local = expiry_parse.astimezone(timezone) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/.venv/lib/python3.11/site-packages/pytz/tzinfo.py", line 201, in fromutc return (dt + inf[0]).replace(tzinfo=self._tzinfos[inf]) ~~~^~~~~~~~ OverflowError: date value out of range

from headscale-webui.

iFargle avatar iFargle commented on May 19, 2024

What TZ do you have set?
It defaults to UTC if the "TZ" environment variable isn't set

from headscale-webui.

spomata avatar spomata commented on May 19, 2024

I'm setting Europe/Madrid via the podman run command.

podman run -e TZ=Europe/Madrid ...

from headscale-webui.

iFargle avatar iFargle commented on May 19, 2024

Sweet -- I get the same error. Let me fiddle for a bit and I'll get back to you!

from headscale-webui.

iFargle avatar iFargle commented on May 19, 2024

I think I figured it out.
Try ghcr.io/ifargle/headscale-webui:testing

from headscale-webui.

iFargle avatar iFargle commented on May 19, 2024

So the problem was:
Your expiration times were likely 0001-01-01T00:00:00Z.
When it tried to take the Europe/Madrid TZ offset of -1, we entered negative time!
And PyTZ had no idea what to do.

Should be working now!

from headscale-webui.

spomata avatar spomata commented on May 19, 2024

Yep, it works indeed!
Good to know, although I think those expiration times are pretty common for nodes which have been onboarded to headscale with an auth token.
All our non-human nodes in the headscale network have such feature.

from headscale-webui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.