NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.38k stars 14.33k forks source link

Nextcloud 21 -> 22 upgrade fails during upgrade of files app on 21.05 #133021

Closed mweinelt closed 5 months ago

mweinelt commented 3 years ago

Describe the bug

Upgrading nextcloud 21 to 22 on NixOS 21.05 fails with

UnexpectedValueException: The files of the app "files" were not correctly replaced before running the update

Updating the files plugin using occ fails:

[root@files:~]# nextcloud-occ app:update files
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
Full nextcloud-setup.service log
Aug 07 16:24:09 files systemd[1]: Starting nextcloud-setup.service...
Aug 07 16:24:09 files sshd[1311]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=58.218.191.211  user=root
Aug 07 16:24:10 files nextcloud-setup-start[1323]: Nextcloud or one of the apps require upgrade - only a limited number of commands are available
Aug 07 16:24:10 files nextcloud-setup-start[1323]: You may use your browser or the occ upgrade command to do the upgrade
Aug 07 16:24:10 files nextcloud-setup-start[1323]: Setting log level to debug
Aug 07 16:24:10 files Nextcloud[1323]: {"reqId":"LQRdgmdXZ7Qnfm0IshAL","level":1,"time":"2021-08-07T14:24:10+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::setDebugLogLevel: Set log level to debug","userAgent":"--","version":"21.0.3.1"}
Aug 07 16:24:10 files Nextcloud[1323]: {"reqId":"LQRdgmdXZ7Qnfm0IshAL","level":0,"time":"2021-08-07T14:24:10+00:00","remoteAddr":"","user":"--","app":"core","method":"","url":"--","message":"starting upgrade from 21.0.3.1 to 22.0.0.11","userAgent":"--","version":"21.0.3.1"}
Aug 07 16:24:10 files Nextcloud[1323]: {"reqId":"LQRdgmdXZ7Qnfm0IshAL","level":1,"time":"2021-08-07T14:24:10+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Deprecated event type for \\OC\\Repair::step: Symfony\\Component\\EventDispatcher\\GenericEvent is used","userAgent":"--","version":"21.0.3.1"}
Aug 07 16:24:10 files Nextcloud[1323]: {"reqId":"LQRdgmdXZ7Qnfm0IshAL","level":1,"time":"2021-08-07T14:24:10+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Repair::step: Repair step: Repair MySQL collation","userAgent":"--","version":"21.0.3.1"}
Aug 07 16:24:10 files Nextcloud[1323]: {"reqId":"LQRdgmdXZ7Qnfm0IshAL","level":1,"time":"2021-08-07T14:24:10+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Deprecated event type for \\OC\\Repair::info: Symfony\\Component\\EventDispatcher\\GenericEvent is used","userAgent":"--","version":"21.0.3.1"}
Aug 07 16:24:10 files Nextcloud[1323]: {"reqId":"LQRdgmdXZ7Qnfm0IshAL","level":1,"time":"2021-08-07T14:24:10+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Repair::info: Repair info: Not a mysql database -> nothing to do","userAgent":"--","version":"21.0.3.1"}
Aug 07 16:24:10 files Nextcloud[1323]: {"reqId":"LQRdgmdXZ7Qnfm0IshAL","level":1,"time":"2021-08-07T14:24:10+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Deprecated event type for \\OC\\Repair::step: Symfony\\Component\\EventDispatcher\\GenericEvent is used","userAgent":"--","version":"21.0.3.1"}
Aug 07 16:24:10 files Nextcloud[1323]: {"reqId":"LQRdgmdXZ7Qnfm0IshAL","level":1,"time":"2021-08-07T14:24:10+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Repair::step: Repair step: Repair SQLite autoincrement","userAgent":"--","version":"21.0.3.1"}
Aug 07 16:24:10 files Nextcloud[1323]: {"reqId":"LQRdgmdXZ7Qnfm0IshAL","level":1,"time":"2021-08-07T14:24:10+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Deprecated event type for \\OC\\Repair::step: Symfony\\Component\\EventDispatcher\\GenericEvent is used","userAgent":"--","version":"21.0.3.1"}
Aug 07 16:24:10 files Nextcloud[1323]: {"reqId":"LQRdgmdXZ7Qnfm0IshAL","level":1,"time":"2021-08-07T14:24:10+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Repair::step: Repair step: Copy data from accounts table when migrating from ownCloud","userAgent":"--","version":"21.0.3.1"}
Aug 07 16:24:10 files kernel: refused connection: IN=ens6 OUT= MAC=da:ff:00:00:19:01:98:f2:b3:d9:60:91:08:00 SRC=199.19.226.145 DST=82.195.73.19 LEN=44 TOS=0x00 PREC=0x00 TTL=242 ID=54321 PROTO=TCP SPT=39452 DPT=5555 WINDOW=65535 RES=0x00 SYN URGP=0 
Aug 07 16:24:10 files Nextcloud[1323]: {"reqId":"LQRdgmdXZ7Qnfm0IshAL","level":1,"time":"2021-08-07T14:24:10+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Deprecated event type for \\OC\\Repair::step: Symfony\\Component\\EventDispatcher\\GenericEvent is used","userAgent":"--","version":"21.0.3.1"}
Aug 07 16:24:10 files Nextcloud[1323]: {"reqId":"LQRdgmdXZ7Qnfm0IshAL","level":1,"time":"2021-08-07T14:24:10+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Repair::step: Repair step: Drop account terms table when migrating from ownCloud","userAgent":"--","version":"21.0.3.1"}
Aug 07 16:24:10 files nextcloud-setup-start[1323]: Updating database schema
Aug 07 16:24:10 files Nextcloud[1323]: {"reqId":"LQRdgmdXZ7Qnfm0IshAL","level":1,"time":"2021-08-07T14:24:10+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::dbUpgradeBefore: Updating database schema","userAgent":"--","version":"21.0.3.1"}
Aug 07 16:24:10 files nextcloud-setup-start[1323]: Updated database
Aug 07 16:24:10 files Nextcloud[1323]: {"reqId":"LQRdgmdXZ7Qnfm0IshAL","level":1,"time":"2021-08-07T14:24:10+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::dbUpgrade: Updated database","userAgent":"--","version":"21.0.3.1"}
Aug 07 16:24:10 files Nextcloud[1323]: {"reqId":"LQRdgmdXZ7Qnfm0IshAL","level":3,"time":"2021-08-07T14:24:10+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"{\"Exception\":\"UnexpectedValueException\",\"Message\":\"The files of the app \\\"files\\\" were not correctly replaced before running the update\",\"Code\":0,\"Trace\":[{\"file\":\"/nix/store/9fxgnfrihj0x9hxnfwkkw0r21yh52k5b-nextcloud-22.0.0/lib/private/Updater.php\",\"line\":261,\"function\":\"checkAppsRequirements\",\"class\":\"OC\\\\Updater\",\"type\":\"->\",\"args\":[]},{\"file\":\"/nix/store/9fxgnfrihj0x9hxnfwkkw0r21yh52k5b-nextcloud-22.0.0/lib/private/Updater.php\",\"line\":130,\"function\":\"doUpgrade\",\"class\":\"OC\\\\Updater\",\"type\":\"->\",\"args\":[\"22.0.0.11\",\"21.0.3.1\"]},{\"file\":\"/nix/store/9fxgnfrihj0x9hxnfwkkw0r21yh52k5b-nextcloud-22.0.0/core/Command/Upgrade.php\",\"line\":241,\"function\":\"upgrade\",\"class\":\"OC\\\\Updater\",\"type\":\"->\",\"args\":[]},{\"file\":\"/nix/store/9fxgnfrihj0x9hxnfwkkw0r21yh52k5b-nextcloud-22.0.0/3rdparty/symfony/console/Command/Command.php\",\"line\":255,\"function\":\"execute\",\"class\":\"OC\\\\Core\\\\Command\\\\Upgrade\",\"type\":\"->\",\"args\":[{\"__class__\":\"Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput\"},{\"__class__\":\"Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput\"}]},{\"file\":\"/nix/store/9fxgnfrihj0x9hxnfwkkw0r21yh52k5b-nextcloud-22.0.0/3rdparty/symfony/console/Application.php\",\"line\":1009,\"function\":\"run\",\"class\":\"Symfony\\\\Component\\\\Console\\\\Command\\\\Command\",\"type\":\"->\",\"args\":[{\"__class__\":\"Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput\"},{\"__class__\":\"Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput\"}]},{\"file\":\"/nix/store/9fxgnfrihj0x9hxnfwkkw0r21yh52k5b-nextcloud-22.0.0/3rdparty/symfony/console/Application.php\",\"line\":273,\"function\":\"doRunCommand\",\"class\":\"Symfony\\\\Component\\\\Console\\\\Application\",\"type\":\"->\",\"args\":[{\"__class__\":\"OC\\\\Core\\\\Command\\\\Upgrade\"},{\"__class__\":\"Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput\"},{\"__class__\":\"Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput\"}]},{\"file\":\"/nix/store/9fxgnfrihj0x9hxnfwkkw0r21yh52k5b-nextcloud-22.0.0/3rdparty/symfony/console/Application.php\",\"line\":149,\"function\":\"doRun\",\"class\":\"Symfony\\\\Component\\\\Console\\\\Application\",\"type\":\"->\",\"args\":[{\"__class__\":\"Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput\"},{\"__class__\":\"Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput\"}]},{\"file\":\"/nix/store/9fxgnfrihj0x9hxnfwkkw0r21yh52k5b-nextcloud-22.0.0/lib/private/Console/Application.php\",\"line\":209,\"function\":\"run\",\"class\":\"Symfony\\\\Component\\\\Console\\\\Application\",\"type\":\"->\",\"args\":[{\"__class__\":\"Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput\"},{\"__class__\":\"Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput\"}]},{\"file\":\"/nix/store/9fxgnfrihj0x9hxnfwkkw0r21yh52k5b-nextcloud-22.0.0/console.php\",\"line\":99,\"function\":\"run\",\"class\":\"OC\\\\Console\\\\Application\",\"type\":\"->\",\"args\":[]},{\"file\":\"/nix/store/9fxgnfrihj0x9hxnfwkkw0r21yh52k5b-nextcloud-22.0.0/occ\",\"line\":11,\"args\":[\"/nix/store/9fxgnfrihj0x9hxnfwkkw0r21yh52k5b-nextcloud-22.0.0/console.php\"],\"function\":\"require_once\"}],\"File\":\"/nix/store/9fxgnfrihj0x9hxnfwkkw0r21yh52k5b-nextcloud-22.0.0/lib/private/Updater.php\",\"Line\":378,\"CustomMessage\":\"The files of the app \\\"files\\\" were not correctly replaced before running the update\"}","userAgent":"--","version":"21.0.3.1"}
Aug 07 16:24:10 files Nextcloud[1323]: {"reqId":"LQRdgmdXZ7Qnfm0IshAL","level":3,"time":"2021-08-07T14:24:10+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::failure: UnexpectedValueException: The files of the app \"files\" were not correctly replaced before running the update","userAgent":"--","version":"21.0.3.1"}
Aug 07 16:24:10 files nextcloud-setup-start[1323]: UnexpectedValueException: The files of the app "files" were not correctly replaced before running the update
Aug 07 16:24:10 files nextcloud-setup-start[1323]: Update failed
Aug 07 16:24:10 files nextcloud-setup-start[1323]: Maintenance mode is kept active
Aug 07 16:24:10 files Nextcloud[1323]: {"reqId":"LQRdgmdXZ7Qnfm0IshAL","level":3,"time":"2021-08-07T14:24:10+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::updateEnd: Update failed","userAgent":"--","version":"21.0.3.1"}
Aug 07 16:24:10 files nextcloud-setup-start[1323]: Resetting log level
Aug 07 16:24:10 files Nextcloud[1323]: {"reqId":"LQRdgmdXZ7Qnfm0IshAL","level":1,"time":"2021-08-07T14:24:10+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::maintenanceActive: Maintenance mode is kept active","userAgent":"--","version":"21.0.3.1"}
Aug 07 16:24:10 files Nextcloud[1323]: {"reqId":"LQRdgmdXZ7Qnfm0IshAL","level":1,"time":"2021-08-07T14:24:10+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::resetLogLevel: Reset log level to Debug(0)","userAgent":"--","version":"21.0.3.1"}
Aug 07 16:24:11 files systemd[1]: nextcloud-setup.service: Main process exited, code=exited, status=5/NOTINSTALLED
Aug 07 16:24:11 files systemd[1]: nextcloud-setup.service: Failed with result 'exit-code'.
Aug 07 16:24:11 files systemd[1]: Failed to start nextcloud-setup.service.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Install Nextcloud 21 on 21.05
  2. Upgrade to Nextcloud 22
  3. Boom

Expected behavior

Upgrade of the file app should happen smoothly? :smile:

Additional context

[root@files:~]# nextcloud-occ app:list
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
Enabled:
  - accessibility: 1.7.0
  - activity: 2.14.3
  - camerarawpreviews: 0.7.11
  - cloud_federation_api: 1.4.0
  - comments: 1.11.0
  - contactsinteraction: 1.2.0
  - dav: 1.17.1
  - documentserver_community: 0.1.11
  - federatedfilesharing: 1.11.0
  - federation: 1.11.0
  - files: 1.16.0
  - files_pdfviewer: 2.1.0
  - files_rightclick: 1.0.0
  - files_sharing: 1.13.1
  - files_trashbin: 1.11.0
  - files_versions: 1.14.0
  - files_videoplayer: 1.10.0
  - firstrunwizard: 2.10.0
  - groupfolders: 9.0.2
  - logreader: 2.6.0
  - lookup_server_connector: 1.9.0
  - maps: 0.1.9
  - metadata: 0.14.0
  - nextcloud_announcements: 1.10.0
  - notifications: 2.9.0
  - oauth2: 1.9.0
  - onlyoffice: 7.0.2
  - password_policy: 1.11.0
  - photos: 1.3.0
  - privacy: 1.5.0
  - provisioning_api: 1.11.0
  - recommendations: 1.0.0
  - serverinfo: 1.11.0
  - settings: 1.3.0
  - sharebymail: 1.11.0
  - support: 1.4.0
  - survey_client: 1.9.0
  - systemtags: 1.11.0
  - text: 3.2.0
  - theming: 1.12.0
  - twofactor_backupcodes: 1.10.0
  - twofactor_u2f: 6.2.0
  - updatenotification: 1.11.0
  - user_ldap: 1.11.0
  - user_status: 1.1.1
  - viewer: 1.5.0
  - weather_status: 1.1.0
  - workflowengine: 2.3.0
Disabled:
  - admin_audit
  - circles
  - dashboard
  - encryption
  - files_external
  - gpxedit

Notify maintainers

@Ma27 @bbenno

Metadata

 - system: `"x86_64-linux"`
 - host os: `Linux 5.10.52, NixOS, 21.05pre-git (Okapi)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.3.15`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute:
# a list of nixos modules affected by the problem
module: nextcloud
Ma27 commented 3 years ago

Oof that sucks! :( Actually tested such an upgrade myself, but will take a look soonish.

nixinator commented 3 years ago

upgrade worked for me, but I'm not using any plugins... .specifically for this reason.

mweinelt commented 3 years ago

@nixinator Can you offer your app list for comparison then? It's hard to tell which is which.

Ma27 commented 3 years ago

@mweinelt I cannot reproduce this unfortunately. A few notes though:

Ma27 commented 3 years ago

cc @mweinelt any updates here?

mweinelt commented 3 years ago

Retried after disabling some apps from last time, can't say which they were. But now things just worked.

mweinelt commented 2 years ago

Same problem on the upgrade to 22.05. Disabled all apps, no dice. From 22.2.7 -> 23.0.5.

UnexpectedValueException: The files of the app "files" were not correctly replaced before running the update

Enabled:
  - cloud_federation_api: 1.5.0
  - dav: 1.20.0
  - federatedfilesharing: 1.12.0
  - files: 1.17.0
  - lookup_server_connector: 1.10.0
  - oauth2: 1.10.0
  - provisioning_api: 1.12.0
  - settings: 1.4.0
  - twofactor_backupcodes: 1.11.0
  - viewer: 1.6.0
  - workflowengine: 2.4.0
Disabled:
  - accessibility: 1.8.0
  - activity: 2.15.0
  - admin_audit
  - circles: 22.3.1
  - comments: 1.12.0
  - contactsinteraction: 1.3.0
  - dashboard: 7.1.0
  - encryption
  - federation: 1.12.0
  - files_external
  - files_pdfviewer: 2.3.1
  - files_rightclick: 1.1.0
  - files_sharing: 1.14.0
  - files_trashbin: 1.12.0
  - files_versions: 1.15.0
  - files_videoplayer: 1.11.0
  - firstrunwizard: 2.11.0
  - logreader: 2.7.0
  - nextcloud_announcements: 1.11.0
  - notifications: 2.10.1
  - password_policy: 1.12.0
  - photos: 1.4.0
  - privacy: 1.6.0
  - recommendations: 1.1.0
  - serverinfo: 1.12.0
  - sharebymail: 1.12.0
  - support: 1.5.0
  - survey_client: 1.10.0
  - systemtags: 1.12.0
  - text: 3.3.1
  - theming: 1.13.0
  - updatenotification: 1.12.0
  - user_ldap: 1.12.2
  - user_status: 1.2.0
  - weather_status: 1.2.0

Is it a funny coincidence, that the host is also named files?

mweinelt commented 2 years ago

Perhaps you may want to check if one of the solutions helps you.

Most of the issues say to redownload the tarball and unpack the apps again. I don't think that should be necessary with NixOS.

mweinelt commented 2 years ago

Upgrading from 22.2.7 to 22.2.8.1 on release-21.11 works.

Upgrading from 22.2.8.1 to 23.0.5 fails.

I'd be happy to demonstrate this in a shared terminal session.

boxofrox commented 1 year ago

Unsure if this would solve author's issue, but an FYI for documentation purposes. I ran into the same error message...

UnexpectedValueException: The files of the app "files" were not correctly replaced before running the update

...while upgrading from nextcloud 24 to nextcloud 26. 24 -> 25 worked find, 25 -> 26 generated the error when I ran nextcloud-occ upgrade.

The underlying cause in my case was the nextcloud-setup.service failed to run. That failed when it tried to update the permissions on the nextcloud data directory after I converted that folder to a symbolic link before the v26 upgrade. Switching from the symbolic link to a bind-mount allowed the permissions to update, the nextcloud-setup.service completed, and the upgrade finished without the need for nextcloud-occ upgrade.

lenaxia commented 1 year ago

Unsure if this would solve author's issue, but an FYI for documentation purposes. I ran into the same error message...

UnexpectedValueException: The files of the app "files" were not correctly replaced before running the update

...while upgrading from nextcloud 24 to nextcloud 26. 24 -> 25 worked find, 25 -> 26 generated the error when I ran nextcloud-occ upgrade.

The underlying cause in my case was the nextcloud-setup.service failed to run. That failed when it tried to update the permissions on the nextcloud data directory after I converted that folder to a symbolic link before the v26 upgrade. Switching from the symbolic link to a bind-mount allowed the permissions to update, the nextcloud-setup.service completed, and the upgrade finished without the need for nextcloud-occ upgrade.

Can you elaborate more on what you did for the bind-mount situation? I'm seeing this issue in 26->27 now

boxofrox commented 1 year ago

@lenaxia

Can you elaborate more on what you did for the bind-mount situation? I'm seeing this issue in 26->27 now

Yes. Hope this helps a month later. :grimacing:

In my case, I have a separate drive for my nextcloud data (/dev/disk/by-label/ncdata). To better manage rollbacks, I customized the nextcloud package/module so I could organize each versions state in a different folder (e.g. /srv/nextcloud/{24,25,26,etc}). This way, an upgrade to v25 only affects the state in its version folder, not the state needed by v24. I initially tried to use a symlink to mount the ncdata drive once (at /srv/nextcloud/ncdata), and have it accessible as a symlink /srv/nextcloud/{24,25,26}/data for any single container of nextcloud I started. This is the backstory, it likely doesn't apply to you, but might help when making sense of my solution.

My bind-mount solution.

1. Mount data drive

In my hardware-configuration.nix, I mount the data drive at /srv/nextcloud/ncdata, then use a bind-mount to reuse that mountpoint inside, e.g., nextcloud v25 container. If you don't have a separate drive, then my changes to hardware-configuration.nix can be ignored.

# hardware-configuration.nix
{ ... }: {
  fileSystems."srv/nextcloud/ncdata" = {
    device = "/dev/disk/by-label/ncdata";  # Use your disk.
    fsType = "ext4";
  };
}

2. Bind-mount

# container/nextcloud/default.nix
# This file included in "configuration.nix".imports

{ config, pkgs }:

let
  home = "/data";
  hostDir = "/srv/nextcloud";
  nextcloudVersion = 25;

in {
  containers.nextcloud = {
    autoStart = true;

    bindMounts = {
      # Where nextcloud state is kept.
      "${home}" = {
        hostPath = "${hostDir}";
        isReadOnly = false;
      };

      # Where nextcloud data is kept (e.g. user files).
      # Effectively uses a linux bind-mount to make /srv/nextcloud/ncdata available where nextcloud app expects to find it.
      "${home}/${toString nextcloudVersion}/data" = {
        hostPath = "${hostDir}/ncdata";
        isReadOnly = false;
      };
    };
  };

  config = {
    services.nextcloud = {
      home = "${home}/${toString nextcloudVersion}";
      # Upon reflection, I probably could have refactored nextcloudVersion into the bindMounts.

      # Other nextcloud configuration here.
    };
  };
}

3. Make sure permissions on nextcloud data are correct.

I configured my container to use uid:gid 999:999 for the nextcloud service, though I seem to have misplaced where I specified that setting, cause I can't find it now. :face_with_head_bandage: edit: looks like user nextcloud in my container is user 999 on my host. Your setup might differ.

Anyway, on the host (not the container), I ran sudo chmod -R 999:999 /srv/nextcloud/ncdata to ensure all file permissions were correct and accessible for my nextcloud service.

To finish, I then spun up my nextcloud v25 container and confirmed it was working. Then I updated my nextcloud container configuration to nextcloudVersion = 26, and rebuilt my NixOS configuration.

Probably more details than you wanted, but hopefully what you were looking for is in there.

gianmarcogg03 commented 5 months ago

I'm having the same problem trying to upgrade from 28 to 29, none of the solutions here worked (although I don't do any bind mounting, but I have the data directory in a custom place).

Ma27 commented 5 months ago

The permissions situation was at fault at least for the last reporter @boxofrox and this was reworked with the switch to tempfiles.

I'm somewhat afraid that this will turn into a "random NC upgrade issues"-thread now. @gianmarcogg03 can you please file a new bug with more details to what has happened?

gianmarcogg03 commented 5 months ago

@gianmarcogg03 can you please file a new bug with more details to what has happened?

Done: https://github.com/NixOS/nixpkgs/issues/322621.