nextcloud / nextcloud/docker

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

Open
#1,925 11 comments 2 reactions 0 assignees View on GitHub

@patman-cp is already working on this.

Since Sep 9, 2023.

  • #2063 by @patman-cp — open
bug data persistence needs review
Dominant language
Shell
Stars
7.4k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

⚠️ 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"

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the Docker image's provisioning scripts and the behavior around the /var/www/html persistent volume. Then read open pull request #2063, which is already linked to this issue. Done means existing directories are no longer removed silently, or the deployment stops with a clear warning requiring operator action.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, kubernetes, shell
Domain
devops, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.