netbirdio / netbird

Connect your devices into a single secure private WireGuard®-based mesh network with SSO/MFA and simple access controls.
https://netbird.io
BSD 3-Clause "New" or "Revised" License
9.78k stars 424 forks source link

Google Idp - User portals not loading - code 401 #1593

Open Icare-github opened 4 months ago

Icare-github commented 4 months ago

Describe the problem User portals not loading, and giving error: Request failed with status code 401. Please refresh the page if the issue continues. token invalid idp = Google

To Reproduce User (in peers list) present that was removed from Google Workspace.

Are you using NetBird Cloud? self-host NetBird's control plane.

logs management-1 | 2024-02-19T14:20:19Z DEBG management/server/account.go:1164: 1201 entries received from IdP management management-1 | 2024-02-19T14:20:19Z WARN management/server/account.go:1178: user 1142941466876 not found in IDP management-1 | 2024-02-19T14:20:19Z DEBG management/server/file_store.go:303: released lock for account ci069s8adnmc73c9 in 13.796579304s management-1 | 2024-02-19T14:20:19Z DEBG management/server/file_store.go:295: acquiring lock for account ci069s8adnmc73c9

Workaround Once the user was removed from the database, the user portals dod open correctly.

mlsmaycon commented 4 months ago

Thanks for reporting this issue @Icare-github.

This happens due to the management service cache system assumption that if a user doesn't exist in the local cache, it should force refresh the cache on every request. However, the cache will never be consistent with the local store as the user was removed from IDP.

redecs commented 4 weeks ago

Had the same issue with Netbird Self-hosted version 0.27.7. Restarting the management service fixed it (no need to delete any users). I've upgrade now to version 0.27.10 and will see if this happens again.