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]: During upgrade from 24.0.2 to 24.0.3: Return type of RecursiveDirectoryIteratorWithoutData::accept() should either be compatible with FilterIterator::accept(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in updater/index.php on line 40 #33295

Closed
7 of 9 tasks
VVD opened this issue Jul 20, 2022 · 5 comments · Fixed by nextcloud/updater#429
Assignees
Labels
Milestone

Comments

@VVD
Copy link

VVD commented Jul 20, 2022

⚠️ 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

During upgrade from 24.0.2 to 24.0.3 via web I got error:

<b>Deprecated</b>:  Return type of RecursiveDirectoryIteratorWithoutData::accept() should either be compatible with FilterIterator::accept(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in <b>/opt/nextcloud/updater/index.php</b> on line <b>40</b><br />
{"proceed":true}

It's PHP 8.1 specific bug.
On other host with PHP 7.4 update from 24.0.2 to 24.0.3 was without errors.

Steps to reproduce

  1. Update 24.0.2 to 24.0.3 via web

Expected behavior

Update without errors.

Installation method

Manual installation

Operating system

Other

PHP engine version

PHP 8.1

Web server

Apache (supported)

Database engine version

PostgreSQL

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

No response

Are you using the Nextcloud Server Encryption module?

No response

What user-backends are you using?

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

Configuration report

{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "host1",
            "host2",
            "host3",
            "host4",
            "host5"
        ],
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "overwrite.cli.url": "https:\/\/host1",
        "overwriteprotocol": "https",
        "overwritecondaddr": "^(IP1|IP2)$",
        "dbtype": "pgsql",
        "version": "24.0.3.2",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "default_language": "ru",
        "default_locale": "ru_RU",
        "default_phone_region": "RU",
        "user_backends": [
            {
                "class": "\\OCA\\UserExternal\\IMAP",
                "arguments": [
                    "mailserver",
                    143,
                    null,
                    null,
                    false,
                    false
                ]
            }
        ],
        "apps_paths": [
            {
                "path": "\/opt\/nextcloud\/apps",
                "url": "\/apps",
                "writable": true
            }
        ],
        "mail_smtpmode": "smtp",
        "mail_smtpauthtype": "PLAIN",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauth": 1,
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "25",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpsecure": "tls",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "maintenance": false,
        "logfile": "\/opt\/log\/nextcloud.log",
        "trashbin_retention_obligation": "auto",
        "updater.release.channel": "stable",
        "ldapIgnoreNamingRules": false,
        "ldapProviderFactory": "\\OCA\\User_LDAP\\LDAPProviderFactory",
        "theme": "",
        "loglevel": 1,
        "app_install_overwrite": [
            "theming_customcss"
        ],
        "updater.secret": "***REMOVED SENSITIVE VALUE***"
    }
}

List of activated Apps

Enabled:
  - accessibility: 1.10.0
  - activity: 2.16.0
  - bruteforcesettings: 2.4.0
  - calendar: 3.4.2
  - cloud_federation_api: 1.7.0
  - comments: 1.14.0
  - contacts: 4.2.0
  - contactsinteraction: 1.5.0
  - dav: 1.22.0
  - drawio: 1.0.3
  - external: 4.0.0
  - federatedfilesharing: 1.14.0
  - federation: 1.14.0
  - files: 1.19.0
  - files_pdfviewer: 2.5.0
  - files_sharing: 1.16.2
  - files_trashbin: 1.14.0
  - files_versions: 1.17.0
  - files_videoplayer: 1.13.0
  - firstrunwizard: 2.13.0
  - groupfolders: 12.0.1
  - logreader: 2.9.0
  - lookup_server_connector: 1.12.0
  - mail: 1.13.6
  - nextcloud_announcements: 1.13.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
  - recommendations: 1.3.0
  - serverinfo: 1.14.0
  - settings: 1.6.0
  - sharebymail: 1.14.0
  - spreed: 14.0.3
  - support: 1.7.0
  - survey_client: 1.12.0
  - systemtags: 1.14.0
  - text: 3.5.1
  - theming: 1.15.0
  - theming_customcss: 1.11.0
  - twofactor_backupcodes: 1.13.0
  - updatenotification: 1.14.0
  - user_external: 3.0.0
  - user_ldap: 1.14.1
  - user_status: 1.4.0
  - viewer: 1.8.0
  - weather_status: 1.4.0
  - workflowengine: 2.6.0
Disabled:
  - admin_audit
  - announcementcenter: 6.3.1
  - circles: 0.21.4
  - dashboard: 7.0.0
  - dropit: 0.4.0
  - encryption
  - files_accesscontrol: 1.14.0
  - files_downloadactivity: 1.13.0
  - files_external
  - files_frommail: 0.4.0
  - files_rightclick: 0.15.1
  - unsplash: 1.2.5

Nextcloud Signing status

Technical information
=====================
The following list covers which files have failed the integrity check. Please read
the previous linked documentation to learn more about the errors and how to fix
them.

Results
=======
- user_external
	- INVALID_HASH
		- lib/Base.php

Raw output
==========
Array
(
    [user_external] => Array
        (
            [INVALID_HASH] => Array
                (
                    [lib/Base.php] => Array
                        (
                            [expected] => 72fb649b4a31f8001252647609d32bf37e563e90b9dbe23ea0a00a03523a58023d345e613ea8b98712f35efdcacf951b91a82756e6d8ef6bc91072e3a5c9b629
                            [current] => a71980d1adf58ced91c8bf1b555050be6bafe253af206fe85d38e12b7d36bbbd966fd7f88c28dc34cb630a4d455a65e6cf8e0c83490e7c56e5af26df742fc593
                        )

                )

        )

)

This is my other patch for support PHP 8.1 (nextcloud/user_external#203):

--- apps/user_external/lib/Base.php.git
+++ apps/user_external/lib/Base.php
@@ -66,7 +66,7 @@
                $user = $result->fetch();
                $result->closeCursor();
 
-               $displayName = trim($user['displayname'], ' ');
+               $displayName = trim($user['displayname'] ?? '', ' ');
                if (!empty($displayName)) {
                        return $displayName;
                } else {

Nextcloud Logs

Can't find this error in logs.

Additional info

Patch:

--- updater/index.php.orig
+++ updater/index.php
@@ -37,7 +37,7 @@
 }
 
 class RecursiveDirectoryIteratorWithoutData extends \RecursiveFilterIterator {
-       public function accept() {
+       public function accept(): bool {
                /** @var \DirectoryIterator $this */
                $excludes = [
                        '.rnd',
@VVD VVD added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Jul 20, 2022
@VVD VVD mentioned this issue Jul 20, 2022
@PVince81 PVince81 assigned PVince81 and come-nc and unassigned PVince81 Jul 25, 2022
@come-nc come-nc added 2. developing Work in progress and removed 0. Needs triage Pending check for reproducibility or if it fits our roadmap labels Aug 1, 2022
@come-nc
Copy link
Contributor

come-nc commented Aug 1, 2022

This comes from https://github.com/nextcloud/updater

@phonon112358
Copy link

same problem here...
I get the error when I try to update from NC 24.0.1 to NC 24.0.[3,4]....

@VVD
Copy link
Author

VVD commented Aug 14, 2022

In 24.0.4 it isn't fixed.

@Pytal
Copy link
Member

Pytal commented Aug 16, 2022

Fixed in nextcloud/updater#429

@phonon112358
Copy link

I can confirm that nextcloud/updater#429 solves this issue

@come-nc come-nc removed the 2. developing Work in progress label Aug 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants