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 log in #346

Open
pixelcola opened this issue Dec 27, 2024 · 13 comments
Open

cannot log in #346

pixelcola opened this issue Dec 27, 2024 · 13 comments
Labels
troubleshooting Maybe bug, maybe not

Comments

@pixelcola
Copy link

I created a user, but I cannot log in, but can log in /_/#/settings

compose.yml

services:
  beszel:
    image: henrygd/beszel:latest
    container_name: beszel
    volumes:
      - ./data:/beszel_data
    restart: unless-stopped
    ports:
      - 8090:8090
    networks:
      - cloudflared

networks:
  cloudflared:
    driver: bridge
    external: true

The /api/collections/users/auth-refresh API returns 400 Bad Request, response is:

{
    "data": {},
    "message": "Something went wrong while processing your request.",
    "status": 400
}

The /api/realtime API returns 403 Forbidden, response is:

{
    "data": {},
    "message": "The current and the previous request authorization don't match.",
    "status": 403
}
@pixelcola
Copy link
Author

pixelcola commented Dec 27, 2024

image: henrygd/beszel:0.8is OK

@henrygd
Copy link
Owner

henrygd commented Dec 27, 2024

Did you start on 0.9.0 or 0.8.0?

There are changes to the auth collections in 0.9.0, but everything should be migrated automatically.

If you can log in to PocketBase, check if there is a user in the users table (/_/#/collections?collection=_pb_users_auth_ in 0.9.0). If not, create your user by clicking the "New record" button.

If the Beszel interface shows you logged in but no systems, try logging out and logging back in.

@henrygd henrygd added the troubleshooting Maybe bug, maybe not label Dec 27, 2024
@sansbyte
Copy link

sansbyte commented Dec 29, 2024

I'm running into a similar issue but I can't log in anew to the main interface or the dashboard (PocketBase).

For the main interface, with my primary browser (Firefox) that I normally have Bezel opened in a tab, I can still access the main interface. However, if I try a different browser (i.e. Brave) or a private window with my main browser, I can't log into the main interface.

For the dashboard (PocketBase), I can still access it via a tab I already had opened and logged in on my main browser. However, if I try to open the dashboard in a new tab of my main browser, I can't log in. I also can't log into the dashboard in a private window of my main browser or in a different browser.

This all appears to have started since I updated to 0.9.0 several days ago. I tried going back to 0.8.0 as a test but Beszel hub wouldn't start.

@sansbyte
Copy link

I'm running into a similar issue but I can't log in anew to the main interface or the dashboard (PocketBase).

For the main interface, with my primary browser (Firefox) that I normally have Bezel opened in a tab, I can still access the main interface. However, if I try a different browser (i.e. Brave) or a private window with my main browser, I can't log into the main interface.

For the dashboard (PocketBase), I can still access it via a tab I already had opened and logged in on my main browser. However, if I try to open the dashboard in a new tab of my main browser, I can't log in. I also can't log into the dashboard in a private window of my main browser or in a different browser.

This all appears to have started since I updated to 0.9.0 several days ago. I tried going back to 0.8.0 as a test but Beszel hub wouldn't start.

I seem to have fixed my issue but I'm not sure how or why. One thing I did notice is my email notifications weren't working due to a DNS change I made recently. One clue was the [recordAuthResponse] Failed to send login alert events in PocketBase log. Once I fixed that and got email notifications working again, I was able to login to both the main interface or the dashboard.

I thought that may have been the fix so I reintroduced the issue (i.e. broke email server DNS) to verify, but I was still able to login. So I'm not sure what fixed my issue.

@henrygd
Copy link
Owner

henrygd commented Dec 29, 2024

@sansbyte Strange, I was just typing out a response but looks like it's not applicable anymore.

Perhaps it was a token issue and the previous token expired.

Or maybe you have rate limits on and the auth rate limit was being exceeded somehow?

If anyone still has this issue, try resetting your password.

@silmarine
Copy link

I think I've having the same issue, but I'm unable to reset my password. When I first setup beszel I setup OIDC. So when I access the base URL (beszel.example.com) it just logs me in automatically. Everything there seems to work but if I try to go to anything in the pocketbase side it asks for a password, which I thought I didn't need with OIDC. I tried reseting my password there and it says it sent an email to my address but I never receive anything. Email does work for other things though, like alerts for system problems. Is there a way to reset my password via docker exec?

@henrygd
Copy link
Owner

henrygd commented Jan 5, 2025

@silmarine The PocketBase login doesn't support OAuth currently, but is subject to auth rate limits that you can define within the PocketBase UI. There's also an option for two factor via OTP, but that was experimental last I checked so haven't included instructions for setting that up in the docs.

If you want to reset your password via docker, try the command below, making sure to mount your data directory so it can update the DB:

docker run --rm -v ./beszel_data:/beszel_data henrygd/beszel admin update youremail@example.com newpassword

Let me know if this doesn't work.

@silmarine
Copy link

Ah okay, I didn't realize that. I tried the command and got the following error. Only things I changed is the volume location on the host and of course the email and password.

Error: unknown command "admin" for "beszel"
Run 'beszel --help' for usage.

@henrygd
Copy link
Owner

henrygd commented Jan 5, 2025

@silmarine My mistake, the subcommand changed from admin to superuser in the last release.

docker run --rm -v ./beszel_data:/beszel_data henrygd/beszel superuser update youremail@example.com newpassword

@silmarine
Copy link

that works but I got a different error saying there is no superuser with that email. I must have messed up things up real bad when setting up OIDC. I don't want to keep posting here and causing emails to send to henrygd. If there happens to be a command to either make my user a superuser or add one from the command line then let me know. Otherwise I have a pretty small set up (only 4 devices being monitored) and I can just wipe the data folder and start over.

@henrygd
Copy link
Owner

henrygd commented Jan 5, 2025

Don't worry, it's not a bother! I'd like to know what happened honestly, especially if it's a bug.

You can create a new superuser like so:

docker run --rm -v ./beszel_data:/beszel_data henrygd/beszel superuser create user@example.com password

See all superuser operations:

docker run --rm -v ./beszel_data:/beszel_data henrygd/beszel superuser -h

@silmarine
Copy link

That did it! Thank you, henrygd! Now I can see what I did. Seemed I added a superuser with a fake email, I guess as a temp until I figured out the OIDC superuser or something, which I now know doesn't work. And I guess I just... forgot. Thanks again!

@henrygd
Copy link
Owner

henrygd commented Jan 5, 2025

Interesting, thanks for the update.

PocketBase 0.23 replaced admins with the superusers auth collection. Everything should have been migrated automatically, but it's possible there are edge cases causing problems and it's not something you did.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
troubleshooting Maybe bug, maybe not
Projects
None yet
Development

No branches or pull requests

4 participants