Closed mweinelt closed 5 months ago
Oof that sucks! :( Actually tested such an upgrade myself, but will take a look soonish.
upgrade worked for me, but I'm not using any plugins... .specifically for this reason.
@nixinator Can you offer your app list for comparison then? It's hard to tell which is which.
@mweinelt I cannot reproduce this unfortunately. A few notes though:
camerarawpreviews
at 0.7.11 seems to be the only app from the list you pasted above that doesn't support Nextcloud 22 (0.7.12 does and was released a few days ago, though).
On Nextcloud 22, nextcloud-occ
tells me that the command is not defined when I run nextcloud-occ app:upgrade files
Can you please try to reproduce this in a minimal environment? Ideally something like this (buildable via nixos-build-vms
):
{
nxc = { lib, pkgs, config, ... }: {
networking.firewall.allowedTCPPorts = [ 80 ];
services.nextcloud = {
enable = true;
hostName = "nextcloud";
package = pkgs.nextcloud21;
config.adminpass = "foobar";
};
};
}
It may make sense to give me some instructions what to do. After that, the machine can be turned off, nextcloud
can be upgraded by changing the package
-attribute, re-running nixos-build-vms
and starting the VM with e.g. QEMU_NET_OPTS="hostfwd=tcp::8080-:80" ./result/bin/nixos-test-driver --keep-vm-state --interactive
.
I can only find older issues for the actual (I guess?) error, The files of the app \"files\" were not correctly replaced before running the update
: https://github.com/nextcloud/server/search?q=%22The+files+of+the+app+%22files%22+were+not+correctly+replaced+before+running+the+update%22&type=issues
Perhaps you may want to check if one of the solutions helps you. Also I guess it won't hurt to file a bug there if we don't get any further here.
cc @mweinelt any updates here?
Retried after disabling some apps from last time, can't say which they were. But now things just worked.
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?
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.
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.
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
.
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
@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.
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";
};
}
# 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.
};
};
}
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.
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).
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 can you please file a new bug with more details to what has happened?
Describe the bug
Upgrading nextcloud 21 to 22 on NixOS 21.05 fails with
Updating the files plugin using occ fails:
Full nextcloud-setup.service log
Steps To Reproduce
Steps to reproduce the behavior:
Expected behavior
Upgrade of the file app should happen smoothly? :smile:
Additional context
Notify maintainers
@Ma27 @bbenno
Metadata
Maintainer information: