netbirdio / dashboard

NetBird Management Service Web UI Panel

Home Page:https://app.netbird.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Random refresh and CORS errors

Enailis opened this issue · comments

commented

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

commented

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"
commented

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.

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

commented

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.

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

commented

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.

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.