Internal Server Error following upgrade to Ubuntu 20.04

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 18.0.2): 18.0.4
Operating system and version (eg, Ubuntu 20.04): Ubuntu 20.04
Apache or nginx version (eg, Apache 2.4.25): Nginx 1.17.10
PHP version (eg, 7.1): 7.4.6

The issue you are facing: Internal Server Error after updating to Ubuntu 20.04. I was previously experiencing the issue of login to the web interface fails on all attempts and redirects to login?redirect_url=/apps/files/ . At this stage I was still running Ubuntu 18.04 but have subsequently upgraded to 20.04 in an attempt to fix the issue.

Yesterday I installed PHP 7.4 and all required packages. I then stupidly removed PHP 7.3 and all it’s installed packages. At this point I was getting a 302 error in nginx. I them pointed my nginx config files to PHP 7.4 and got the web interface to show the login screen again. All of my desktop and phone clients worked at this point without issue but I still could not login to the web interface. All login attempts redirects to login?redirect_url=/apps/files/ . After being unable to resolve this issue today, I updated to Ubuntu 20.04 and now have an Internal Server error.

I had tried changing the permissions on /var/lib/php/sessions to both nginx:nginx and www-data:www-data (default is root:root) and this didn’t work either, despite other Topics with similar issues reporting that this resolved the issue.

What am I doing wrong? All help is greatly appreciated.

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. Installed PHP 7.4 and it’s associated packages (the same ones I had installed for 7.3)
  2. Uninstalled PHP 7.3 and it’s associated packages
  3. Can’t login to web interface and all login attempts redirect to login?redirect_url=/apps/files/ .
  4. Upgraded to Ubuntu 20.04
  5. Internal Server Error

The output of your Nextcloud log in Admin > Logging:

Please advise where I can find this in Ubuntu as I can't access the web interface.

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

<?php
$CONFIG = array (
  'passwordsalt' => '',
  'secret' => '',
  'trusted_domains' =>
  array (
    0 => 'localhost',
    1 => 'XX.XX.XXX.XX',
    2 => 'nextcloud.test.com',
  ),
  'datadirectory' => '/var/www/html/data',
  'overwrite.cli.url' => 'http://localhost',
  'dbtype' => 'mysql',
  'version' => '18.0.4.2',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  0 => 'XX.XX.XXX.XX',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud12821',
  'dbpassword' => '',
  'installed' => true,
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => 'localhost',
    'port' => 6379,
  ),
  'instanceid' => '',
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 2,
  'enable_previews' => false,
  'mail_from_address' => '',
  'mail_smtpmode' => 'smtp',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_domain' => '',
  'updater.release.channel' => 'stable',
  'app_install_overwrite' =>
  array (
    0 => 'contacts',
  ),
);

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

Please advise exactly which log to provide and I'll provide it/them. I'm not sure if you require "access.log", "error.log", "nextcloud_https_access.log " or "nextcloud_https_error.log" from /var/log/nginx

it is not a good idea in the release cycle of a linux operation system (e.g. Ubuntu 18.04 LTS) to make a change of tools like php from another source.

It would be better to change back to php 7.3 or php 7.2 or change to ubuntu 20.04 LTS.

Ubuntu 18.04 LTS uses PHP 7.2
https://packages.ubuntu.com/bionic/php

Ubuntu 20.04 LTS uses PHP 7.4
https://packages.ubuntu.com/groovy/php

Other versions (not LTS) make no sense for nextcloud server.
An alternative is perhaps Debian GNU/Linux.

Valid point. I have been using the packages in ppa:ondrej/php for as long as I’ve been running nextcloud on this VPS. I have been running 7.3 for nearly as long without issue and only after uninstalling 7.3 yesterday did I encounter issues.

Perhaps make a backup of your nextcloud and reinstall your VPS with Ubuntu 20.04 LTS or Debian Buster. I use Debian Buster only with the original packages. For longer releases search for CentOS. Ubuntu and Debian you should dist-upgrade all two years.

I think longer releases make problems with nextcloud.
Read support time from nextcloud with php, …

https://docs.nextcloud.com/server/latest/admin_manual/installation/system_requirements.html

Given I’m already up a creek, I decided to upgrade the server to Ubuntu 20.04 on your advice. I’ve adjusted the initial post accordingly. Currently have an internal server error that I’m working to resolve.