[Solved] Files do not display in web after DB restore

Nextcloud version (eg, 20.0.5) : 26.0.3
Operating system and version (eg, Ubuntu 20.04) : Ubuntu 20.04
Apache or nginx version (eg, Apache 2.4.25) : Apache/2.4.57
PHP version (eg, 7.4) : PHP 8.1.20

The issue you are facing:
I did have an issue with CRON and was trying many things to resolve it. In the process, some sites suggested reinstalling MariaDB. I did this but did not realize that the reinstall would delete the databases. In WEBOZO which is my server admin program, it had a reinstall option for MariaDB, when I clicked it it told me that there would be a backup made. However, the backup failed because there was a new empty database that could not be dumped, so the backup did not complete. Bottomline I had no current backup. After I realized that after the reinstall of the mariaDB server, all my databases were gone, I searched for the backup but it then was clear that it did not happen.
So I only had a backup from April, I restored this and it installed all my DBs, but of course with April data.
The issue I have now is that all my NextCloud files do not show in any User dashboard. If I go to the files none of them are here. Of course, I checked the data directory and all files are in there. Also, it is not encrypted.

I tried:
occ files:scan --all
occ maintenance:repair
occ upgrade
occ check
occ maintenance:data-fingerprint
occ files:repair-tree

Nothing works, I can log in and I see activities, but I can’t access any file, even though all are in the data folder. Does anyone have a tip for me to get this working again?

Is this the first time you’ve seen this error? (Y/N): Y

When you say “do not show” do you get any errors in the web interface? What does it look like?

Can you post a few recent entries from your nextcloud.log located in your data directory? It almost certainly has clues.

Hi,
I have resolved it. It was strange, but somehow when I switch on ModSecurity in Apache it does not show the files. After I disabled it, it shows them again. In any case I am back in action.

2 Likes

Always remember to mark the thread as solved by marking the solution post :wink:

This makes life easier for the serarcher with similar problem…

That’s because mod_security is specifically documented as breaking things. :slight_smile:

https://docs.nextcloud.com/server/latest/admin_manual/issues/general_troubleshooting.html?highlight=mod_security#web-server-and-php-modules

Thank you all for helping me with these issues. I am happy that you guys looked at this and helped me on the way; this is much appreciated.

3 Likes