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

Random refresh and CORS errors #372

Open
Enailis opened this issue Apr 16, 2024 · 7 comments
Open

Random refresh and CORS errors #372

Enailis opened this issue Apr 16, 2024 · 7 comments

Comments

@Enailis
Copy link

Enailis commented Apr 16, 2024

Describe the problem

Since last version of dashboard (2.2.0) I experience some random refresh while browsing the web interface. I also have CORS erros while trying to get /application/o/userinfo/ from Authentik which did not appear in last version.
The refresh problem only appears in Firefox (tested on Chrome and Firefox).

To Reproduce

Steps to reproduce the behavior:

  1. Switch from 'Peers' to any other page multiple time
  2. Random refresh appear
  3. Go to Network tab in your browser to see error

Expected behavior

No refresh when I switch from a page to another.

Are you using NetBird Cloud?

I self-host NetBird's control plane.

Screenshots

Screenshot of the network tab from Firefox.
403error

@Enailis
Copy link
Author

Enailis commented Apr 16, 2024

To give additional information, the CORS error gives me the following description :

error="insufficient_scope", error_description="The request requires higher privileges than provided by the access token"

@Enailis
Copy link
Author

Enailis commented Apr 16, 2024

I found the solution for the CORS error. The problem was that I didn't add all the scopes in the OAuth2 provider. This should be in the identity provider's doc for Authentik.
Though this doesn't fix the refresh problem.

@heisbrot
Copy link
Contributor

Hey @Enailis,

the refresh issue can happen if some requests are still cached in your browser.

If using NGINX you could add the Cache Control header to not cache it.

server {
	listen 80 default_server;
	listen [::]:80 default_server;

    root /usr/share/nginx/html;

    location / {
      try_files $uri $uri.html $uri/ =404;
      add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0";
      expires off;
   }

   error_page 404 /404.html;
   location = /404.html {
      internal;
      add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0";
      expires off;
   }
}

Another way would be deleting your cache in Firefox. That should normally also solve the issue.

We will look for a better way of handling this case, thanks for reporting!

Best,
Eduard

@Enailis
Copy link
Author

Enailis commented Apr 18, 2024

Hi @heisbrot,
I've tried deleting my cache in Firefox but the issue keeps coming back anyway.
Also, I don't use any reverse proxy in front of Netbird, so there's no way I can handle cache like you described.

@heisbrot
Copy link
Contributor

Hey @Enailis,

could you tell me a bit more about your infrastructure?

What service do you use to run the dashboard? Maybe a CDN active?
What management version are you running?
Any extensions installed in Firefox?

I would want to reproduce this issue but for that, I need as much information as possible :)

Best,
Eduard

@Enailis
Copy link
Author

Enailis commented Apr 18, 2024

Thanks for the quick response!

Netbird is running on Ubuntu 22.04 on a PVE. Everything is up to date (management, signal, coturn and dashboard).
My colleages and I are encountering the same problem on Firefox, the only extension we have in common is Bitwarden.
Just to correct my last post, I do have a reverse proxy (HAproxy) handled by a pfSense. HAproxy is set to TLS passthrough. I must say that we had no issue like this before the last update of the dashboard.

@whirlthesquirrel
Copy link

I am also experiencing incredibly annoying refreshes in the dashboard. Not only does it randomly refresh, it will always default to the peers list instead of the page you were previously on. I'm using Authentik as my OAuth2/SSO provider.

As if this isn't bad enough, the response times for API requests the dashboard makes are very slow too. 6.2s to retrieve one account from the "accounts" API, for example.

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

No branches or pull requests

3 participants