All files reset to default library and all users deleted except for one after power failure

Hi everyone, I’m hoping I can get some help figuring out what went wrong here and possibly recovering data.

I run a trial version of Seafile Pro with two users on a server at my home. I was away on a trip last week and my house had a power outage when I was gone, which forcefully shut down my Seafile docker instance. After restarting the container with docker-compose, I was unable to access any of my files that were stored remotely. Two of my clients (Windows SeaDrive and the iOS app) still list all of my files as I left them, but I am unable to access any that are not stored on the device. The web app shows basically a fresh install of SeaFile, with only one library ‘My Library’ with only 'seafile_tutorial.doc` inside.

The data directory of my seafile instance looks bad (I mean the volume for the actual seafile container). It’s size is only 2.7 MB when it should be storing at least several GB of data. There is about 200 MB of data in the MariaDB volume which is mostly from the files ibdata1, ib_logfile0, ib_logfile1.

I think I may be looking at total data loss here (which would be sad because I have no backups, but not a huge disaster because there wasnt much critical), but I am hopeful that there is some way to recover some of my files. It seems odd to me that a power loss would cause such a total loss of data. Actually, I am now wondering if I unintentionally reset all of the data by running docker-compose down at some point in the process of rebooting the container after the power loss. Anyway, I would appreciate any tips on what log files or other things of the sort I should look at to investigate.

Did you store the files you syned with Seafile in the container?

If yes, the data is gone with the docker container that you removed when “docker-composing down”

The info you provide is insufficient to support you.

But: If your clients still show the data - and you can access it - the data is still there. I guess you have just created a new user account and upon first login Seafile created a new profile with just the default library in it.

Things for you to do:

  • Check in System Admin which users and libraries are available in the system
  • Find the /seafile-data folder and have a look inside, especially the blocks folder. Run a du -h on the folder to see how much data is there
  • Post your docker-compose.yml here (remove the password)

I am not exactly sure if I stored them in the container. This is what the relevant part of the compose file looks like:

  seafile:
    image: docker.seadrive.org/seafileltd/seafile-pro-mc:latest
    container_name: seafile
    restart: unless-stopped
    ports:
      - "7500:80"
#     - "443:443"  # If https is enabled, cancel the comment.
    volumes:
      - /mnt/vda1/seafile/seafile:/shared   # Requested, specifies the path to Seafile data persistent store.

At this point I am pretty sure the data is gone since the important folders appear to be empty. Luckily I have local copies of my most important files so nothing serious was lost. But because I am inexperienced with docker, I’m wondering if I should have setup the volumes in a different way or if I should have just been more careful with docker-compose down? I know this is not very Seafile related at this point but I was hoping you could quickly weigh in.

Please check this path. Are there any folders/files in there? This is where the Docker container stores your private data (blocks, commits, …)

Yeah that is the 2.7 MB directory I referred to in my original post. It’s up to 4.8 MB now, but it should have GBs of data. To help my understanding, this configuration is not what you meant by “stored in the container,” what you mean by that is if I had not specified a volume at all, right?

This is a record of the relevant commands I entered since I log in after the power loss to restart Seafile:

359  docker container ls -a           # See other docker containers restarted after power loss, Seafile containers stayed exited
360  cd /srv/seafile/install/         # Enter docker-compose.yml dir
364  vim docker-compose.yml           # Add 'restart: unless-stopped' to all Seafile containers
365  docker-compose up                # Realize this is not in daemon mode and press Ctrl-C after startup is complete
366  docker-compose up -d             # Restart container in daemon mode
391  docker-compose down              # Unsure why I did this, possibly because data was already missing
392  docker container ls              # See Seafile containers are not listed, not sure if this is because of missing '-a' flag or because they were removed
393  docker-compose up -d             # Restart again, still unsure why I stopped it in the first place
396  docker logs seafile | less       # Logs appear normal during a quick skim
402  du -sh .                         # Data is definitely missing by this point

And here is what the latest output of docker logs seafile shows:

[06/13/2021 02:33:14][upgrade]: The container was recreated, running minor-upgrade.sh to fix the media symlinks
[06/13/2021 02:33:14][upgrade]: Running script /opt/seafile/seafile-pro-server-7.1.14/upgrade/minor-upgrade.sh

-------------------------------------------------------------
This script would do the minor upgrade for you.
Press [ENTER] to contiune
-------------------------------------------------------------


renaming the gunicorn.conf to gunicorn.conf.py ...

Done

------------------------------
migrating avatars ...


DONE
------------------------------


Moving the elasticsearch's configuration file ...


updating seafile-server-latest symbolic link to /opt/seafile/seafile-pro-server-7.1.14 ...

DONE
------------------------------


[06/13/21 02:33:14] ../common/session.c(162): using config file /opt/seafile/conf/ccnet.conf
[06/13/21 02:33:14] ../common/license.c(437): Loading license file /opt/seafile/seafile-license.txt ..
[06/13/21 02:33:14] ../common/license.c(440): License file /opt/seafile/seafile-license.txt does not exist, allow at most 3 trial users
License file /opt/seafile/seafile-license.txt does not exist, allow at most 3 trial users
Starting seafile server, please wait ...
Seafile server started

Done.

Starting seahub at port 8000 ...

Seahub is started

Done.

Thank you for all your help.

Well, more than a month later, I found my files! I feel a little dumb, but what happened was: when my server rebooted after the power loss, the disk /dev/vda1 was not automatically remounted to /mnt/vda1. I didn’t realize this because seafile automatically recreated the entire folder structure upon finding it missing, so I just assumed the disk was remounted and just happened to be reset.

Today I was reorganizing things and planning on moving all of the new seafile installation to a different disk when I realized that the current installation was actually on the root partition still. I thought it might be too good to be true, but I remounted /dev/vda1 and there was my 12GB seafile folder! So yeah, I feel pretty dumb, but very happy as well. Thank you for all your help at the start of this mess.