-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Existing directories deleted from /var/www/html PV when deploying docker image on kubernetes #1925
Comments
Should also note that this pv+pvc were pre-existing and not defined by the k8s deployment, the old contents were present initially until the nextcloud:production docker image's provisioning scripts ran. |
I'm guessing this from https://github.com/nextcloud/docker/blob/master/25/apache/entrypoint.sh#L150
is to blame. --delete passed to rsync before checking any other dirs exist apart from those in /usr/src/nextcloud edit: Thanks for moving this to the right place @szaimen |
I hit this when trying to get a corrupted and failed nextcloud setup working again - I wanted to leave existing files as-is so pointed the nextcloud volume at my existing directory and was surprised when all existing files were wiped. Luckily I backed up the every thing first - I was about to backup only the app store files, but decided backing up everything was a better idea. These files aren't critical to me, so I didn't have an existing backup (these are mainly images and videos I don't have space for on my phone but I want to keep them). Not sure how I'll get the previous files into this new instance. |
Opened a PR here: |
This issue is huge. Had a running nextcloud instance and today it deleted the whole data directory after a docker container restart within kubernetes! Luckily i have some backup but this is really critical for a cloud software! |
Docs note this today and describe how to add additional custom folders if necessary (though it's probably best to place them outside of Nextcloud's installation folder entirely as noted too): https://github.com/nextcloud/docker?tab=readme-ov-file#custom-volumes |
That's not a justification for leaving this as-is. Plus the documentation doesn't anything about using a named volume, it's placement at the end of the documentation makes it seem like a minor warning, and it's in the "Custom volumes" section so it looks like it only applies if you are using an additional custom volume. At a minimum this should fail rather than silently delete existing data - the user can easily delete the data themselves or script this for repeated uses. |
Yes, hence why the issue isn't closed out. My comment was updating on the status of things. Your associated PR (thank you, btw) has had review comments on it for months. If you want something to change, look there. :) |
Please fix this issue and throw an error while deploying the application. This silent deletion just deleted 700Gb-s of my data, my only hope is now to somehow recover some ZFS Uberblock data. |
Oh noes |
Bug description
I just moved my existing data directory to data-backup and rm'd the other files from the pv in order to start fresh as I was having issues with the original install that had been upgraded and moved many times since Nextcloud forked from Owncloud.
I was expecting to be able to move my files back into the new data dir once provisioned and issue a files:scan to reimport them.
Yet for some reason, the Nextcloud docker image's provisioning scripts just arbitrarily deletes the existing content of the PV? Including directories it doesn't even handle itself?
Why?
Luckily I have most of my family photos backed up etc. But why? Why do this? Fail with an error message if you want to prevent existing directories getting in the way of anything but don't just delete them without warning. This is just.... why??
Steps to reproduce
Expected behavior
Don't delete directories you don't typically manage. OR fail with a warning if you must and force the operator to take an action instead of dropping their files without any kind of prompting - not in the cli nor in the provisioning UI. Just .. why???
Installation method
Official All-in-One appliance
Operating system
Debian/Ubuntu
PHP engine version
PHP 8.1
Web server
Apache (supported)
Database engine version
PostgreSQL
Is this bug present after an update or on a fresh install?
Fresh Nextcloud Server install
Are you using the Nextcloud Server Encryption module?
None
What user-backends are you using?
Configuration report
No response
List of activated Apps
Nextcloud Signing status
No response
Nextcloud Logs
No response
Additional info
Your options for source only list community docker images but the docker hub repo says "official"
The text was updated successfully, but these errors were encountered: