"Internal Server Error" after Update 21 -> 22; NC inaccessible [SOLVED]

Nextcloud version 22.1.0-1
Operating system and version archlinuxarmv7
Apache version Apache 2.4.48-1
PHP version 8.0.9

The issue you are facing:

I updated from NC 21 to 22.1, and I keep running into internal server errors. In former times, this meant I had to change ownership of /usr/share/webapps/nextcloud/ and /etc/webapps/nextcloud to http: http (Apache user) and all would be fine.
This time, I’ve tried every combination of chown-ing to nextcloud:nextcloud http:http nextcloud:http http:nextcloud on all 3 paths; I have adapted fpm-config to run fpm as nextcloud user.
I keep running into the internal server error and I am at a complete and utter loss.

When I chown the config.php path to http:http, I get this error message:

Fehler
The files of the app accessibility (accessibility), activity (activity), circles (circles), cloud_federation_api (cloud_federation_api), comments (comments), contactsinteraction (contactsinteraction), dashboard (dashboard), dav (dav), federatedfilesharing (federatedfilesharing), federation (federation), files (files), files_external (files_external), files_pdfviewer (files_pdfviewer), files_rightclick (files_rightclick), files_trashbin (files_trashbin), files_versions (files_versions), firstrunwizard (firstrunwizard), logreader (logreader), lookup_server_connector (lookup_server_connector), nextcloud_announcements (nextcloud_announcements), notifications (notifications), oauth2 (oauth2), password_policy (password_policy), privacy (privacy), provisioning_api (provisioning_api), recommendations (recommendations), serverinfo (serverinfo), settings (settings), sharebymail (sharebymail), support (support), survey_client (survey_client), systemtags (systemtags), text (text), twofactor_backupcodes (twofactor_backupcodes), updatenotification (updatenotification), user_status (user_status), viewer (viewer), weather_status (weather_status), workflowengine (workflowengine) were not replaced correctly. Make sure it is a version compatible with the server.

When I chown the config.php path to nextcloud:nextcloud, I get this:

Interner Serverfehler

Der Server konnte die Anfrage nicht fertig stellen.

Sollte dies erneut auftreten, sende bitte die nachfolgenden technischen Einzelheiten an Deinen Server-Administrator.

Weitere Details können im Server-Protokoll gefunden werden.

Technische Details

  • Entfernte Adresse: xx.xx.xxx.xx
  • mTAQyZ02x7DzMaznRHnc

Is this the first time you’ve seen this error? (Y/N): No, but the first time, I cannot solve it by chown-ing

Steps to replicate it:

  1. Update NC 21 to NC 22 on a raspberrypi running archlinuxarmv7

The output of your Nextcloud log in Admin > Logging:

[if necessary, I can provide hundreds of lines of logs, but I try not to spam the space here more than I do, anyway. The whole log boils down to:
nextcloud/status.php complaining about "Operation not permitted at /usr/share/webapps/nextcloud/lib/private/Config.php #246 and 250
“Permission denied” / “Can’t write in config” ]

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'instanceid' => 'XYZ',
  'passwordsalt' => 'SALT',
  'secret' => 'SECRET',
  'trusted_domains' => 
  array (
    0 => 'MY.DOMAIN',
    1 => '192.168.xx.xx',
    2 => 'machinename',
  ),
  'datadirectory' => '/NextcloudData',
  'logfile' => '/NextcloudData/nextcloud.log',
  'apps_paths' => 
  array (
    0 => 
    array (
      'path' => '/usr/share/webapps/nextcloud/apps',
      'url' => '/apps',
      'writable' => true,
    ),
    1 => 
    array (
      'path' => '/var/lib/nextcloud/apps/',
      'url' => '/wapps',
      'writable' => true,
    ),
  ),
  'dbtype' => 'mysql',
  'version' => '22.1.0.1',
  'overwrite.cli.url' => 'https:.....',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost:3306',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'USER',
  'dbpassword' => 'PASSWORD',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'installed' => true,
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'tls',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'NAME',
  'mail_domain' => 'PROVIDER',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'smtp.....',
  'mail_smtpname' => '...@...',
  'mail_smtppassword' => 'PASSWORD',
  'filesystem_check_changes' => 1,
  'preview_libreoffice_path' => '/usr/bin/libreoffice',
  'preview_office_cl_parameters' => '--headless --nologo --nofirststartwizard --invisible --norestore --convert-to png --outdir',
  'force_locale' => 'de_DE',
  'default_phone_region' => 'de',
  'maintenance' => false,
  'loglevel' => 0,
  'theme' => '',
  'app_install_overwrite' => 
  array (
    0 => 'epubreader',
    1 => 'files_linkeditor',
  ),
  'config_is_read_only' => true,
);

The output of your Apache/nginx/system log in /var/log/____:

 "GET / HTTP/1.1" 500 2509
 "GET /core/js/dist/main.js?v=ba222ded25d957b900c03bef914333cd HTTP/1.1" 304 -
 "GET /core/l10n/de.js?v=ba222ded25d957b900c03bef914333cd HTTP/1.1" 304 -
 "GET /core/img/favicon-touch.png HTTP/1.1" 200 6795
"GET /core/img/favicon.ico HTTP/1.1" 200 3262
 "GET /index.php/apps/photos/service-worker.js HTTP/1.1" 500 2509
"GET /nextcloud/status.php HTTP/1.1" 500 -
 "GET /nextcloud/status.php HTTP/1.1" 500 -
 "GET /nextcloud/status.php HTTP/1.1" 500 -
"GET /nextcloud/status.php HTTP/1.1" 500 -

Any help is very much appreciated. Thank you! :smiley:
(I’m probably only overlooking the largest of the obvious…)

Hi,

sorry for the self-reply… I should have posted my initial question yesterday, I’ve just had another idea, and it worked. Should anybody happen to come across this same issue, my solution (if it turns out to survive the next couple of days) might be helpful:

Ideas:

It seems to be a combined problem of ownership and Cookie/Browser-data. Regardless of which part of the solution I take, I need to clear my Firefox cache and log on to NC from a completely fresh tab. I caught this, when I enabled “epubreader” from the Admin App page (despite the yellow warning it would be bad for the stability of my server): after a page change, the info page told me, NC couldn’t empty the cached data - and the whole server crashed. (see below)

Solution:

I had read on the archlinux pages that NC has introduced the nextcloud:nextcloud user and one needs to change the install to that. Nope, all directories: Data, Config, Apps need to be owned by the user of the webserver.
Don’t try to log on from a browser tab that has previously shown an error message; I opened a new tab in a new environment and - hey! - after chown-ing everything back to normal, I got through, my desktop sync client happily went green.

Delete at least epubreader, that seems to crash the server.

My NC’s back. Phew.

Cheers and stay safe!