mattermost-community / focalboard

Focalboard is an open source, self-hosted alternative to Trello, Notion, and Asana.
https://www.focalboard.com
Other
21.62k stars 1.93k forks source link

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

Open Hexdump74 opened 3 years ago

Hexdump74 commented 3 years ago

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:

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 commented 3 years ago

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 commented 3 years ago

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.

chenilim commented 3 years ago

Thanks for the report @Hexdump74!

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

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

chenilim commented 3 years ago

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

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 commented 3 years ago

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

chenilim commented 3 years ago

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

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

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

Hexdump74 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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

chenilim commented 3 years ago

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

brimwats1 commented 3 years ago

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

brimwats1 commented 3 years ago

https://github.com/YunoHost-Apps/focalboard_ynh/issues/1#issuecomment-848079160

https://github.com/YunoHost-Apps/focalboard_ynh/issues/1#issuecomment-848082885