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

Bug: no_workspace error on first-launch with FireFox #271

Open
Hexdump74 opened this issue Apr 14, 2021 · 12 comments
Open

Bug: no_workspace error on first-launch with FireFox #271

Hexdump74 opened this issue Apr 14, 2021 · 12 comments
Labels
Bug Something isn't working

Comments

@Hexdump74
Copy link

Summary:
After fresh new installation on ubuntu 18.04, the first page give me an error : /error?id=no_workspace
The logs contain an API ERROR 401, err: no session token.

Steps to reproduce the behavior:

  1. install as described in https://www.focalboard.com/download/personal-edition/ubuntu/ but WITHOUT TLS
  2. connect to server using ip adress

Expected behavior:
A login screen to create the first user

Screenshots:
An empty grey screen only showing a rectangle where is written "Error". No more text or description.
The adress bar links to /error?id=no_workspace

Platform:

  • Browser and version: Firefox 87
  • Client OS : ArchLinux
  • Server : Ubuntu 18.04
  • Version : focalboard 0.6.1 and focalboard 0.6.5-rc1

Additional context:
The databases (i tried with both pgsql and sqlite) contain a table workspace :

sqlite> select * from workspaces;
id|signup_token|settings|modified_by|update_at
0|fc8ebca6-XXXX-XXXX-XXXX-98e29cca1177|||1618434798

Logs extract :

Apr 14 21:13:18 collab-proj systemd[1]: Started Focalboard server.
Apr 14 21:13:18 collab-proj focalboard-server[13203]: 2021/04/14 21:13:18 Focalboard Server
Apr 14 21:13:18 collab-proj focalboard-server[13203]: 2021/04/14 21:13:18 Version: 0.6.5
Apr 14 21:13:18 collab-proj focalboard-server[13203]: 2021/04/14 21:13:18 Edition: linux
Apr 14 21:13:18 collab-proj focalboard-server[13203]: 2021/04/14 21:13:18 Build Number: 745710722
Apr 14 21:13:18 collab-proj focalboard-server[13203]: 2021/04/14 21:13:18 Build Date: Tue Apr 13 18:22:19 UTC 2021
Apr 14 21:13:18 collab-proj focalboard-server[13203]: 2021/04/14 21:13:18 Build Hash: 13e08840b6870a0491fa1f69191b6c11e80c4aef
Apr 14 21:13:18 collab-proj focalboard-server[13203]: 2021/04/14 21:13:18 readConfigFile
Apr 14 21:13:18 collab-proj focalboard-server[13203]: 2021/04/14 21:13:18 {ServerRoot:http://localhost:8000 Port:8000 DBType:sqlite3 DBConfigString:./focalboard.db UseSSL:false SecureC
Apr 14 21:13:18 collab-proj focalboard-server[13203]: 2021/04/14 21:13:18 connectDatabase
Apr 14 21:13:18 collab-proj focalboard-server[13203]: 2021/04/14 21:13:18 importInitialTemplates
Apr 14 21:13:18 collab-proj focalboard-server[13203]: 2021/04/14 21:13:18 Inserting 36 blocks
Apr 14 21:13:18 collab-proj focalboard-server[13203]: 2021/04/14 21:13:18 initialized workspace
Apr 14 21:13:18 collab-proj focalboard-server[13203]: {"level":"info","ts":1618434798.929716,"caller":"server/server.go:174","msg":"Server.Start"}
Apr 14 21:13:18 collab-proj focalboard-server[13203]: 2021/04/14 21:13:18 http server started on :8000
Apr 14 21:13:18 collab-proj focalboard-server[13203]: 2021/04/14 21:13:18 Starting unix socket server
Apr 14 21:13:25 collab-proj focalboard-server[13203]: 2021/04/14 21:13:25 Single User: false
Apr 14 21:13:25 collab-proj focalboard-server[13203]: 2021/04/14 21:13:25 API ERROR 401, err: no session token
Apr 14 21:13:25 collab-proj focalboard-server[13203]: 2021/04/14 21:13:25 Single User: false
Apr 14 21:13:25 collab-proj focalboard-server[13203]: 2021/04/14 21:13:25 API ERROR 401, err: no session token
Apr 14 21:13:25 collab-proj focalboard-server[13203]: 2021/04/14 21:13:25 Single User: false
Apr 14 21:13:25 collab-proj focalboard-server[13203]: 2021/04/14 21:13:25 API ERROR 401, err: no session token
@Hexdump74 Hexdump74 added the Bug Something isn't working label Apr 14, 2021
@Hexdump74
Copy link
Author

Sorry, it was an artifact of my browser. I missed a step during installation, got this error, corrected the installation, but the error stayed in my cache.
Opening a new private window bring me to the expected login page.

@Hexdump74 Hexdump74 changed the title Bug: Bug: no_workspace error Apr 15, 2021
@Hexdump74
Copy link
Author

Hexdump74 commented Apr 15, 2021

Finally, no, the error is still showing. It is pretty random, I'm still searching for the reasons.

Looks like the login screen loads without problems on Chromium, but sometimes fails on Firefox.

@Hexdump74 Hexdump74 reopened this Apr 15, 2021
@chenilim
Copy link
Contributor

Thanks for the report @Hexdump74!

This error shows up when the getWorkspace call in Boardpage.tsx fails.

  • Based on the session error, my guess is the browser had an old sessionId in localStorage, so the request fails auth
  • Workaround is to delete the sessionId from localStorage, or log-out and re-login

We can keep this issue open for now. Longer term we need to handle invalid sessions better, e.g. log-out and re-login.

  • This might mean the getWorkspace client API should distinguish auth failure from invalid workspace.

@chenilim
Copy link
Contributor

Testing more, I noticed that behavior on FireFox is different than Chrome:

  • On FireFox, if there is no sessionID (i.e. new installation), it always redirects to the error page
  • On Chrome, if there is no sessionID, it redirects (correctly) to the login page

Might be something off with the timing on FireFox. As a short-term fix, I filed #274 to add a re-login button to the error page, and should have a fix for that in shortly.

@Hexdump74
Copy link
Author

Thanks. So finally it was indeed related to my browser's cache.
So I keep the issue open as a reminder ?

@chenilim chenilim changed the title Bug: no_workspace error Bug: no_workspace error on first-launch with FireFox Apr 16, 2021
@chenilim
Copy link
Contributor

Thanks @Hexdump74. On my machine (macOS 10.15.7), I see an issue with FireFox:

  • On first launch with FireFox 87.0 (or with a private browser window), it redirects to the error page (instead of login
  • With Chrome and Safari, new sessions (or private windows) correctly redirects to the login page

I believe this is a timing issue with FireFox, and updated the title to reflect it. More context:

  • I see an NS_BINDING_ABORTED error in the FireFox network console when redirecting to /login
  • My guess is the /error redirect pre-empts the /login redirect on FireFox

If you (or anyone else) can help verify this behavior on Linux and other platforms, that would be super helpful!

@Hexdump74
Copy link
Author

I'm totally unable to reproduce the bug now...
I reinstalled the server (because I deleted the VM used for the first test), and now I am always correctly redirected to the login page.
If you have a server with which you reproduce the problem and it is accessible from Internet, I could connect on it with my Linux.

@Zev-se
Copy link

Zev-se commented Apr 17, 2021

I got this when I upgraded from one version to another. Stopping the server, moving focalboard.db out of the folder and then restarting solved the problem. Not sure why.

@brimwats1
Copy link

this happens on the most recent update on a completely clean and updated chrome for me as @ericgaspar mentioned above.

@chenilim
Copy link
Contributor

Thanks @brimwats! To confirm: Does clicking on the "Log in again" button on the error page work around the issue?

@brimwats1
Copy link

no. there are gifs at the end of focalboard_ynh/issues/1

@brimwats1
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants