"Internal Sever Error" instead of login after upgrade to 27.0.1.2

Support intro

Nextcloud version (eg, 20.0.5): 27.0.1.2
Operating system and version (eg, Ubuntu 20.04): Debian 12, bookworm (amd64)
Apache or nginx version (eg, Apache 2.4.25): Apache/2.4.57 (Debian)
PHP version (eg, 7.4): 8.2.8

The issue you are facing:
Before upgrade to 27.0.1.2 everything worked fine.
Update via web-based updater.
Update finished successfully.
On switching back to admin settings page: “Internal Server Error”.

Since then no login via browser possible: “Internal Server Error”
but: caldav sync works fine with all my devices, as well as Android nextcloud app.
Only access via browser is not possible any more.

Strange (but probably a hint)
After …occ maintenance:mode --on and rebooting the server:
Web-response: “Maintenance mode”
… occ maintenance:mode --off
Web-response: “Maintenance mode”
… service apache2 restart
Web-response: “Internal Server error”
… … occ maintenance:mode --on
Web-response: “internal Server error”
… occ maintenance:mode --off
Web-response: “internal Server error”

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

Steps to replicate it:

  1. just access nextcloud via browser…

The output of your Nextcloud log in Admin > Logging:
…/data/nextcloud.log:

{"reqId":"JRdSURwLXfC0RtIlFToX","level":3,"time":"2023-07-25T20:28:05+00:00","remoteAddr":"10.143.25.49","user":"--","app":"index","method":"GET","url":"/ao/login","message":"The requested uri(/ao/login) cannot be processed by the script '/nextcloud/index.php')","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/115.0","version":"27.0.1.2","exception":{"Exception":"Exception","Message":"The requested uri(/ao/login) cannot be processed by the script '/nextcloud/index.php')","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/base.php","line":1009,"function":"getRawPathInfo","class":"OC\\AppFramework\\Http\\Request","type":"->"},{"file":"/var/www/nextcloud/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/lib/private/AppFramework/Http/Request.php","Line":730,"CustomMessage":"--"}}

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

?php
$CONFIG = array (
  'instanceid' => '***',
  'passwordsalt' => '***',
  'secret' => '***',
  'trusted_domains' => 
  array (
    0 => 'localhost',
    1 => 'domain.com',
    2 => '***.***.com',
    3 => '***.***.com',
  ),
  'datadirectory' => '/var/www/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '27.0.1.2',
  'overwrite.cli.url' => 'https://domain.com/xy',
  'dbname' => '***',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => '***',
  'dbpassword' => '***',
  'installed' => true,
  'htaccess.RewriteBase' => '/nextcloud',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'filelocking.enabled' => true,
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => '/run/redis/redis-server.sock',
    'port' => 0,
    'timeout' => 0.0,
  ),
  'default_locale' => '***',
  'default_phone_region' => '**',
  'maintenance' => false,
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => '***',
  'mail_domain' => '***',
  'mail_smtphost' => '***',
  'mail_smtpport' => '587',
  'mail_smtpauth' => 1,
  'mail_smtpname' => '***',
  'mail_smtppassword' => '****',
  'theme' => '',
  'loglevel' => 2,
);

The output of your Apache/nginx/system log in /var/log/____:
… /apache2/error.log:

[Tue Jul 25 22:28:05.064703 2023] [autoindex:error] [pid 1507] [client 10.143.25.49:47556] AH01276: Cannot serve directory /var/www/nextcloud/: No matching DirectoryIndex (none) found, and server-generated directory index forbidden by Options directive

/var/log/syslog:

no entry with a timestamp nearby

Many thanks for any hint/help!

1 Like

Why rebooting the server?
Just to proceed according to the exclusion principle:

did you run

occ upgrade

while in maintenance mode?

1 Like

Yes. occ upgrade “nothing to do / already actual version”.
also tried occ repair. Nothing to repair resp. no effect.

My point ist not reboot. I want to report the difference in system behaviour after reboot / after restart apache.

Looks like Apache cannot find / access the index.html and / or index.php in your Nextcloud directory. Maybe because it’s not there, has wrong permissions. Or maybe the .htaccess file has missing directives or wrong permissions or is missing completey, or something in your Apache config is wrong…

Can you post the contents of your Nextcloud folder…

ls -al /var/www/nextcloud

…and also the Apache config files with the VirtualHost(s) serving Nextcloud.

Make sure your VirtualHost does contain at least the following directives:

<VirtualHost *:443>
  DocumentRoot /var/www/nextcloud/
  ServerName  your.server.com

  <Directory /var/www/nextcloud/>
    Require all granted
    AllowOverride All
    Options FollowSymLinks MultiViews

    <IfModule mod_dav.c>
      Dav off
    </IfModule>
  </Directory>

[...]

</VirtualHost>

…and that there is a complete .htaccess file in your /var/www/nextcloud directory, that among other things, should contain the following directives:

<IfModule mod_dir.c>
  DirectoryIndex index.php index.html
</IfModule>
1 Like
 total 192
drwxr-xr-x 15 www-data www-data  4096 24. Jul 18:38 .
drwxr-xr-x  4 root     root      4096 24. Jul 19:01 ..
drwxr-xr-x 45 www-data www-data  4096 23. Jul 07:40 3rdparty
drwxr-xr-x 56 www-data www-data  4096 23. Jul 07:41 apps
-rw-r--r--  1 www-data www-data 23796 20. Jul 10:45 AUTHORS
drwxr-xr-x  2 www-data www-data  4096 24. Jul 19:31 config
-rw-r--r--  1 www-data www-data  4095 20. Jul 10:45 console.php
-rw-r--r--  1 www-data www-data 34520 20. Jul 10:45 COPYING
drwxr-xr-x 24 www-data www-data  4096 23. Jul 07:40 core
-rw-r--r--  1 www-data www-data  6317 20. Jul 10:45 cron.php
drwxrwx---  8 www-data www-data  4096 23. Jul 07:39 data
drwxr-xr-x  2 www-data www-data 16384 23. Jul 07:40 dist
-rw-r--r--  1 www-data www-data  4316 24. Jul 18:32 .htaccess
-rw-r--r--  1 www-data www-data   156 20. Jul 10:45 index.html
-rw-r--r--  1 www-data www-data  3456 20. Jul 10:45 index.php
drwxr-xr-x  6 www-data www-data  4096 24. Jul 17:33 lib
 ...

Apache config files:

000-default-le-ssl.conf

IfModule mod_ssl.c>
SSLStaplingCache shmcb:/var/run/apache2/stapling_cache(128000)
<VirtualHost *:443>

        ServerAdmin webmaster@localhost
        DocumentRoot /var/www

         ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

       ServerName my.server.com
       Include /etc/letsencrypt/options-ssl-apache.conf
       ServerAlias my.alias.com
       SSLCertificateFile /etc/letsencrypt/live/my.server.com/fullchain.pem
       SSLCertificateKeyFile /etc/letsencrypt/live/my.server.com/privkey.pem
       Header always set Strict-Transport-Security "max-age=31536000"
       SSLUseStapling on
       Header always set Content-Security-Policy upgrade-insecure-requests

   <Directory /var/www/nextcloud/>
        Options +FollowSymlinks
        AllowOverride All
        Require all granted
          <IfModule mod_dav.c>
            Dav off
          </IfModule>
        SetEnv HOME /var/www/nextcloud
        SetEnv HTTP_HOME /var/www/nextcloud
     </Directory>
 
      Redirect 301 /.well-known/carddav /xy/remote.php/dav
     Redirect 301 /.well-known/caldav /xy/remote.php/dav
     Redirect 301 /.well-known/webfinger /nextcloud/index.php/.well-known/webfinger
      Redirect 301 /.well-known/nodeinfo /nextcloud/index.php/.well-known/nodeinfo

</VirtualHost>
</IfModule>

nextcloud.conf

lias /xy  "/var/www/nextcloud/"

<Directory /var/www/nextcloud/>
  Require all granted
  AllowOverride All
  Options FollowSymLinks MultiViews
  Satisfy Any

  <IfModule mod_dav.c>
    Dav off
  </IfModule>
</Directory>
(END)

/var/www/nextcloud/.htaccess contains above directive

mthx

can you give us a list of installed and activated apps via occ command

… occ app:list

Thanks

sudo -u www-data php occ app:list

Enabled:
  - activity: 2.19.0
  - calendar: 4.4.3
  - circles: 27.0.1
  - cloud_federation_api: 1.10.0
  - comments: 1.17.0
  - contacts: 5.3.2
  - contactsinteraction: 1.8.0
  - dashboard: 7.7.0
  - dav: 1.27.0
  - federatedfilesharing: 1.17.0
  - federation: 1.17.0
  - files: 1.22.0
  - files_pdfviewer: 2.8.0
  - files_rightclick: 1.6.0
  - files_sharing: 1.19.0
  - files_trashbin: 1.17.0
  - files_versions: 1.20.0
  - firstrunwizard: 2.16.0
  - logreader: 2.12.0
  - lookup_server_connector: 1.15.0
  - mail: 3.2.4
  - nextcloud_announcements: 1.16.0
  - notes: 4.8.1
  - notifications: 2.15.0
  - oauth2: 1.15.1
  - password_policy: 1.17.0
  - photos: 2.3.0
  - privacy: 1.11.0
  - provisioning_api: 1.17.0
  - recommendations: 1.6.0
  - related_resources: 1.2.0
  - richdocuments: 8.1.0
  - serverinfo: 1.17.0
  - settings: 1.9.0
  - sharebymail: 1.17.0
  - spreed: 17.0.2
  - support: 1.10.0
  - survey_client: 1.15.0
  - systemtags: 1.17.0
  - text: 3.8.0
  - theming: 2.2.0
  - twofactor_backupcodes: 1.16.0
  - updatenotification: 1.17.0
  - user_status: 1.7.0
  - viewer: 2.1.0
  - weather_status: 1.7.0
  - workflowengine: 2.9.0
Disabled:
  - admin_audit: 1.17.0
  - bruteforcesettings: 2.7.0
  - encryption: 2.15.0
  - files_external: 1.19.0
  - suspicious_login: 5.0.0
  - twofactor_totp: 9.0.0
  - user_ldap: 1.17.0

more detailed log level, snippet from
/var/www/nextcloud/data/nextcloud.log:

{"reqId":"vBRDKRU4I0B8FVYrbATj","level":1,"time":"2023-07-24T17:23:49+00:00",
"remoteAddr":"***.***.***.***","user":"--",
"app":"no app in context",
"method":"GET","url":"/ao/login","message":"Unable to generate a URL for the named route \"theming.Icon.getFavicon\" as such route does not exist.",
"userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/115.0","version":"27.0.1.2","exception":{"Exception":"Symfony\\Component\\Routing\\Exception\\RouteNotFoundException","Message":"Unable to generate a URL for the named route \"theming.Icon.getFavicon\" as such route does not exist.",
"Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":380,
"function":"generate","class":"Symfony\\Component\\Routing\\Generator\\UrlGenerator","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/CachingRouter.php","line"65,
"function":"generate","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/lib/private/URLGenerator.php","line":103,
"function":"generate","class":"OC\\Route\\CachingRouter","type":"->"},{"file":"/var/www/nextcloud/apps/theming/lib/ThemingDefaults.php","line":392,
"function":"linkToRoute","class":"OC\\URLGenerator","type":"->"},{"file":"/var/www/nextcloud/lib/private/URLGenerator.php","line":222,
"function":"replaceImagePath","class":"OCA\\Theming\\ThemingDefaults","type":"->"},{"file":"/var/www/nextcloud/lib/private/legacy/template/functions.php","line"248,
"function":"imagePath","class":"OC\\URLGenerator","type":"->"},{"file":"/var/www/nextcloud/core/templates/layout.guest.php","line":20,
"function":"image_path"},{"file":"/var/www/nextcloud/lib/private/Template/Base.php","line":180,"args":["/var/www/nextcloud/core/templates/layout.guest.php"],
"function":"include"},{"file":"/var/www/nextcloud/lib/private/Template/Base.php","line":150,
"function":"load","class":"OC\\Template\\Base","type":"->"},{"file":"/var/www/nextcloud/lib/private/legacy/OC_Template.php","line":179,
"function":"fetchPage","class":"OC\\Template\\Base","type":"->"},{"file":"/var/www/nextcloud/lib/private/legacy/OC_Template.php","line"210,
"function":"fetchPage","class":"OC_Template","type":"->"},{"file":"/var/www/nextcloud/lib/private/Template/Base.php","line":132,
"function":"fetchPage","class":"OC_Template","type":"->"},{"file":"/var/www/nextcloud/lib/private/legacy/OC_Template.php","line":331,
"function":"printPage","class":"OC\\Template\\Base","type":"->"},{"file":"/var/www/nextcloud/index.php","line"74,
"function":"printExceptionErrorPage","class":"OC_Template","type":"::"}],"File":"/var/www/nextcloud/3rdparty/symfony/routing/Generator/UrlGenerator.php","Line":143,"message":"Unable to generate a URL for the named route \"theming.Icon.getFavicon\" as such route does not exist.","exception":{},"CustomMessage":"Unable to generate a URL for the named route \"theming.Icon.getFavicon\" as such route does not exist."}}

just realized:
if i use URL https://domain.com/nextcloud/ I get login prompt and can login.

However: https://domain.com/nextcloud (without trailing slash) and https://domain.com/xy => “Internal Server Error”.

In Administration - Overview the warnings:
"Your web server is not properly set up to resolve “/.well-known/caldav” and “well-known/carddav” are back… (which I assume is a consequence as the are set for /xy and not /nextcloud/ )

As mentioned: https://domain.com/xy was working perfectly before the upgrade, without warnings in Administration - Overview.
All apps are on actual version, too.