Skip to content

[Bug]: Existing directories deleted from /var/www/html PV when deploying docker image on kubernetes #1925

@anomaly256

Description

@anomaly256

⚠️ This issue respects the following points: ⚠️

  • This is a bug, not a question or a configuration/webserver/proxy issue.
  • This issue is not already reported on Github (I've searched it).
  • Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
  • Nextcloud Server is running on 64bit capable CPU, PHP and OS.
  • I agree to follow Nextcloud's Code of Conduct.

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

  1. Rename existing data dir
  2. Remove nextcloud base files and DB to start a fresh install
  3. Panic as your renamed data-dir is deleted when it need not be

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?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

No response

List of activated Apps

Just the base 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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugdata persistenceVolumes, bind mounts, etc.needs reviewNeeds confirmation this is still happening or relevant

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions