Seadrive 3.0.6 on Mac: Non-synced files gone after log out and log in

We have an user using Seadrive 3.0.6 on Mac. In the past days, he was getting an error, “You don’t have enough permissions for this library”, for all the libraries he could see in Seadrive (as far as I can tell).

Meanwhile, he could still work with the files and folders that were available locally. He edited files and created new files. These were not synced to the server.

Trying to resolve the issue, I removed the account from his local Seadrive client, and logged in again. Now the sync seems to work normally. But all the files he touched in the last few days are gone. The state he can see the libraries is the same as on the server, and the changes from the past few days were not synced back.

What happens in the background when an account is removed, and then added again from the Mac 3.0.6 client? Are the files still there in a cache folder? Where should I be looking?

What I tried so far is find . -name "lost file name" in his home directory. A bunch of windows popped up asking me to grant access. The command did not finish running (still running now, after about an hour) and the file was not found.

I am linux user, so I’m not very familiar with Mac and where should I be searching. Any help would be appreciated. The user is devastated now, with many hours of work seemingly lost.

Hello @hydrandt , currently seadrive on mac will delete all cached data when deleting an account. Deleting an account when there are files being uploaded, at this time the un-uploaded files will be saved to the ~/Library/CloudStorage/ directory.
From your description, it seems that the files are not uploaded due to a permission error. Seadrive ignores local changes when it doesn’t have permission to upload, so this part of the file is also deleted when deleting the account.
You can try to check in ~/Library/CloudStorage/ directory to see if there is a seadrive cache directory with timestamp.
In the future, we will consider retaining the files that have been cached locally when deleting an account.

1 Like

Hi @feiniks, thank you for the answer.

I checked in ~/Library/CloudStorage/, and the content seems to be exactly the same as the status on the server.

I assume all the content of the cache folder was indeed deleted when I removed the account?

I will now try to see if there is some “undelete” software for Mac that can scan the hard drive for deleted files - even thou I know this is not FAT anymore and probably, together with SSD TRIM, the files are indeed erased.

It would be good to at least add a warning to the window where user is confirming deleting of the account from the Seadrive client: “The local cache, potentially including files that have not yet been synchronized to the server, will be deleted.” There could even be an additional warning in case it can detect that some of the libraries have problems syncing.

I am also curious about the original reason the sync stopped working. User was normally using his libraries in the web browser - there was no actual permission problem. After doing the log out → log in, everything works fine again. I have saved the logs and will check them out. Let me know if you think that access to the logs would be useful for you.

Please send the client log files to support@seafile.com. Thanks!

Done, sent. Hope it can help.

Actually I thought about a potentially even safer behavior: In case there are any problems detected with the connection to the server (other than unreachable or wrong cert / captive portal), the local libraries would be read-only. That would prevent users from saving files in them, which are then deleted when the account is removed.

What do you think @feiniks @Jonathan?

For the sake of transparency, this is what was found by another person at Seafile in the log files I shared (there are 403 errors being returned by the server, visible in the log):

The 403 error is reported because the server could not find tokens for the libraries. Can you check if the server has performed an fsck on these libraries, or if the user has selected the unlink device on the linked device page in the web browser? Both of these situations will result in a 403 error.

Seadrive will ignore the local changes when it doesn’t have permission to upload, so the files will be deleted when deleting the account.

I did not run any fsck on the libraries. The person did a reinstall of his client, which, I suppose (you know that users are able to break your software in ways you would not imagine), means that:

  1. quit seadrive
  2. he dragged “Seadrive” to trash (I will check with him on this, if he actually did it)
  3. downloaded Seadrive from seafile.com and reinstalled (was 3.0.4 version)
  4. logged in → Seadrive probably started to continue to use the previously not-deleted cache folder - is there a possibility that there was a “token confusion” between the previous installation login and the new login?

Anyway. Files are lost. Tried a software called Disk Drill, and then Photorec. Disk drill didn’t find the files we were looking for. Photorec, tons of broken files. Hope we can find a way to tweak the UX so that other “normal users” are not facing this problem.

We’ll modify the delete account behavior to always preserving the files not uploaded. There will be folder under ~/Library/CloudStorage containing the remained files.

1 Like