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

ValueError: Fernet key must be 32 url-safe base64-encoded bytes. #148

Open
dacrudg opened this issue Dec 10, 2024 · 0 comments
Open

ValueError: Fernet key must be 32 url-safe base64-encoded bytes. #148

dacrudg opened this issue Dec 10, 2024 · 0 comments

Comments

@dacrudg
Copy link

dacrudg commented Dec 10, 2024

When I insert the API key then click "Save" I get this in the error log (test doesn't work either):

headscalewebui | [2024-12-11 06:17:31,798] ERROR in app: Exception on /api/save_key [POST]
headscalewebui | Traceback (most recent call last):
headscalewebui | File "/app/.venv/lib/python3.11/site-packages/flask/app.py", line 2190, in wsgi_app
headscalewebui | response = self.full_dispatch_request()
headscalewebui | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
headscalewebui | File "/app/.venv/lib/python3.11/site-packages/flask/app.py", line 1486, in full_dispatch_request
headscalewebui | rv = self.handle_user_exception(e)
headscalewebui | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
headscalewebui | File "/app/.venv/lib/python3.11/site-packages/flask/app.py", line 1484, in full_dispatch_request
headscalewebui | rv = self.dispatch_request()
headscalewebui | ^^^^^^^^^^^^^^^^^^^^^^^
headscalewebui | File "/app/.venv/lib/python3.11/site-packages/flask/app.py", line 1469, in dispatch_request
headscalewebui | return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
headscalewebui | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
headscalewebui | File "/app/server.py", line 114, in decorated
headscalewebui | return view_func(*args, **kwargs)
headscalewebui | ^^^^^^^^^^^^^^^^^^^^^^^^^^
headscalewebui | File "/app/server.py", line 350, in save_key_page
headscalewebui | file_written = headscale.set_api_key(api_key)
headscalewebui | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
headscalewebui | File "/app/headscale.py", line 47, in set_api_key
headscalewebui | fernet = Fernet(encryption_key)
headscalewebui | ^^^^^^^^^^^^^^^^^^^^^^
headscalewebui | File "/app/.venv/lib/python3.11/site-packages/cryptography/fernet.py", line 39, in init
headscalewebui | raise ValueError(
headscalewebui | ValueError: Fernet key must be 32 url-safe base64-encoded bytes.

This is with headscale 0.23.0. This is the API Key it creates with "docker exec headscale headscale apikey create":

MIMgOc9zqA.Tqv_uuNTjq0ct2TFzvxNv5uGkNsdNfZjEh0EgIGVhBx

Any help would be much appreciated thank you

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

1 participant