Disappearing/Missing Folders... bug or compromised?

Nextloud comes across as a really nice solution for small business small office / SOHO, hoever recently we started experiencing some issues with it, so not sure if this is just not sufficient knowledge of the system or we’ve been compromised. In short, I noticed that we started to get missing folders in the web-browser. Which makes me wonders, was it compromised or is it a know issue with nextcloud? Also, after upgrade from 15 to 16 version when the domain scan is done by nextcloud, i see an A and not A+ as it was before, which also shows me ver. 15, which is odd because the browser shows ver.16.

If missing folders a common issue with nextcloud? Please note this is “Production” version.

If anyone can help, will greatly appreciate it.

Try to check logs, who access those folders last.
Also Activity App can say when what was deleted, moved, created.

For a deeper Analyses you can activate Audit/Logging App and check audit.log afterwards under your data folder. This will track all activities of all users.

It is a know fact, that the scan function requires a reload before the up-to-date scan result is displayed. Most likely you’ve forgotten to refresh that view.

I’ve never seen a missing folder issue although I’m using Nextcloud for year now. I would recommend to check the access rights of a missing folder on the server console, eventually these are not set correctly.

I checked Logs for it. I found nothing going back 2 months. whats the path to that ‘data folder’ on linux?

Frankly, never done that. I ran occ scan: file --all but it still didnt find the other files, at least it didnt display them. Is there another command i should use for a deeper scan or look in a certain path in particular? How would i reload a scan function? I did restart the server a few times, but that didn’t help.

I would expect to find at least a symbolic link named “data” in your Nextcloud web root which should point to the data directory. If not you should look for a sub directory called “config” in your Nextcloud web root, which should gives you access to the Nextcloud configuration file “config.php”. This file usually contains a parameter called “datadirectory” which points to the data directory.

Usually it is in a web root e.g. /var/www/nextcloud/data
To find out where is yours check your config.php under .../nextcloud/config/config.php.
Or simply run in nextcloud folder:

sudo grep datadirectory config/config.php | cut -d "'" -f4

Ok… so its/var/nc_data

So, I went into my username and /var/nc_data/"username"/files_versions and the files there were missing on browser are there, so they were not deleted… question is, how do i recover them back to browser and how to avoid this issue in the future?

You’ve enabled the Versions app on your server, which creates and manages the content of the files_versions folder. It is normal that the content of the directory is not shown in the usual way.
Only files in the files directory are displayed the normal way. Here is the app description:

This application automatically maintains older versions of files that are changed. When enabled, a hidden versions folder is provisioned in every user’s directory and is used to store old file versions. A user can revert to an older version through the web interface at any time, with the replaced file becoming a version. The app automatically manages the versions folder to ensure the user doesn’t run out of Quota because of versions. In addition to the expiry of versions, the versions app makes certain never to use more than 50% of the user’s currently available free space. If stored versions exceed this limit, the app will delete the oldest versions first until it meets this limit. More information is available in the Versions documentation.

The user manual is also worse a look.

Hmmm… Dont remember install it… ok, so i found it… so if i would to disable it, would all the folders appear again? I also cant seem to find the option described in the manual? is it done via admin account, if so, how do i get there, are you aware?

I wouldn’t expect that the files_versions folders will reappear again because they are only app-internal folders which contain legacy file versions which can be restored on a request base.
You should check if you find the missing folders under the files folder of a user. If not, they have most likely been deleted.

OK… so how do i restore all the files? What should I do, because some of those files were quite important.

I’ve not yet tried it nut due to the fact that the original file doesn’t exist anymore I would try to copy the desired file on the console from the files_versionsto the files folder. Once you’ve done this the file should be displayed again.

Do that… moved the files but they are not showing up… should i somehow rescan the files in the system for browser to see?

On my server files are usually instantly shown if I access the folder. Make sure that the ownership and access rights of the files are correctly set. If this doesn’t help you can try to run the ./occ files:scan ... command to update the file cache of Nextcloud.

Thank you. That helped.

So in short, if i disabled that Version app, that means it wont be happening in the future, correct?

That insinuates that the versions app has caused the problem, what I cannot believe. Other users would have already reported such a problem. I cannot tell you how the files have been deleted, but I think it wasn’t Nextcloud nor the version app.
The version app has protected you from a data loss in this specific case. If you disable the version app you have to make sure that a reliable backup strategy is in place to protect you from data loss :wink:

Now, and i though i got to the bottom of the issue :slightly_smiling_face:

Ok, if so, is there a way for me to investigate what might have been the issue and why folders kept on getting missed?

Can be something to do with upgrades that something went wrong?

I remember, I did ran ‘production’ but then upgrade to ‘stable’ which was a mistake as half the things stopped working, then on the new version i upgrade to ‘production’ which seemed to resolved those issues from ‘stable’. Can it be a cause there?

Frankly, as this cloud is growing i want to make sure i understand the cause of issue otherwise its very difficult to continue… Do you have any ideas?

Backing up, sure… but doesnt it do it automatically?

Nothing happens automatically on a server :wink: If you want to have an automatic backup (database, files) you have to make sure it is configured in one or the other way. Nextcloud more or less only gives you access to the data, that’s all. Here you find some hints how to get started on this:

There are many possible reasons what could have went wrong, or have been changed, e.g.

  • a user has deleted his files erroneously using the Nextcloud GUI.
  • a user has deleted his files erroneously using a mobile app.
  • the files have been deleted on the console somehow.
  • a different data directory has been configured with the new version.

You can check the Nextcloud log file and activities and check if there are any file deletion messages. Unfortunately I don’t know a tool to trace file deletions on the server console.

I see… Thank you very much. You helped me a lot… because I was getting grey hair thinking it was hacked… :slight_smile:

The possibility of which is always there :slight_smile:

1 Like