Internal Server Error - Limited information available in logging

Nextcloud version (eg, 20.0.5): 23.0.12
Operating system and version (eg, Ubuntu 20.04): Debian 10 x86_64 Kernel 4.19.0-23-amd64
Apache or nginx version (eg, Apache 2.4.25):

Server version: Apache/2.4.38 (Debian)
Server built:   2023-03-02T14:26:27

PHP version (eg, 7.4):

PHP 7.3.31-1~deb10u3 (cli) (built: Feb 26 2023 13:00:55) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.31, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.31-1~deb10u3, Copyright (c) 1999-2018, by Zend Technologies

The issue you are facing:

Navigating to the front page of my installation produces the following error:

Internal Server Error

The server was unable to complete your request.

If this happens again, please send the technical details below to the server administrator.

More details can be found in the server log.
Technical details

    Remote Address: 172.71.178.157
    Request ID: H5H36M63KJZ4jQkm1E0l

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

Steps to replicate it:

  1. Visit https://nextcloud.squashedfly.eu

The output of your Nextcloud log in Admin > Logging: Unable to log into web interface, however, tail -f data/nextcloud.log:

{
    "reqId": "bNkKmOOC25Pw2eoJzspZ",
    "level": 3,
    "time": "2023-03-03T11:31:54+00:00",
    "remoteAddr": "172.70.86.55",
    "user": "skippy",
    "app": "index",
    "method": "GET",
    "url": "/index.php/apps/dashboard/",
    "message": "syntax error, unexpected 'IInitialState' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in file '/var/www/notquitehere/data/www/nextcloud.squashedfly.eu/apps/files_reader/lib/Listeners/LoadViewerListener.php' line 26",
    "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/109.0",
    "version": "23.0.12.2",
    "exception": {
        "Exception": "Exception",
        "Message": "syntax error, unexpected 'IInitialState' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in file '/var/www/notquitehere/data/www/nextcloud.squashedfly.eu/apps/files_reader/lib/Listeners/LoadViewerListener.php' line 26",
        "Code": 0,
        "Trace": [
            {
                "file": "/var/www/notquitehere/data/www/nextcloud.squashedfly.eu/lib/private/AppFramework/App.php",
                "line": 157,
                "function": "dispatch",
                "class": "OC\\AppFramework\\Http\\Dispatcher",
                "type": "->",
                "args": [
                    {
                        "__class__": "OCA\\Dashboard\\Controller\\DashboardController"
                    },
                    "index"
                ]
            },
            {
                "file": "/var/www/notquitehere/data/www/nextcloud.squashedfly.eu/lib/private/Route/Router.php",
                "line": 302,
                "function": "main",
                "class": "OC\\AppFramework\\App",
                "type": "::",
                "args": [
                    "OCA\\Dashboard\\Controller\\DashboardController",
                    "index",
                    {
                        "__class__": "OC\\AppFramework\\DependencyInjection\\DIContainer"
                    },
                    [
                        "dashboard.dashboard.index"
                    ]
                ]
            },
            {
                "file": "/var/www/notquitehere/data/www/nextcloud.squashedfly.eu/lib/base.php",
                "line": 1015,
                "function": "match",
                "class": "OC\\Route\\Router",
                "type": "->",
                "args": [
                    "/apps/dashboard/"
                ]
            },
            {
                "file": "/var/www/notquitehere/data/www/nextcloud.squashedfly.eu/index.php",
                "line": 36,
                "function": "handleRequest",
                "class": "OC",
                "type": "::",
                "args": []
            }
        ],
        "File": "/var/www/notquitehere/data/www/nextcloud.squashedfly.eu/lib/private/AppFramework/Http/Dispatcher.php",
        "Line": 158,
        "Previous": {
            "Exception": "ParseError",
            "Message": "syntax error, unexpected 'IInitialState' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST)",
            "Code": 0,
            "Trace": [
                {
                    "file": "/var/www/notquitehere/data/www/nextcloud.squashedfly.eu/lib/composer/composer/ClassLoader.php",
                    "line": 428,
                    "function": "Composer\\Autoload\\includeFile",
                    "args": [
                        "/var/www/notquitehere/data/www/nextcloud.squashedfly.eu/apps/files_reader/lib//Listeners/LoadViewerListener.php"
                    ]
                },
                {
                    "function": "loadClass",
                    "class": "Composer\\Autoload\\ClassLoader",
                    "type": "->",
                    "args": [
                        "OCA\\Files_Reader\\Listeners\\LoadViewerListener"
                    ]
                },
                {
                    "function": "spl_autoload_call",
                    "args": [
                        "OCA\\Files_Reader\\Listeners\\LoadViewerListener"
                    ]
                },
                {
                    "file": "/var/www/notquitehere/data/www/nextcloud.squashedfly.eu/lib/private/AppFramework/Utility/SimpleContainer.php",
                    "line": 112,
                    "function": "__construct",
                    "class": "ReflectionClass",
                    "type": "->",
                    "args": [
                        "OCA\\Files_Reader\\Listeners\\LoadViewerListener"
                    ]
                },
                {
                    "file": "/var/www/notquitehere/data/www/nextcloud.squashedfly.eu/lib/private/AppFramework/Utility/SimpleContainer.php",
                    "line": 131,
                    "function": "resolve",
                    "class": "OC\\AppFramework\\Utility\\SimpleContainer",
                    "type": "->",
                    "args": [
                        "OCA\\Files_Reader\\Listeners\\LoadViewerListener"
                    ]
                },
                {
                    "file": "/var/www/notquitehere/data/www/nextcloud.squashedfly.eu/lib/private/AppFramework/DependencyInjection/DIContainer.php",
                    "line": 463,
                    "function": "query",
                    "class": "OC\\AppFramework\\Utility\\SimpleContainer",
                    "type": "->",
                    "args": [
                        "OCA\\Files_Reader\\Listeners\\LoadViewerListener"
                    ]
                },
                {
                    "file": "/var/www/notquitehere/data/www/nextcloud.squashedfly.eu/lib/private/ServerContainer.php",
                    "line": 145,
                    "function": "queryNoFallback",
                    "class": "OC\\AppFramework\\DependencyInjection\\DIContainer",
                    "type": "->",
                    "args": [
                        "OCA\\Files_Reader\\Listeners\\LoadViewerListener"
                    ]
                },
                {
                    "file": "/var/www/notquitehere/data/www/nextcloud.squashedfly.eu/lib/private/EventDispatcher/ServiceEventListener.php",
                    "line": 71,
                    "function": "query",
                    "class": "OC\\ServerContainer",
                    "type": "->",
                    "args": [
                        "OCA\\Files_Reader\\Listeners\\LoadViewerListener"
                    ]
                },
                {
                    "file": "/var/www/notquitehere/data/www/nextcloud.squashedfly.eu/3rdparty/symfony/event-dispatcher/EventDispatcher.php",
                    "line": 251,
                    "function": "__invoke",
                    "class": "OC\\EventDispatcher\\ServiceEventListener",
                    "type": "->",
                    "args": [
                        {
                            "__class__": "OCA\\Viewer\\Event\\LoadViewer"
                        },
                        "OCA\\Viewer\\Event\\LoadViewer",
                        {
                            "__class__": "Symfony\\Component\\EventDispatcher\\EventDispatcher"
                        }
                    ]
                },
                {
                    "file": "/var/www/notquitehere/data/www/nextcloud.squashedfly.eu/3rdparty/symfony/event-dispatcher/EventDispatcher.php",
                    "line": 73,
                    "function": "callListeners",
                    "class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
                    "type": "->",
                    "args": [
                        [
                            {
                                "__class__": "Closure"
                            },
                            {
                                "__class__": "Closure"
                            },
                            {
                                "__class__": "Closure"
                            },
                            {
                                "__class__": "Closure"
                            },
                            {
                                "__class__": "Closure"
                            }
                        ],
                        "OCA\\Viewer\\Event\\LoadViewer",
                        {
                            "__class__": "OCA\\Viewer\\Event\\LoadViewer"
                        }
                    ]
                },
                {
                    "file": "/var/www/notquitehere/data/www/nextcloud.squashedfly.eu/lib/private/EventDispatcher/EventDispatcher.php",
                    "line": 88,
                    "function": "dispatch",
                    "class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
                    "type": "->",
                    "args": [
                        {
                            "__class__": "OCA\\Viewer\\Event\\LoadViewer"
                        },
                        "OCA\\Viewer\\Event\\LoadViewer"
                    ]
                },
                {
                    "file": "/var/www/notquitehere/data/www/nextcloud.squashedfly.eu/lib/private/EventDispatcher/EventDispatcher.php",
                    "line": 100,
                    "function": "dispatch",
                    "class": "OC\\EventDispatcher\\EventDispatcher",
                    "type": "->",
                    "args": [
                        "OCA\\Viewer\\Event\\LoadViewer",
                        {
                            "__class__": "OCA\\Viewer\\Event\\LoadViewer"
                        }
                    ]
                },
                {
                    "file": "/var/www/notquitehere/data/www/nextcloud.squashedfly.eu/apps/dashboard/lib/Controller/DashboardController.php",
                    "line": 99,
                    "function": "dispatchTyped",
                    "class": "OC\\EventDispatcher\\EventDispatcher",
                    "type": "->",
                    "args": [
                        {
                            "__class__": "OCA\\Viewer\\Event\\LoadViewer"
                        }
                    ]
                },
                {
                    "file": "/var/www/notquitehere/data/www/nextcloud.squashedfly.eu/lib/private/AppFramework/Http/Dispatcher.php",
                    "line": 217,
                    "function": "index",
                    "class": "OCA\\Dashboard\\Controller\\DashboardController",
                    "type": "->",
                    "args": []
                },
                {
                    "file": "/var/www/notquitehere/data/www/nextcloud.squashedfly.eu/lib/private/AppFramework/Http/Dispatcher.php",
                    "line": 126,
                    "function": "executeController",
                    "class": "OC\\AppFramework\\Http\\Dispatcher",
                    "type": "->",
                    "args": [
                        {
                            "__class__": "OCA\\Dashboard\\Controller\\DashboardController"
                        },
                        "index"
                    ]
                },
                {
                    "file": "/var/www/notquitehere/data/www/nextcloud.squashedfly.eu/lib/private/AppFramework/App.php",
                    "line": 157,
                    "function": "dispatch",
                    "class": "OC\\AppFramework\\Http\\Dispatcher",
                    "type": "->",
                    "args": [
                        {
                            "__class__": "OCA\\Dashboard\\Controller\\DashboardController"
                        },
                        "index"
                    ]
                },
                {
                    "file": "/var/www/notquitehere/data/www/nextcloud.squashedfly.eu/lib/private/Route/Router.php",
                    "line": 302,
                    "function": "main",
                    "class": "OC\\AppFramework\\App",
                    "type": "::",
                    "args": [
                        "OCA\\Dashboard\\Controller\\DashboardController",
                        "index",
                        {
                            "__class__": "OC\\AppFramework\\DependencyInjection\\DIContainer"
                        },
                        [
                            "dashboard.dashboard.index"
                        ]
                    ]
                },
                {
                    "file": "/var/www/notquitehere/data/www/nextcloud.squashedfly.eu/lib/base.php",
                    "line": 1015,
                    "function": "match",
                    "class": "OC\\Route\\Router",
                    "type": "->",
                    "args": [
                        "/apps/dashboard/"
                    ]
                },
                {
                    "file": "/var/www/notquitehere/data/www/nextcloud.squashedfly.eu/index.php",
                    "line": 36,
                    "function": "handleRequest",
                    "class": "OC",
                    "type": "::",
                    "args": []
                }
            ],
            "File": "/var/www/notquitehere/data/www/nextcloud.squashedfly.eu/apps/files_reader/lib/Listeners/LoadViewerListener.php",
            "Line": 26
        },
        "CustomMessage": "--"
    }
}

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

<?php
$CONFIG = array (
  'instanceid' => 'redacted',
  'passwordsalt' => 'redacted',
  'secret' => 'redacted',
  'trusted_domains' =>
  array (
    0 => 'nextcloud.squashedfly.eu',
  ),
  'datadirectory' => '/var/www/notquitehere/data/www/nextcloud.squashedfly.eu/data',
  'overwrite.cli.url' => 'https://nextcloud.squashedfly.eu',
  'dbtype' => 'mysql',
  'version' => '23.0.12.2',
  'dbname' => 'redacted',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'redacted',
  'dbpassword' => 'redacted',
  'installed' => true,
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 0,
  'mail_from_address' => 'hello',
  'mail_smtpmode' => 'smtp',
  'mail_domain' => 'squashedfly.eu',
  'filelocking.enabled' => 'true',
  'mail_smtphost' => 'localhost',
  'mail_smtpauth' => 1,
  'mail_smtpname' => 'redacted',
  'mail_smtppassword' => 'redacted',
  'updater.release.channel' => 'stable',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.distributed' => '\\OC\\Memcache\\Memcached',
  'memcached_servers' =>
  array (
    0 =>
    array (
      0 => 'localhost',
      1 => 11211,
    ),
  ),
  'mysql.utf8mb4' => true,
  'mail_sendmailmode' => 'smtp',
);

Preceding this, it was working until I attempted to install the memories plugin (GitHub - pulsejet/memories: Fast, modern and advanced photo management suite. Runs as a Nextcloud app.) through the app store, however, it failed, and I thought nothing more of it.

Things I have tried:

  1. Updating Debian, and installed packages
  2. Restarting Apache
  3. Restarting the server
  4. Running the updater php updater/updater.phar
  5. removing the plugin folder rm -r apps/memories/
  6. ./occ update:check
  7. ./occ maintenance:repair
  8. /.occ db:add-missing-columns
  9. ./occ db:add-missing-indices
  10. ./occ maintenance:update:htaccess
  11. ./occ maintenance:mode --off

If any one has any ideas that would be apprecated.

Further to my last message,

I have removed all the plugins I had manually installed:

./occ app:remove bruteforcesettings
./occ app:remove camerarawpreviews
./occ app:remove previewgenerator
./occ app:remove drawio
./occ app:remove duplicatefinder
./occ app:remove external
./occ app:remove imageconverter
./occ app:remove impersonate
./occ app:remove integration_openproject
./occ app:remove quota_warning
./occ app:remove diary
./occ app:remove facerecognition

I have run an integrity check on all installed core plugins:

./occ integrity:check-app accessibility
./occ integrity:check-app activity
./occ integrity:check-app cloud_federation_api
./occ integrity:check-app contactsinteraction
./occ integrity:check-app dashboard
./occ integrity:check-app dav
./occ integrity:check-app federatedfilesharing
./occ integrity:check-app federation
./occ integrity:check-app files
./occ integrity:check-app files_pdfviewer
./occ integrity:check-app files_reader
./occ integrity:check-app files_rightclick
./occ integrity:check-app files_sharing
./occ integrity:check-app files_trashbin
./occ integrity:check-app files_versions
./occ integrity:check-app files_videoplayer
./occ integrity:check-app logreader
./occ integrity:check-app lookup_server_connector
./occ integrity:check-app notifications
./occ integrity:check-app oauth2
./occ integrity:check-app password_policy
./occ integrity:check-app photos
./occ integrity:check-app privacy
./occ integrity:check-app provisioning_api
./occ integrity:check-app recommendations
./occ integrity:check-app serverinfo
./occ integrity:check-app settings
./occ integrity:check-app sharebymail
./occ integrity:check-app survey_client
./occ integrity:check-app text
./occ integrity:check-app theming
./occ integrity:check-app twofactor_backupcodes
./occ integrity:check-app updatenotification
./occ integrity:check-app user_status
./occ integrity:check-app viewer
./occ integrity:check-app weather_status
./occ integrity:check-app workflowengine

Including those core plugins that are installed but not enabled

./occ integrity:check-app admin_audit
./occ integrity:check-app circles
./occ integrity:check-app comments
./occ integrity:check-app encryption
./occ integrity:check-app files_external
./occ integrity:check-app firstrunwizard
./occ integrity:check-app nextcloud_announcements
./occ integrity:check-app support
./occ integrity:check-app systemtags
./occ integrity:check-app user_ldap

As an aside could we have an integrity checking of all apps rather than doing them one at a time?

Going to the web-front end (https://nextcloud.squashedfly.eu/) still brings up an “Internal Server Error” but I can still interact with nextcloud via the client. (syncing files is still happening).

Running the command ./occ maintenance:repair returns the following error:

An unhandled exception has been thrown:
TypeError: Argument 1 passed to OCA\Files_Reader\Hooks::OCA\Files_Reader\{closure}() must be an instance of OCA\Files_Reader\Node, instance of OC\Files\Node\File given in /var/www/notquitehere/data/www/nextcloud.squashedfly.eu/apps/files_reader/lib/Hooks.php:18
Stack trace:
#0 [internal function]: OCA\Files_Reader\Hooks::OCA\Files_Reader\{closure}(Object(OC\Files\Node\File))
#1 /var/www/notquitehere/data/www/nextcloud.squashedfly.eu/lib/private/Hooks/EmitterTrait.php(106): call_user_func_array(Object(Closure), Array)
#2 /var/www/notquitehere/data/www/nextcloud.squashedfly.eu/lib/private/Hooks/PublicEmitter.php(40): OC\Hooks\BasicEmitter->emit('\\OC\\Files', 'preDelete', Array)
#3 /var/www/notquitehere/data/www/nextcloud.squashedfly.eu/lib/private/Files/Node/Root.php(138): OC\Hooks\PublicEmitter->emit('\\OC\\Files', 'preDelete', Array)
#4 /var/www/notquitehere/data/www/nextcloud.squashedfly.eu/lib/private/Files/Node/Node.php(116): OC\Files\Node\Root->emit('\\OC\\Files', 'preDelete', Array)
#5 /var/www/notquitehere/data/www/nextcloud.squashedfly.eu/lib/private/Files/Node/File.php(129): OC\Files\Node\Node->sendHooks(Array)
#6 /var/www/notquitehere/data/www/nextcloud.squashedfly.eu/lib/private/Files/SimpleFS/SimpleFile.php(149): OC\Files\Node\File->delete()
#7 /var/www/notquitehere/data/www/nextcloud.squashedfly.eu/lib/private/Template/SCSSCacher.php(397): OC\Files\SimpleFS\SimpleFile->delete()
#8 /var/www/notquitehere/data/www/nextcloud.squashedfly.eu/lib/private/Repair/ClearFrontendCaches.php(62): OC\Template\SCSSCacher->resetCache()
#9 /var/www/notquitehere/data/www/nextcloud.squashedfly.eu/lib/private/Repair.php(125): OC\Repair\ClearFrontendCaches->run(Object(OC\Repair))
#10 /var/www/notquitehere/data/www/nextcloud.squashedfly.eu/core/Command/Maintenance/Repair.php(125): OC\Repair->run()
#11 /var/www/notquitehere/data/www/nextcloud.squashedfly.eu/3rdparty/symfony/console/Command/Command.php(255): OC\Core\Command\Maintenance\Repair->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 /var/www/notquitehere/data/www/nextcloud.squashedfly.eu/3rdparty/symfony/console/Application.php(1009): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 /var/www/notquitehere/data/www/nextcloud.squashedfly.eu/3rdparty/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand(Object(OC\Core\Command\Maintenance\Repair), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 /var/www/notquitehere/data/www/nextcloud.squashedfly.eu/3rdparty/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 /var/www/notquitehere/data/www/nextcloud.squashedfly.eu/lib/private/Console/Application.php(211): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 /var/www/notquitehere/data/www/nextcloud.squashedfly.eu/console.php(100): OC\Console\Application->run()
#17 /var/www/notquitehere/data/www/nextcloud.squashedfly.eu/occ(11): require_once('/var/www/notqui...')
#18 {main}

Since I have removed all user-installed apps as part of the diagnostic process, I feel that I have exhausted the advice in Downloaded app on nextcloud server causing me to be stuck at blue and white error screen. No more access to nextcloud in the web interface. How do I identify and uninstall offending app From the command line? - #3 by Danran

Hi, are you sure you disabled this app?

I thought that was one of the core apps, thank you for spotting that ./occ app:disable files_reader has given me access to the web front end.

That worked, thank you for spotting it.

Is this a known issue?

I think so: https://github.com/Yetangitu/files_reader/issues/1