Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Upgrade from 24.0.3 to 24.0.4 failed #33520

Closed
6 of 9 tasks
alfwro13 opened this issue Aug 12, 2022 · 9 comments
Closed
6 of 9 tasks

[Bug]: Upgrade from 24.0.3 to 24.0.4 failed #33520

alfwro13 opened this issue Aug 12, 2022 · 9 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug

Comments

@alfwro13
Copy link

⚠️ This issue respects the following points: ⚠️

  • This is a bug, not a question or a configuration/webserver/proxy issue.
  • This issue is not already reported on Github (I've searched it).
  • Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
  • Nextcloud Server is running on 64bit capable CPU, PHP and OS.
  • I agree to follow Nextcloud's Code of Conduct.

Bug description

root# sudo -u u1005 php8.0 /installation/path/occ upgrade
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
Setting log level to debug
Updating database schema
Updated database
An unhandled exception has been thrown:
TypeError: OC\EventDispatcher\ServiceEventListener::__invoke(): Argument #1 ($event) must be of type OCP\EventDispatcher\Event, OC\EventDispatcher\GenericEventWrapper given, called in /installation/path/3rdparty/symfony/event-dispatcher/EventDispatcher.php on line 264 and defined in /installation/path/lib/private/EventDispatcher/ServiceEventListener.php:65
Stack trace:
#0 /installation/path/3rdparty/symfony/event-dispatcher/EventDispatcher.php(264): OC\EventDispatcher\ServiceEventListener->__invoke()
#1 /installation/path/3rdparty/symfony/event-dispatcher/EventDispatcher.php(239): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch()
#2 /installation/path/3rdparty/symfony/event-dispatcher/EventDispatcher.php(73): Symfony\Component\EventDispatcher\EventDispatcher->callListeners()
#3 /installation/path/lib/private/EventDispatcher/SymfonyAdapter.php(122): Symfony\Component\EventDispatcher\EventDispatcher->dispatch()
#4 /installation/path/lib/private/Files/Node/Node.php(118): OC\EventDispatcher\SymfonyAdapter->dispatch()
#5 /installation/path/lib/private/Files/Node/File.php(133): OC\Files\Node\Node->sendHooks()
#6 /installation/path/lib/private/Files/SimpleFS/SimpleFile.php(149): OC\Files\Node\File->delete()
#7 /installation/path/lib/private/Template/SCSSCacher.php(386): OC\Files\SimpleFS\SimpleFile->delete()
#8 /installation/path/lib/private/Repair/ClearFrontendCaches.php(62): OC\Template\SCSSCacher->resetCache()
#9 /installation/path/lib/private/Repair.php(124): OC\Repair\ClearFrontendCaches->run()
#10 /installation/path/lib/private/Updater.php(293): OC\Repair->run()
#11 /installation/path/lib/private/Updater.php(133): OC\Updater->doUpgrade()
#12 /installation/path/core/Command/Upgrade.php(235): OC\Updater->upgrade()
#13 /installation/path/3rdparty/symfony/console/Command/Command.php(255): OC\Core\Command\Upgrade->execute()
#14 /installation/path/3rdparty/symfony/console/Application.php(1009): Symfony\Component\Console\Command\Command->run()
#15 /installation/path/3rdparty/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand()
#16 /installation/path/3rdparty/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun()
#17 /installation/path/lib/private/Console/Application.php(211): Symfony\Component\Console\Application->run()
#18 /installation/path/console.php(100): OC\Console\Application->run()
#19 /installation/path/occ(11): require_once('/home/clients_s...')

Steps to reproduce

1.root# sudo -u u1005 php8.0 /installation/path/occ upgrade
2.
3.

Expected behavior

should upgrade to 24.0.4 version

Installation method

Manual installation

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.0

Web server

Nginx

Database engine version

MariaDB

Is this bug present after an update or on a fresh install?

Updated from a minor version (ex. 22.2.3 to 22.2.4)

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "blacklisted_files": [
            ".htaccess",
            "Thumbs.db",
            "thumbs.db"
        ],
        "logfile": "\/var\/log\/nextcloud\/nextcloud.log",
        "log_rotate_size": 104857600,
        "loglevel": 0,
        "trusted_domains": [
            "REMOVED",
            "REMOVED",
            "REMOVED"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "24.0.3.2",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "forcessl": true,
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "smtp",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "theme": "",
        "maintenance": true,
        "defaultapp": "files",
        "appcodechecker": true,
        "secret": "***REMOVED SENSITIVE VALUE***",
        "xframe_restriction": false,
        "mail_smtpauthtype": "LOGIN",
        "mail_smtpauth": 1,
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "custom_csp_policy": "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; frame-src *; img-src *; font-src 'self' data:; media-src *",
        "forceSSLforSubdomains": true,
        "filelocking.enabled": "true",
        "appstore.experimental.enabled": true,
        "enable_previews": true,
        "enabledPreviewProviders": [
            "OC\\Preview\\PNG",
            "OC\\Preview\\JPEG",
            "OC\\Preview\\GIF",
            "OC\\Preview\\BMP",
            "OC\\Preview\\XBitmap",
            "OC\\Preview\\Movie",
            "OC\\Preview\\PDF",
            "OC\\Preview\\MP3",
            "OC\\Preview\\TXT",
            "OC\\Preview\\MarkDown"
        ],
        "trashbin_retention_obligation": "auto",
        "0": 30,
        "asset-pipeline.enabled": false,
        "versions_retention_obligation": "auto, 120",
        "updater.release.channel": "stable",
        "auth.bruteforce.protection.enabled": true,
        "appstoreenabled": true,
        "overwrite.cli.url": "https:\/\/oc.awroblew.biz",
        "mysql.utf8mb4": true,
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "memcache.local": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "activity_expire_days": 90,
        "twofactor_enforced": "false",
        "twofactor_enforced_groups": [],
        "twofactor_enforced_excluded_groups": [],
        "app_install_overwrite": [
            "calendar",
            "apporder",
            "mail",
            "dashboardcharts",
            "ocsms"
        ],
        "mail_sendmailmode": "smtp",
        "mail_smtpsecure": "ssl",
        "default_phone_region": "GB",
        "updater.secret": "***REMOVED SENSITIVE VALUE***"
    }
}

List of activated Apps

Enabled:
  - activity: 2.16.0
  - admin_audit: 1.14.0
  - apporder: 0.15.0
  - calendar: 3.4.2
  - circles: 24.0.1
  - cloud_federation_api: 1.7.0
  - contacts: 4.2.0
  - contactsinteraction: 1.5.0
  - cookbook: 0.9.13
  - dav: 1.22.0
  - federatedfilesharing: 1.14.0
  - files: 1.19.0
  - files_downloadactivity: 1.13.0
  - files_external: 1.16.1
  - files_markdown: 2.3.6
  - files_pdfviewer: 2.5.0
  - files_rightclick: 1.3.0
  - files_sharing: 1.16.2
  - files_trashbin: 1.14.0
  - files_versions: 1.17.0
  - files_videoplayer: 1.13.0
  - groupfolders: 12.0.1
  - logreader: 2.9.0
  - lookup_server_connector: 1.12.0
  - maps: 0.2.0
  - mediadc: 0.1.9
  - news: 18.1.0
  - notes: 4.4.0
  - notifications: 2.12.0
  - oauth2: 1.12.0
  - password_policy: 1.14.0
  - photos: 1.6.0
  - privacy: 1.8.0
  - provisioning_api: 1.14.0
  - qownnotesapi: 22.5.0
  - recognize: 2.2.0
  - serverinfo: 1.14.0
  - settings: 1.6.0
  - sharebymail: 1.14.0
  - systemtags: 1.14.0
  - tasks: 0.14.4
  - text: 3.5.1
  - theming: 1.15.0
  - twofactor_backupcodes: 1.13.0
  - twofactor_totp: 6.4.0
  - updatenotification: 1.14.0
  - video_converter: 1.0.5
  - viewer: 1.8.0
  - workflowengine: 2.6.0
Disabled:
  - accessibility: 1.0.1
  - analytics: 4.3.1
  - bruteforcesettings: 2.4.0
  - checksum: 1.1.4
  - comments: 1.2.0
  - dashboard: 7.2.0
  - encryption
  - event_update_notification: 1.5.0
  - federation: 1.0.1
  - firstrunwizard: 1.1
  - gpxedit: 0.0.14
  - gpxpod: 4.3.0
  - impersonate: 1.11.0
  - mail: 1.13.8
  - nextcloud_announcements: 1.1
  - ocsms: 2.2.0
  - ransomware_protection: 1.13.0
  - recommendations: 1.0.0
  - support: 1.0.0
  - survey_client: 0.1.5
  - user_ldap
  - user_status: 1.1.1
  - weather_status: 1.2.0
  - workflow_media_converter: 1.4.0

Nextcloud Signing status

unable to do that as my NC is in maintenance mode

Nextcloud Logs

No response

Additional info

No response

@alfwro13 alfwro13 added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Aug 12, 2022
@linuxrrze
Copy link

Same here:
However update was triggered via web.

Environment:
Update from 24.0.3 to 24.0.4
Ubuntu 20.04
Apache: 2.4.41
php-fpm: 7.4.3

Lateron log reports:

    "File": "/web/apps/nextcloud/nextcloud/3rdparty/symfony/routing/Generator/UrlGenerator.php",
    "Line": 143,
    "message": "Unable to generate a URL for the named route \"files.view.index\" as such route does not exist.",
    "exception": {},
    "CustomMessage": "Unable to generate a URL for the named route \"files.view.index\" as such route does not exist."

Tried to disable several apps that complained.
However now I'm stuck with "files" which cannot be disabled ...

@linuxrrze
Copy link

Trying to run "occ maintenance:repair" results in:

Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
 - Repair MySQL collation
     - Not a mysql database -> nothing to do
 - Repair mime types
 - 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.
 - Fix potential broken mount points
     - No mounts updated
 - Repair language codes
 - Install new core bundle components
 - Add log rotate job
 - Clear frontend caches
     - Image cache cleared
An unhandled exception has been thrown:
TypeError: Argument 1 passed to OC\EventDispatcher\ServiceEventListener::__invoke() must be an instance of OCP\EventDispatcher\Event, instance of OC\EventDispatcher\GenericEventWrapper given, called in /web/apps/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php on line 264 and defined in /web/apps/nextcloud/lib/private/EventDispatcher/ServiceEventListener.php:65
Stack trace:
#0 /web/apps/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php(264): OC\EventDispatcher\ServiceEventListener->__invoke()
#1 /web/apps/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php(239): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch()
#2 /web/apps/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php(73): Symfony\Component\EventDispatcher\EventDispatcher->callListeners()
#3 /web/apps/nextcloud/lib/private/EventDispatcher/SymfonyAdapter.php(122): Symfony\Component\EventDispatcher\EventDispatcher->dispatch()
#4 /web/apps/nextcloud/lib/private/Files/Node/Node.php(118): OC\EventDispatcher\SymfonyAdapter->dispatch()
#5 /web/apps/nextcloud/lib/private/Files/Node/File.php(133): OC\Files\Node\Node->sendHooks() 
#6 /web/apps/nextcloud/lib/private/Files/SimpleFS/SimpleFile.php(149): OC\Files\Node\File->delete()  
#7 /web/apps/nextcloud/lib/private/Template/SCSSCacher.php(386): OC\Files\SimpleFS\SimpleFile->delete()  
#8 /web/apps/nextcloud/lib/private/Repair/ClearFrontendCaches.php(62): OC\Template\SCSSCacher->resetCache()
#9 /web/apps/nextcloud/lib/private/Repair.php(124): OC\Repair\ClearFrontendCaches->run()
#10 /web/apps/nextcloud/core/Command/Maintenance/Repair.php(125): OC\Repair->run()
#11 /web/apps/nextcloud/3rdparty/symfony/console/Command/Command.php(255): OC\Core\Command\Maintenance\Repair->execute()
#12 /web/apps/nextcloud/3rdparty/symfony/console/Application.php(1009): Symfony\Component\Console\Command\Command->run()  
#13 /web/apps/nextcloud/3rdparty/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand()
#14 /web/apps/nextcloud/3rdparty/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun()
#15 /web/apps/nextcloud/lib/private/Console/Application.php(211): Symfony\Component\Console\Application->run()
#16 /web/apps/nextcloud/console.php(100): OC\Console\Application->run()
#17 /web/apps/nextcloud/occ(11): require_once('/web...')

Next step (tested on a system where update to 24.0.4 worked) should be:

SCSS cache cleared

Maybe this helps to narrow things down?

@linuxrrze
Copy link

Commented few lines in ./lib/private/Repair/ClearFrontendCaches.php and reran "occ maintenance:repair" (this time without errors) and nextcloud is up and running again:

        public function run(IOutput $output) {
                try {   
                        $c = $this->cacheFactory->createDistributed('imagePath');
                        # disabled:
                        #$c->clear();
                        $output->info('Image cache cleared');

                        # Disabled:
                        #$this->scssCacher->resetCache();
                        $output->info('SCSS cache cleared');

                        # Disabled:
                        #$this->jsCombiner->resetCache();
                        $output->info('JS cache cleared');
                } catch (\Exception $e) {
                        $output->warning('Unable to clear the frontend cache');
                }
        }

But maybe this has other consequences...

@Popkornium18
Copy link

Popkornium18 commented Aug 12, 2022

Having the same issue. My setup is pretty much the same as @alfwro13, but I use Apache.
Also thanks @linuxrrze for the workaround.

I got a similar exception when I tried to update the apps via occ before I tried to update Nextcloud. Though it didn't crash when I tried it again. Maybe this isn't an issue with the upgrade but with the PHP setup?

@StarSmasher44
Copy link

Same issue, unfortunately the web-based updater gives 0 information except "an error has ocurred" and the logs were empty..

How did this get through testing if already so many are having issues?

@tacruc
Copy link
Contributor

tacruc commented Aug 12, 2022

I ran into the same Issue. Found the following in the log, which sounds related. It Complains that \\OCP\\Files::postDelete is deprecated and GenericEvent is used

{"reqId":"yLevA1KOrBnJhREtgwIb","level":1,"time":"2022-08-12T18:35:11+02:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Repair::info: Repair info: Image cache cleared","userAgent":"--","version":"24.0.3.2","data":{"app":"updater"}}
{"reqId":"yLevA1KOrBnJhREtgwIb","level":0,"time":"2022-08-12T18:35:11+02:00","remoteAddr":"","user":"--","app":"scss_cacher","method":"","url":"--","message":"SCSSCacher::resetCache","userAgent":"--","version":"24.0.3.2","data":{"app":"scss_cacher"}}
{"reqId":"yLevA1KOrBnJhREtgwIb","level":0,"time":"2022-08-12T18:35:11+02:00","remoteAddr":"","user":"--","app":"scss_cacher","method":"","url":"--","message":"SCSSCacher::resetCache Lock acquired","userAgent":"--","version":"24.0.3.2","data":{"app":"scss_cacher"}}
{"reqId":"yLevA1KOrBnJhREtgwIb","level":1,"time":"2022-08-12T18:35:11+02:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Deprecated event type for \\OCP\\Files::postDelete: Symfony\\Component\\EventDispatcher\\GenericEvent is used","userAgent":"--","version":"24.0.3.2","data":[]}

@tacruc
Copy link
Contributor

tacruc commented Aug 12, 2022

After further research I could pin the error to
./recognize/lib/AppInfo/Application.php:27: $dispatcher->addServiceListener('\OCP\Files::postDelete', FileListener::class);

Then Looking into the repository there is already an Issue:
nextcloud/recognize#279

@BSoDium
Copy link

BSoDium commented Aug 19, 2022

Commented few lines in ./lib/private/Repair/ClearFrontendCaches.php and reran "occ maintenance:repair" (this time without errors) and nextcloud is up and running again:

        public function run(IOutput $output) {
                try {   
                        $c = $this->cacheFactory->createDistributed('imagePath');
                        # disabled:
                        #$c->clear();
                        $output->info('Image cache cleared');

                        # Disabled:
                        #$this->scssCacher->resetCache();
                        $output->info('SCSS cache cleared');

                        # Disabled:
                        #$this->jsCombiner->resetCache();
                        $output->info('JS cache cleared');
                } catch (\Exception $e) {
                        $output->warning('Unable to clear the frontend cache');
                }
        }

But maybe this has other consequences...

Definitely not a long term solution but I can confirm that it did work for me. Will be reinstalling everything from scratch asap, these internal server errors I was getting before the update do not bode well.

@Extarys
Copy link

Extarys commented Sep 2, 2022

I had a similar problem from upgrading the docker image from 24.0.3 to 24.0.4 and stumbled upon this. So I'll leave this there if other users encounter a 500 error after upgrading the docker image.
In my case, I "simply" had to ssh into the docker container as user 33 and:

./occ maintenance:repair
./occ upgrade

I didn't have to edit any files. Now my install is back online.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug
Projects
None yet
Development

No branches or pull requests

7 participants