Projekt

Allgemein

Profil

Aktionen

Aufgabe #1952

offen

Aufgabe #1950: Aktualisierung NixOS (von Version 23.11) auf Version 24.05

Aktualisierung NixOS (von Version 23.11) auf Version 24.05 Instanz Dienst Dateiverwaltung (Anwendung Nextcloud)

Von SoerenBoxberger vor 2 Monaten hinzugefügt. Vor 16 Tagen aktualisiert.

Status:
Neu
Priorität:
Dringend
Kategorie:
Instanz Nextcloud
Beginn:
20.08.2024
Abgabedatum:
% erledigt:

0%

Geschätzter Aufwand:
Aufgewendete Zeit:

Beschreibung

In den Release notes steht - neben dem Üblichen über Paketversionen - folgendes:

services.nextcloud has the following options moved into services.nextcloud.settings and renamed to match the name from Nextcloud’s config.php:

    logLevel -> loglevel,

    logType -> log_type,

    defaultPhoneRegion -> default_phone_region,

    overwriteProtocol -> overwriteprotocol,

    skeletonDirectory -> skeletondirectory,

    globalProfiles -> profile.enabled,

    extraTrustedDomains -> trusted_domains and

    trustedProxies -> trusted_proxies.

Aktionen #1

Von SoerenBoxberger vor 2 Monaten aktualisiert

Aktionen #2

Von SoerenBoxberger vor etwa 2 Monaten aktualisiert · Edited

  • Zugewiesen an wurde von Zuständigkeit Instandhaltung IT-Services zu SoerenBoxberger geändert

Update Nextcloud 27 -> 28

Das Aktualisieren der Nextcloud Version schlägt erst einmal fehl, da news für Nextcloud 28 nicht mehr in den nixpkgs enthalten ist.

error:
       … while calling the 'head' builtin

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/attrsets.nix:922:11:

          921|         || pred here (elemAt values 1) (head values) then
          922|           head values
             |           ^
          923|         elsewhile evaluating the attribute 'value'

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:807:9:

          806|     in warnDeprecation opt //
          807|       { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
             |         ^
          808|         inherit (res.defsFinal') highestPrio;

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: attribute 'news' missing

       at /etc/nixos/configuration.nix:157:18:

          156|     # Es gibt von Nix vorpaketierte Nextcloud Apps, diese sollen verwendet werden
          157|     extraApps = { inherit (config.services.nextcloud.package.packages.apps)
             |                  ^
          158| #####vb 2023-11-20

Auf https://apps.nextcloud.com/apps/news ist erkennbar, dass für die App auch keine stabilen Veröffentlichungen für diese Version von Nextcloud bereitgestellt werden.
Nach Absprache mit @PaulRiegel nehme ich die App aus der Konfiguration.

Nach dem Update werden folgende auf der Übersichtsseite der Administration bei Nextcloud ausgegeben:

Failed to get an iterator for log entries: Logreader application only supports "file" log_type

Nextcloud loggt unter NixOS standardmäßig zu journald und nicht in Dateien, daher funktioniert die App logreader nicht. Diese App ließe es zu, über die Weboberfläche die Logs der Nextcloud zu lesen. Eine Diskussion dazu findet sich in den nixpkgs auf GitHub: https://github.com/NixOS/nixpkgs/issues/306003.

Soweit ich das beurteilen kann, braucht der StuRa dieses Feature nicht, weshalb ich die App deaktiviere.

[root@cloud:/etc/nixos]# nextcloud-occ app:disable logreader
logreader 2.13.0 disabled

Server has no maintenance window start time configured. This means resource intensive daily background jobs will also be executed during your main usage time. We recommend to set it to a time of low usage, so users are less impacted by the load caused from these heavy tasks. For more details see the documentation (https://docs.nextcloud.com/server/28/go.php?to=admin-background-jobs).

Diesen Punkt könnte man mit dieser Option lösen, allerdings gibt es services.nextcloud.setting im Channel 23.11 noch nicht. Ich werde diesen Zusatz also erst mit dem Channel-Update umsetzen.

services = {
  ...
  nextcloud = {
    ...
    settings = {
      # Bei der Aktualisierung auf Nextcloud 28 wurde empfohlen, diese Einstellung zu setzen.
      # Siehe https://pro.stura.htw-dresden.de/issues/1952
      # Tägliche Jobs sollen zwischen 2:00 und 6:00 laufen. Die Angabe unten bezieht sich auf UTC.
      maintenance_window_start = 4; 
    };
    ...
  };
  ...
};

Nachtrag: Wahrscheinlich hätte ich diese Option auch in den "alten" services.nextcloud.extraOptions von Channel 23.11 setzen können.

One or more mimetype migrations are available. Occasionally new mimetypes are added to better handle certain file types. Migrating the mimetypes take a long time on larger instances so this is not done automatically during upgrades. Use the command `occ maintenance:repair --include-expensive` to perform the migrations.

[root@cloud:/etc/nixos]# nextcloud-occ maintenance:repair --include-expensive
 - Repair MySQL collation
     - Not a mysql database -> nothing to do
 - Clean tags and favorites
     - 0 tags of deleted users have been removed.
     - 0 tags for delete files have been removed.
     - 0 tag entries for deleted tags have been removed.
     - 0 tags with no entries have been removed.
 - Repair invalid shares
 - Move .step file of updater to backup location
 - Add move avatar background job
     - Repair step already executed
 - Add preview cleanup background jobs
 - Migrate oauth2_clients table to nextcloud schema
     - Update the oauth2_access_tokens table schema.
     - Update the oauth2_clients table schema.
     - Delete clients (and their related access tokens) with the redirect_uri starting with oc:// or ending with *
 - Fix potential broken mount points
     - No mounts updated
 - Repair language codes
 - Add log rotate job
 - Clear frontend caches
     - Image cache cleared
     - JS cache cleared
 - Clear every generated avatar
 - Add preview background cleanup job
 - Queue a one-time job to cleanup old backups of the updater
 - Cleanup invalid photocache files for carddav
 - Add background job to cleanup login flow v2 tokens
 - Remove potentially over exposing share links
     - No need to remove link shares.
 - Clear access cache of projects
 - Reset generated avatar flag
 - Keep legacy encryption enabled
 - Check encryption key format
 - Remove old dashboard app config data
 - Add job to cleanup the bruteforce entries
 - Queue a one-time job to check for user uploaded certificates
 - Repair DAV shares
 - Add background job to set the lookup server share state for users
 - Add token cleanup job
 - Clean up abandoned apps
 - Add possibly missing system config
 - Add AI tasks cleanup job
 - Queue a job to generate metadata
 - Remove shares of old group memberships
 - Repair mime types
     - Fixed eml and msg mime type
 - Validate the phone number and store it in a known format for search
 - Handle outdated scheduling events
     - Cleaning up old scheduling events
     - Adding background job to delete old scheduling objects
 - Upgrading Circles App
 - Fix component of birthday calendars
     - 160 birthday calendars updated.
 - Regenerating birthday calendars to use new icons and fix old birthday events without year
     - Repair step already executed
 - Fix broken values of calendar objects
    0 [->--------------------------]
 - Registering building of calendar search index as background job
     - Repair step already executed
 - Register building of social profile search index as background job
 - Registering background jobs to update cache for webcal calendars
     - Added 0 background jobs to update webcal calendars
 - Registering building of calendar reminder index as background job
     - Repair step already executed
 - Clean up orphan event and contact data
     - 0 events without a calendar have been cleaned up
     - 0 properties without an events have been cleaned up
     - 0 changes without a calendar have been cleaned up
     - 0 cached events without a calendar subscription have been cleaned up
     - 0 changes without a calendar subscription have been cleaned up
     - 0 contacts without an addressbook have been cleaned up
     - 0 properties without a contact have been cleaned up
     - 0 changes without an addressbook have been cleaned up
 - Remove activity entries of private events
     - Removed 0 activity entries
 - Clean up old calendar subscriptions from deleted users that were not cleaned-up
    0 [----->----------------------]
     - 0 calendar subscriptions without an user have been cleaned up
 - Remove invalid object properties
     - 0 invalid object properties removed.
 - Fix the share type of guest shares when migrating from ownCloud
 - Copy the share password into the dedicated column
 - Set existing shares as accepted
 - Clean up meta table
 - Show a hint about the new editor to existing users
 - Update OAuth token expiration times
 - Force-reset all Text document sessions
 - Initialize migration of background images from dashboard to theming app
 - Add background job to check for backup codes
 - Populating added database structures for workflows

The database is missing some indexes. Due to the fact that adding indexes on big tables could take some time they were not added automatically. By running "occ db:add-missing-indices" those missing indexes could be added manually while the instance keeps running. Once the indexes are added queries to those tables are usually much faster. Missing optional index "fs_storage_path_prefix" in table "filecache". Missing optional index "schedulobj_lastmodified_idx" in table "schedulingobjects".

[root@cloud:/etc/nixos]# nextcloud-occ db:add-missing-indices
Adding additional fs_storage_path_prefix index to the oc_filecache table, this can take some time...
oc_filecache table updated successfully.
Adding additional schedulobj_lastmodified_idx index to the oc_schedulingobjects table, this can take some time...
oc_schedulingobjects table updated successfully.

Update Channel

nix-channel --add https://nixos.org/channels/nixos-24.05 nixos
nix-channel --update 

Nach dem Ändern des Channels habe ich erstmal ein nixos-rebuild dry-build gemacht:

building the system configuration...
error:
       … while calling the 'head' builtin

         at /nix/store/3m9sp0j8i8032nin10vbfm548q1brlb7-nixos-24.05/nixos/lib/attrsets.nix:1575:11:

         1574|         || pred here (elemAt values 1) (head values) then
         1575|           head values
             |           ^
         1576|         elsewhile evaluating the attribute 'value'

         at /nix/store/3m9sp0j8i8032nin10vbfm548q1brlb7-nixos-24.05/nixos/lib/modules.nix:809:9:

          808|     in warnDeprecation opt //
          809|       { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
             |         ^
          810|         inherit (res.defsFinal') highestPrio;

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: The option `services.postgresql.ensureUsers."[definition 1-entry 1]".ensurePermissions' does not exist. Definition values:
       - In `/etc/nixos/configuration.nix':
           {
             "DATABASE nextcloud" = "ALL PRIVILEGES";
           }

An dieser Stelle habe ich die Konfiguration dementsprechend angepasst:

services.postgresql = {
    enable = true;
    ensureDatabases = [
      "${config.services.nextcloud.config.dbname}" 
    ];
    ensureUsers = [
      {
        name = "${config.services.nextcloud.config.dbuser}";
        # ensureUsers.ensurePermissions gibt es im channel 24.05 nicht mehr
        # In unserem Fall kann man aber ensureDBOwnership nutzen
        #ensurePermissions."DATABASE ${config.services.nextcloud.config.dbname}" = "ALL PRIVILEGES";
        ensureDBOwnership = true;
      }
    ];
  };

Diese Änderung hat aber nur Einfluss auf neu erstellte Datenbanken, also wenn die Instanz einmal neu aufgesetzt werden sollte oder /var/lib/postgresql/ gelöscht/neu erstellt wird.

Des weiteren werden folgende Warnungen ausgegeben:

trace: warning: The option `services.nextcloud.extraOptions' defined in `/etc/nixos/configuration.nix' has been renamed to `services.nextcloud.settings'.
trace: warning: The option `services.nextcloud.config.extraTrustedDomains' defined in `/etc/nixos/configuration.nix' has been renamed to `services.nextcloud.settings.trusted_domains'.
trace: warning: The option `services.nextcloud.config.overwriteProtocol' defined in `/etc/nixos/configuration.nix' has been renamed to `services.nextcloud.settings.overwriteprotocol'.
trace: warning: The option `services.nextcloud.config.defaultPhoneRegion' defined in `/etc/nixos/configuration.nix' has been renamed to `services.nextcloud.settings.default_phone_region'.
trace: warning: The option `services.nextcloud.logLevel' defined in `/etc/nixos/configuration.nix' has been renamed to `services.nextcloud.settings.loglevel'.

Die Optionen habe ich entsprechend umbenannt.

Ein nixos-rebuild switch endet wie folgt:

error: builder for '/nix/store/vsk78rlr051hcgzviczc8d2w49402y7z-redis-7.2.4.drv' failed with exit code 1;
       last 10 log lines:
       > Killing still running Redis server 17341
       > Killing still running Redis server 17363
       > Killing still running Redis server 17531
       > Killing still running Redis server 17893
       > Killing still running Redis server 17913
       > Killing still running Redis server 18665
       > Killing still running Redis server 18685
       > Killing still running Redis server 20656
       > Killing still running Redis server 23919
       > Killing still running Redis server 23966
       For full logs, run 'nix-store -l /nix/store/vsk78rlr051hcgzviczc8d2w49402y7z-redis-7.2.4.drv'.
error: 1 dependencies of derivation '/nix/store/z34z4zk55sn0qih71mqzhz4shrg7fkya-system-path.drv' failed to build
error: 1 dependencies of derivation '/nix/store/fdzkh98wqdxcjs98v9iriz1401f969hr-unit-redis-nextcloud.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/gd7ir83dyx3xabbvaawv73iaiscrpvbd-nixos-system-cloud-24.05.4469.6e99f2a27d60.drv' failed to build

Eine weitere Möglichkeit habe ich ausgetestet:
Nextcloud 27 auf dem 24.05er-Channel zu bauen bricht schon beim Evaluieren mit der Meldung ab, dass das Paket Nextcloud in der Version 27.1.11 unsicher sei.

Nach einer weiteren Rücksprache mit @PaulRiegel soll ich auf den alten Stand vor dem Beginn meiner Arbeit zurücksetzen.

Aktionen #3

Von PaulRiegel vor 16 Tagen aktualisiert

  • Zugewiesen an wurde von SoerenBoxberger zu Zuständigkeit Instandhaltung IT-Services geändert
  • Priorität wurde von Normal zu Dringend geändert
Aktionen #4

Von PaulRiegel vor 16 Tagen aktualisiert

  • Thema wurde von Nextcloud Update Nix-Channel 23.11 -> 24.05 zu Aktualisierung NixOS (von Version 23.11) auf Version 24.05 Instanz Dienst Dateiverwaltung (Anwendung Nextcloud) geändert
Aktionen

Auch abrufbar als: Atom PDF