Account lost after update

Hello,

Is it normal that I land on a « create your Gladys account » page after the update…
I no longer have access to my account.

Hi @Olivier.L57,

I’ve moved your topic to the right category :slight_smile:

No need to panic: a Gladys update doesn’t delete your data. If you’re seeing the “Create your account” screen again, it’s usually because Gladys can no longer find its database.

What probably happened

With Docker, a container is disposable: each update deletes the old one and creates a new one. For your data to survive, it must be stored outside the container, on your disk. That’s the purpose of this option in the installation command:

-v /var/lib/gladysassistant:/var/lib/gladysassistant

If Gladys was launched without this option, the database was inside the container, and it disappeared with it during the update.

Can you check?

  1. Did you install Gladys with the official command from the documentation? Install Gladys Assistant with Docker | Gladys Assistant
  2. Can you send me the results of these commands?
    • docker ps -a (to see if the old container still exists)
    • docker inspect --format '{{json .Mounts}}' gladys (to see where Gladys stores its data)
  3. How did you perform the update: automatically (Watchtower) or manually?

How to recover your data

  • If the old container still appears in docker ps -a, your data might still be inside, and we can recover it. Above all, don’t delete it!
  • If you have Gladys Plus, you can restore your latest backup directly when creating the account.

If neither of these applies, I’m sorry, but there unfortunately won’t be a way to recover the data. In that case, reinstall Gladys with the command from the documentation, and this won’t happen again with future updates.

Thanks for your reply. I clicked on update and I did the installation following the online tutorial with Docker.

olivier@serveurgladys:~$ sudo docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c5ad05e4636a eclipse-mosquitto:2.0.15 « /docker-entrypoint.… » 25 minutes ago Up 25 minutes eclipse-mosquitto
2cb88417b8b2 gladysassistant/gladys:v5 « docker-entrypoint.s… » 25 minutes ago Up 4 minutes gladys
30566e574c77 koenkk/zigbee2mqtt:2.14.2 « docker-entrypoint.s… » 26 hours ago Up 26 hours gladys-z2m-zigbee2mqtt
9c7976f669c2 eclipse-mosquitto:2.0.15 « /docker-entrypoint.… » 26 hours ago Up 26 hours gladys-z2m-mqtt
56452c1aceff nickfedor/watchtower:latest « /watchtower --clean… » 28 hours ago Up 28 hours (healthy) 8080/tcp watchtower
75a86d7c6f69 nodered/node-red:5.0 « ./entrypoint.sh » 3 days ago Up 2 days (healthy) 0.0.0.0:1881->1880/tcp, [::]:1881->1880/tcp gladys-node-red

sudo docker inspect --format ‹ {{json .Mounts}} › gladys
[{« Type »:« bind »,« Source »:« /var/lib/gladysassistant »,« Destination »:« /var/lib/gladysassistant »,« Mode »:«  »,« RW »:true,« Propagation »:« rprivate »},{« Type »:« bind »,« Source »:« /var/run/docker.sock »,« Destination »:« /var/run/docker.sock »,« Mode »:«  »,« RW »:true,« Propagation »:« rprivate »}]

ls -la /var/lib/gladysassistant
total 1148
drwxr-xr-x 7 root root 4096 Oct 18 09:22 .
drwxr-xr-x 55 root root 4096 Oct 17 22:49 ..
drwxr-xr-x 8 root root 4096 Oct 22 16:06 external-integrations
-rw-r–r-- 1 root root 872448 Oct 17 20:42 gladys-production.db
-rw-r–r-- 1 root root 274432 Oct 17 20:29 gladys-production.duckdb
drwxr-xr-x 2 root root 4096 Oct 25 15:03 homekit
drwxr-xr-x 2 1883 1883 4096 Oct 18 06:09 mosquitto
drwxr-xr-x 4 olivier olivier 4096 Oct 21 16:23 node-red
drwxr-xr-x 4 root root 4096 Oct 18 09:22 zigbee2mqtt

Thanks for the feedback, it’s very helpful!

Good news: your database is still on your disk :slightly_smiling_face: The file /var/lib/gladysassistant/gladys-production.db is there.

However, two things intrigue me:

  • this file has not been modified since October 17 at 8:42 PM, although Gladys writes to it continuously when it is used;
  • there is no gladys-production.db-wal file next to it, although it should exist when Gladys is running.

My conclusion: your Gladys container is not using this file. It is very likely missing the SQLITE_FILE_PATH variable. Without it, Gladys stores its database inside the container, which is deleted with each update. Incidentally, your container only has 2 volumes while the current command in the documentation has 5: it must have been created with a different command, perhaps around October 17?

To confirm, can you send me the result of:

sudo docker inspect --format '{{json .Config.Env}}' gladys

If SQLITE_FILE_PATH does not appear in the list, that’s it.

To recover your database (if confirmed):

  1. First, make a backup copy:

    sudo cp -a /var/lib/gladysassistant/gladys-production.db /var/lib/gladysassistant/gladys-production.db.bak
    sudo cp -a /var/lib/gladysassistant/gladys-production.duckdb /var/lib/gladysassistant/gladys-production.duckdb.bak
    
  2. Delete the current container. Your data on the disk is not affected:

    sudo docker stop gladys && sudo docker rm gladys
    
  3. Recreate it with the command from the documentation (Install Gladys Assistant with Docker | Gladys Assistant), without removing anything. Especially not the line -e SQLITE_FILE_PATH=/var/lib/gladysassistant/gladys-production.db.

Gladys should then restart with your account, your devices, and your scenes as they were on the evening of October 17.

I prefer to be honest: what you did between October 17 and today was stored in the old container, which the update deleted. Those changes are unfortunately lost, unless you have a more recent Gladys Plus backup. In that case, you can restore it from the account creation screen.

Once the container is recreated correctly, future updates will keep your data.

~$ sudo docker inspect --format ‹ {{json .Config.Env}} › gladys
[« PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin »,« NODE_VERSION=24.22.1 »,« YARN_VERSION=1.22.22 »,« LD_LIBRARY_PATH=/lib »,« NODE_ENV=production »,« SERVER_PORT=80 »,« GLADYS_OFFICIAL_RELEASE_IMAGE=true »]

Thanks, it’s confirmed: SQLITE_FILE_PATH is not in the list. Your container was created without any -e option (missing TZ as well), so not with the command from the documentation. Gladys stored its database inside the container, and the update erased it by recreating the container.

We can now properly recreate it to use your database from October 17:

1. Backup (just in case):

sudo cp -a /var/lib/gladysassistant/gladys-production.db /var/lib/gladysassistant/gladys-production.db.bak
sudo cp -a /var/lib/gladysassistant/gladys-production.duckdb /var/lib/gladysassistant/gladys-production.duckdb.bak

2. Remove the current container (your files in /var/lib/gladysassistant are not affected):

sudo docker stop gladys && sudo docker rm gladys

3. Create the container with the official command:

sudo docker run -d \
  --log-driver json-file \
  --log-opt max-size=10m \
  --cgroupns=host \
  --restart=always \
  --privileged \
  --network=host \
  --name gladys \
  -e NODE_ENV=production \
  -e SERVER_PORT=80 \
  -e TZ=Europe/Paris \
  -e SQLITE_FILE_PATH=/var/lib/gladysassistant/gladys-production.db \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -v /var/lib/gladysassistant:/var/lib/gladysassistant \
  -v /dev:/dev \
  -v /run/udev:/run/udev:ro \
  -v /run/dbus:/run/dbus:ro \
  gladysassistant/gladys:v5

4. Verification: after a minute, ls -la /var/lib/gladysassistant should show a gladys-production.db-wal file and an updated modification date on gladys-production.db. You should be able to log in with your usual account.

:warning: If you still end up on the “Create your account” screen, don’t create anything and come back to me.

What you need to know: you will find Gladys as it was on the evening of October 17. According to the dates of your folders, you set up several things after that date (Zigbee2MQTT, MQTT, external integrations…). They will not be configured in Gladys and will need to be redone. Good news though: the zigbee2mqtt folder is on your disk, so your already paired Zigbee devices should be preserved on the Zigbee2MQTT side. Normally, you will just need to reactivate the integration and re-add the devices in Gladys, without re-pairing them.

Sorry for the hassle! Once the container is recreated with this command, updates will no longer affect your data.

No problem, it might help others. I mainly had issues with an external container. As long as Zigbee is running.
Still on « /signup »

olivier@serveurgladys:~$ sudo cp -a /var/lib/gladysassistant/gladys-production.db /var/lib/gladysassistant/gladys-production.db.bak
olivier@serveurgladys:~$ sudo cp -a /var/lib/gladysassistant/gladys-production.duckdb /var/lib/gladysassistant/gladys-production.duckdb.bak
olivier@serveurgladys:~$ sudo docker stop gladys && sudo docker rm gladys
gladys
gladys
olivier@serveurgladys:~$ sudo docker run -d
–log-driver json-file
–log-opt max-size=10m
–cgroupns=host
–restart=always
–privileged
–network=host
–name gladys
-e NODE_ENV=production
-e SERVER_PORT=80
-e TZ=Europe/Paris
-e SQLITE_FILE_PATH=/var/lib/gladysassistant/gladys-production.db
-v /var/run/docker.sock:/var/run/docker.sock
-v /var/lib/gladysassistant:/var/lib/gladysassistant
-v /dev:/dev
-v /run/udev:/run/udev:ro
-v /run/dbus:/run/dbus:ro
gladysassistant/gladys:v5
8be09ef7542c877344fecfd3fdf6166d831c47ef0d463a02d4c83d9d07e87703
olivier@serveurgladys:~$ ls -la /var/lib/gladysassistant
total 2736
drwxr-xr-x 7 root root 4096 Oct 25 16:04 .
drwxr-xr-x 55 root root 4096 Oct 17 22:49 ..
drwxr-xr-x 8 root root 4096 Oct 22 16:06 external-integrations
-rw-r–r-- 1 root root 872448 Oct 17 20:42 gladys-production.db
-rw-r–r-- 1 root root 32768 Oct 25 16:04 gladys-production.db-shm
-rw-r–r-- 1 root root 440872 Oct 25 16:04 gladys-production.db-wal
-rw-r–r-- 1 root root 872448 Oct 17 20:42 gladys-production.db.bak
-rw-r–r-- 1 root root 274432 Oct 17 20:29 gladys-production.duckdb
-rw-r–r-- 1 root root 274432 Oct 17 20:29 gladys-production.duckdb.bak
drwxr-xr-x 2 root root 4096 Oct 25 15:03 homekit
drwxr-xr-x 2 1883 1883 4096 Oct 18 06:09 mosquitto
drwxr-xr-x 4 olivier olivier 4096 Oct 21 16:23 node-red
drwxr-xr-x 4 root root 4096 Oct 18 09:22 zigbee2mqtt
olivier@serveurgladys:~$

Thanks for the feedback! Gladys now correctly uses the database on your disk: the underlying issue is resolved, and future updates will preserve your data.

Gladys may have needed a few seconds to start. Could you wait a moment, then open http://<your-server-IP>/login?

  • If you land on the login page, log in with your usual credentials: you’ll find Gladys as it was on October 17.
  • If you’re still redirected to « Create your account », this means the October 17 database contains no accounts. It was likely created during a first launch of Gladys, without you proceeding further. The container was then recreated without the correct options, possibly during your manipulations with the other container? Your account and configuration were then saved inside the container, and they disappeared with it during the update. I’m sorry, but there are two remaining options:
    • if you have Gladys Plus, you can restore your latest backup from the account creation screen;
    • otherwise, you’ll need to recreate your account. Everything running alongside Gladys is intact (Zigbee2MQTT with your paired devices, Node-RED…). Once the Zigbee2MQTT integration is reactivated in Gladys, your devices should come back online without needing to be re-paired.

Thanks for documenting all this; it will help others!

I had to recreate an account.
For the Z2M configuration, which option should I choose?
-Installation from Gladys
-Connection to an existing installation

You should choose the option you chose before.