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

PHP 8.0 Deprecation warning for OC\Files\Config\CachedMountFileInfo::__construct() #26479

Closed
rigrig opened this issue Apr 9, 2021 · 1 comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug

Comments

@rigrig
Copy link
Contributor

rigrig commented Apr 9, 2021

Steps to reproduce

Run the Nextcloud cronjob:

sudo -u www-nextcloud php cron.php

Expected behaviour

No problems

Actual behaviour

The cronjob finishes, but gives a deprecation warning:

PHP Deprecated:  Required parameter $internalPath follows optional parameter $mountId in /var/www/nextcloud/public/lib/private/Files/Config/CachedMountFileInfo.php on line 34

Server configuration detail

Operating system: Linux 5.10.0-0.bpo.4-amd64 #1 SMP Debian 5.10.19-1~bpo10+1 (2021-03-13) x86_64

Webserver: Apache (apache2handler) behind Nginx proxy

Database: pgsql PostgreSQL 11.11 (Debian 11.11-0+deb10u1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit

PHP version: 8.0.3
Modules loaded: Core, date, libxml, openssl, pcre, zlib, filter, hash, json, Reflection, SPL, session, standard, sodium, apache2handler, PDO, xml, apcu, bcmath, bz2, calendar, ctype, curl, dom, mbstring, FFI, fileinfo, ftp, gd, gettext, gmp, iconv, imagick, imap, intl, ldap, exif, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, readline, shmop, SimpleXML, sockets, sqlite3, sysvmsg, sysvsem, sysvshm, tokenizer, xmlreader, xmlwriter, xsl, zip, Zend OPcache

Nextcloud version: 21.0.1 - 21.0.1.1

Updated from an older Nextcloud/ownCloud or fresh install: updated from 21.0.0

Where did you install Nextcloud from: migrated from OwnCloud a long time ago

Signing status

Array
(
)

List of activated apps
Enabled:
 - accessibility: 1.7.0
 - activity: 2.14.3
 - admin_audit: 1.11.0
 - apporder: 0.12.0
 - bookmarks: 4.1.0
 - calendar: 2.2.0
 - cloud_federation_api: 1.4.0
 - contacts: 3.5.1
 - contactsinteraction: 1.2.0
 - dashboard: 7.1.0
 - dav: 1.17.1
 - federatedfilesharing: 1.11.0
 - federation: 1.11.0
 - files: 1.16.0
 - files_pdfviewer: 2.1.0
 - files_rightclick: 1.0.0
 - files_sharing: 1.13.1
 - files_texteditor: 2.14.0
 - files_trashbin: 1.11.0
 - files_versions: 1.14.0
 - files_videoplayer: 1.10.0
 - firstrunwizard: 2.10.0
 - issuetemplate: 0.7.0
 - logreader: 2.6.0
 - lookup_server_connector: 1.9.0
 - mail: 1.9.5
 - maps: 0.1.8
 - metadata: 0.13.0
 - news: 15.3.2
 - nextcloud_announcements: 1.10.0
 - notes: 4.0.4
 - notifications: 2.9.0
 - oauth2: 1.9.0
 - photos: 1.3.0
 - privacy: 1.5.0
 - provisioning_api: 1.11.0
 - qownnotesapi: 20.9.0
 - ransomware_protection: 1.10.0
 - recommendations: 1.0.0
 - richdocuments: 4.0.4
 - serverinfo: 1.11.0
 - settings: 1.3.0
 - sharebymail: 1.11.0
 - social: 0.4.2
 - spreed: 11.1.1
 - support: 1.4.0
 - survey_client: 1.9.0
 - tasks: 0.13.6
 - theming: 1.12.0
 - twofactor_backupcodes: 1.10.0
 - twofactor_nextcloud_notification: 3.1.2
 - twofactor_totp: 6.0.0
 - updatenotification: 1.11.0
 - user_status: 1.1.1
 - viewer: 1.5.0
 - weather_status: 1.1.0
 - workflowengine: 2.3.0
Disabled:
 - comments
 - deck
 - encryption
 - files_external
 - files_markdown
 - password_policy
 - sharerenamer
 - systemtags
 - text
 - user_ldap

Configuration (config/config.php)
{
    "instanceid": "***REMOVED SENSITIVE VALUE***",
    "passwordsalt": "***REMOVED SENSITIVE VALUE***",
    "datadirectory": "***REMOVED SENSITIVE VALUE***",
    "dbtype": "pgsql",
    "version": "21.0.1.1",
    "installed": true,
    "forcessl": true,
    "loglevel": 0,
    "theme": "",
    "default_phone_region": "NL",
    "maintenance": false,
    "defaultapp": "dashboard",
    "enable_previews": true,
    "preview_libreoffice_path": "\/usr\/bin\/libreoffice",
    "enabledPreviewProviders": [
        "OC\\Preview\\PNG",
        "OC\\Preview\\JPEG",
        "OC\\Preview\\GIF",
        "OC\\Preview\\BMP",
        "OC\\Preview\\XBitmap",
        "OC\\Preview\\MP3",
        "OC\\Preview\\TXT",
        "OC\\Preview\\MarkDown",
        "OC\\Preview\\Illustrator",
        "OC\\Preview\\Movie",
        "OC\\Preview\\MSOffice2003",
        "OC\\Preview\\MSOffice2007",
        "OC\\Preview\\MSOfficeDoc",
        "OC\\Preview\\OpenDocument",
        "OC\\Preview\\PDF",
        "OC\\Preview\\Photoshop",
        "OC\\Preview\\Postscript",
        "OC\\Preview\\StarOffice",
        "OC\\Preview\\SVG",
        "OC\\Preview\\TIFF",
        "OC\\Preview\\Font"
    ],
    "trusted_domains": [
        "***REMOVED***"
    ],
    "dbname": "***REMOVED SENSITIVE VALUE***",
    "dbhost": "***REMOVED SENSITIVE VALUE***",
    "dbuser": "***REMOVED SENSITIVE VALUE***",
    "dbpassword": "***REMOVED SENSITIVE VALUE***",
    "secret": "***REMOVED SENSITIVE VALUE***",
    "forceSSLforSubdomains": true,
    "mail_from_address": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpmode": "smtp",
    "mail_domain": "***REMOVED SENSITIVE VALUE***",
    "updatechecker": true,
    "updater.server.url": "https:\/\/updates.nextcloud.com\/updater_server\/",
    "updater.release.channel": "stable",
    "apps_paths": [
        {
            "path": "\/var\/www\/nextcloud\/public\/apps",
            "url": "\/apps",
            "writable": true
        },
        {
            "path": "\/var\/www\/nextcloud\/public\/apps_manual",
            "url": "\/apps_manual",
            "writable": false
        }
    ],
    "appstoreenabled": true,
    "appcodechecker": false,
    "appstore.experimental.enabled": true,
    "memcache.local": "\\OC\\Memcache\\APCu",
    "trashbin_retention_obligation": "auto",
    "asset-pipeline.enabled": true,
    "overwrite.cli.url": "https:\/\/***REMOVED***",
    "overwriteprotocol": "https",
    "htaccess.RewriteBase": "\/",
    "mail_smtpauthtype": "LOGIN",
    "app_install_overwrite": [
        "apporder",
        "spreed",
        "ransomware_protection",
        "sharerenamer",
        "joplin",
        "issuetemplate"
    ],
    "has_rebuilt_cache": true,
    "updater.secret": "***REMOVED SENSITIVE VALUE***"
}

Are you using external storage, if yes which one: no

Are you using encryption: no

Are you using an external user-backend, if yes which one: No

Client configuration

Browser: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:87.0) Gecko/20100101 Firefox/87.0

Operating system: Debian 5.10.19-1~bpo10+1

Workaround/fix

I manually changed

public function __construct(IUser $user, $storageId, $rootId, $mountPoint, $mountId = null, $rootInternalPath = '', $internalPath) {

from

        public function __construct(IUser $user, $storageId, $rootId, $mountPoint, $mountId = null, $rootInternalPath = '', $internalPath) {

to

        public function __construct(IUser $user, $storageId, $rootId, $mountPoint, $mountId = null, $rootInternalPath = '', $internalPath = '') {

i.e. added a default value for $internalPath
And the error went away.
(Come to think of it, I think I might actually have done so for version 21.0.0 as well but forgot to report the issue...)
But maybe a better solution would be to instead remove all default values, as apparently they are always all present anyway, or there would have been errors about missing $internalPath?

@rigrig rigrig added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Apr 9, 2021
@kesselb
Copy link
Contributor

kesselb commented Apr 9, 2021

Thanks 👍

Closing in favour of #25806.

@kesselb kesselb closed this as completed Apr 9, 2021
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

2 participants