Recovery focalboard.db in new docker container doesn't work?

Hey folks

Since the new update I’ve can’t login in my focalboard
I’ve made regulary backups from the sqlite of my focalboard.

I’m not able to recover the database -here is what I’ve tried

deleted the whole container
copy focalboard.db in /data/focalboard.db
docker-compse up -d

When I’m creating a new “user” than I have the normal empty focalboard - so the container works.
But with the “old” focalboard.db I’ve got the following error log

error [2023-03-04 09:16:32.678 Z] ERROR WebSocket                          caller="ws/server.go:130" client="" error="read tcp> use of closed network connection"
debug [2023-03-04 09:16:32.678 Z] DISCONNECT WebSocket                     caller="ws/server.go:119" client=""
debug [2023-03-04 09:16:36.663 Z] Command: AUTH                            caller="ws/server.go:149" client=""
debug [2023-03-04 09:16:36.663 Z] authenticateListener                     caller="ws/server.go:436" token=kroymqfix7tbk9rhhhao7jub8ze wsSession.userID=
error [2023-03-04 09:16:36.663 Z] ERROR WebSocket                          caller="ws/server.go:130" client="" error="read tcp> use of closed network connection"
debug [2023-03-04 09:16:36.663 Z] DISCONNECT WebSocket                     caller="ws/server.go:119" client=""

Hi @Bootleg5814 and welcome to the Mattermost forums!

Do you still have the old container with the old database version or is your setup completely broken now?
The error message does not seem to be related to a database issue - how big is your focalboard.db file and is it still valid? Can you post the output of the following commands to verify that?

ls -lh focalboard.db
sqlite3 focalboard.db .tables

@agriesser hi there! I have the same issue after rebuilding my docker host and restoring the contents of the focalboard data volume from backup. I reset the permissions the same way and in fact, I performed this operation once before just by moving files back into the focalboard data volume and restaring the container, but this time, I get the same experience as OP.

In my case, I checked and can still connect to the DB and I can still see my original user in there. Is there any way to force a password reset prompt? Alternatively, could I just create a new user and somehow re-map all the content for this new user?

Thanks in advance!

P.S. Running using docker compose, I can provide configs and other details if needed.

Hi @tuxmeister and welcome to the Mattermost forums!

Do you have focalboard’s local mode enabled? If so, you could use the local focalboard socket inside the container for authenticating against it and resetting the password of your user account as mentioned here in the documentation:

Did the Focalboard version change in the process of restoring your docker host?

Very like it did change, since the new Docker host was empty, all images were re-pulled. I did see some DB migrations happen in the logs, I guess something went wrong there. I will try these steps and let you. Thank you so much for the quick reply!

Ok a quick progress update:

I read the instructions you posted and did the following:

$docker exec -it --user root focalboard bash

I used apt to install curl and then used the POST call in the article, but I get a “404 page not found” error. I tried both with http://localhost and http://localhost:8000 as per the config file.

I do not hold a special config file, the default one is being used. The socket file is there but apparently, it can’t talk to the web server.

I copied the curl command from your link and replaced the variables with my values, instead of using the script itself. I made sure to use alpha chars only in the password.

At this point I’d be happy to create a new user and move the content over via the DB (if this is possible at all).

I need to take a look at the socket conneciton, sorry, didn’t test it just referenced to the official documentation.
If you already have a new account with a working password, try to copy over this password to the other user, I think this should work.

sqlite3 focalboard.db
sqlite> select password,username from users;

sqlite> update users set password="$2a$10$U622eqk2rjtJ7l0TEXbKbuLV/ytaT3dDIoUUlBGP4hTrhkTAB0/SS" where username="nonworkinguser";

sqlite >  <press CTRL-D to exit>

Of course, your focalboard server needs to be stopped while you’re working in the database.
This should give you back access to the user with the password of the other account.
Can you try that?

Thanks for sharing @tuxmeister.

I’ve only pulled a new container image and the user accounts were no longer accessible.

i can’t trust the system any more - especially because i’ve run several foaclboard instances with several people. the same problem everywhere. Actually, it’s a shame because the UI was quite good - I’ve changed anyway - stability comes before function.