Skip to content

Error flood: PHP error - Narrowing occurred during type inference #7380

Description

@Schmuuu

Steps to reproduce

  1. upgrade PHP to version 7.1.12
  2. (restart web server)
  3. wait about 10 minutes and check the nextcloud logs

Expected behaviour

No error messages ;)

Actual behaviour

After the automatic system updates which updated the following PHP packages last month:
php-7.1.12-1
php-fpm-7.1.12-1
php-gd-7.1.12-1
php-intl-7.1.12-1

there are regular error messages in the logs that occur sometimes every 5 and sometimes every 10 minutes:
Error PHP
Narrowing occurred during type inference. Please file a bug report on bugs.php.net at /var/www/nextcloud/lib/composer/composer/ClassLoader.php#444
2017-12-03T20:45:01+0100

There are some more users affected right now:
https://help.nextcloud.com/t/php-error-narrowing-occurred-during-type-inference/24010

Server configuration detail

Operating system: Linux 4.9.64-1-lts #1 SMP Tue Nov 21 17:36:06 CET 2017 x86_64

Webserver: nginx/1.12.2 (fpm-fcgi)

Database: mysql 10.1.29

PHP version: 7.1.12
Modules loaded: Core, date, libxml, openssl, pcre, zlib, ctype, dom, fileinfo, filter, hash, json, mbstring, pcntl, SPL, PDO, bz2, posix, readline, Reflection, session, SimpleXML, standard, tokenizer, xml, xmlreader, xmlwriter, mysqlnd, cgi-fcgi, Phar, curl, exif, ftp, gd, gmp, intl, iconv, pdo_mysql, zip, apcu, memcache, Zend OPcache

Nextcloud version: 12.0.3 - 12.0.3.3
Latest version from stable release 12.0.3

Updated from an older Nextcloud/ownCloud or fresh install:
Fresh installation

Where did you install Nextcloud from:
Downloaded from nextcloud.com

Signing status

Array

List of activated apps
Enabled:
 - activity: 2.5.2
 - admin_audit: 1.2.0
 - admin_notifications: 1.0.1
 - announcementcenter: 3.1.1
 - apporder: 0.4.0
 - audioplayer: 2.2.1
 - bookmarks: 0.10.1
 - bruteforcesettings: 1.0.2
 - calendar: 1.5.6
 - caniupdate: 0.1.1
 - checksum: 0.3.5
 - circles: 0.13.6
 - cms_pico: 0.9.6
 - comments: 1.2.0
 - contacts: 2.0.1
 - dashboard: 4.0.5
 - dav: 1.3.0
 - deck: 0.2.8
 - drawio: 0.8.8
 - external: 2.0.3
 - federatedfilesharing: 1.2.0
 - federation: 1.2.0
 - files: 1.7.2
 - files_accesscontrol: 1.2.5
 - files_automatedtagging: 1.2.2
 - files_clipboard: 0.6.4
 - files_downloadactivity: 1.1.1
 - files_external: 1.3.0
 - files_markdown: 2.0.1
 - files_pdfviewer: 1.1.1
 - files_reader: 1.0.4
 - files_retention: 1.1.2
 - files_sharing: 1.4.0
 - files_texteditor: 2.4.1
 - files_trashbin: 1.2.0
 - files_versions: 1.5.0
 - files_videoplayer: 1.1.0
 - firstrunwizard: 2.1
 - gallery: 17.0.0
 - groupfolders: 1.1.0
 - issuetemplate: 0.3.0
 - logreader: 2.0.0
 - lookup_server_connector: 1.0.0
 - mail: 0.7.5
 - metadata: 0.6.0
 - nextcloud_announcements: 1.1
 - notes: 2.3.1
 - notifications: 2.0.0
 - oauth2: 1.0.5
 - ojsxc: 3.3.2
 - onlyoffice: 1.1.6
 - passman: 2.1.4
 - password_policy: 1.2.2
 - polls: 0.8.0
 - provisioning_api: 1.2.0
 - quota_warning: 1.1.1
 - ransomware_protection: 1.0.5
 - serverinfo: 1.2.0
 - sharebymail: 1.2.0
 - sharerenamer: 1.1
 - socialsharing_email: 1.0.1
 - spreed: 2.0.2
 - systemtags: 1.2.0
 - tasks: 0.9.5
 - telephoneprovider: 1.0.0
 - theming: 1.3.0
 - twofactor_backupcodes: 1.1.1
 - twofactor_totp: 1.3.1
 - updatenotification: 1.2.0
 - user_usage_report: 1.0.1
 - workflowengine: 1.2.0
Disabled:
 - encryption
 - files_frommail
 - impersonate
 - survey_client
 - user_external
 - user_ldap

Configuration (config/config.php)
{
    "instanceid": "oc4679w80k55",
    "passwordsalt": "***REMOVED SENSITIVE VALUE***",
    "secret": "***REMOVED SENSITIVE VALUE***",
    "trusted_domains": [
        "***REMOVED SENSITIVE VALUE***",
        "192.168.11.10",
        "localhost"
    ],
    "datadirectory": "\/var\/ncdata",
    "dbtype": "mysql",
    "dbname": "nextcloud_db",
    "dbhost": "localhost:3306",
    "dbport": "",
    "dbtableprefix": "oc_",
    "dbuser": "***REMOVED SENSITIVE VALUE***",
    "dbpassword": "***REMOVED SENSITIVE VALUE***",
    "version": "12.0.3.3",
    "logtimezone": "Europe\/Berlin",
    "appstore.experimental.enabled": true,
    "appstoreenabled": true,
    "appstoreurl": "https:\/\/api.nextcloud.com\/v1",
    "mail_smtpmode": "smtp",
    "mail_smtpauth": 1,
    "mail_smtpport": "587",
    "mail_smtphost": "smtp.web.de",
    "mail_smtpauthtype": "LOGIN",
    "mail_from_address": "***REMOVED SENSITIVE VALUE***",
    "mail_domain": "web.de",
    "mail_smtpsecure": "tls",
    "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
    "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
    "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\\TIFF"
    ],
    "filelocking.enabled": true,
    "memcache.local": "\\OC\\Memcache\\APCu",
    "memcache.locking": "\\OC\\Memcache\\Redis",
    "redis": {
        "host": "\/var\/lib\/redis\/redis.sock",
        "port": 0,
        "timeout": 0,
        "dbindex": 0
    },
    "maintenance": false,
    "updater.server.url": "https:\/\/updates.nextcloud.com\/updater_server\/",
    "updater.release.channel": "stable",
    "loglevel": 3,
    "theme": "",
    "installed": true,
    "overwrite.cli.url": "***REMOVED SENSITIVE VALUE***"
}

Are you using external storage, if yes which one: Yes, locally mounted SMB shares

Are you using encryption: no

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

Client configuration

Browser: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 Edge/16.16299

Operating system:
Windows 10; 1709

Logs

Nextcloud log
{"reqId":"5pJseUBSBm9ENOvtB99j","level":3,"time":"2017-12-03T20:20:01+01:00","remoteAddr":"","user":"--","app":"PHP","method":"--","url":"--","message":"Narrowing occurred during type inference. Please file a bug report on bugs.php.net at \/var\/www\/nextcloud\/lib\/composer\/composer\/ClassLoader.php#444","userAgent":"--","version":"12.0.3.3"}
{"reqId":"VitvljSiB6OErAdsPblo","level":3,"time":"2017-12-03T20:30:01+01:00","remoteAddr":"","user":"--","app":"PHP","method":"--","url":"--","message":"Narrowing occurred during type inference. Please file a bug report on bugs.php.net at \/var\/www\/nextcloud\/lib\/composer\/composer\/ClassLoader.php#444","userAgent":"--","version":"12.0.3.3"}
{"reqId":"JTXhEtHJelOhG5PE4d80","level":3,"time":"2017-12-03T20:30:01+01:00","remoteAddr":"","user":"--","app":"PHP","method":"--","url":"--","message":"Narrowing occurred during type inference. Please file a bug report on bugs.php.net at \/var\/www\/nextcloud\/lib\/composer\/composer\/ClassLoader.php#444","userAgent":"--","version":"12.0.3.3"}
{"reqId":"UaRGfdb9hcWsD7nRLk61","level":3,"time":"2017-12-03T20:40:01+01:00","remoteAddr":"","user":"--","app":"PHP","method":"--","url":"--","message":"Narrowing occurred during type inference. Please file a bug report on bugs.php.net at \/var\/www\/nextcloud\/lib\/composer\/composer\/ClassLoader.php#444","userAgent":"--","version":"12.0.3.3"}
{"reqId":"7SH4N4tdlNVRtP3jkV6d","level":3,"time":"2017-12-03T20:45:01+01:00","remoteAddr":"","user":"--","app":"PHP","method":"--","url":"--","message":"Narrowing occurred during type inference. Please file a bug report on bugs.php.net at \/var\/www\/nextcloud\/lib\/composer\/composer\/ClassLoader.php#444","userAgent":"--","version":"12.0.3.3"}
{"reqId":"KamUT5Vbw0pGGhhq21re","level":3,"time":"2017-12-03T20:48:11+01:00","remoteAddr":"192.168.11.200","user":"admininistrator","app":"no app in context","method":"POST","url":"\/index.php\/settings\/ajax\/enableapp.php","message":"issuetemplate","userAgent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/58.0.3029.110 Safari\/537.36 Edge\/16.16299","version":"12.0.3.3"}
{"reqId":"5Tpf3O1ZU9DFdglUKnXm","level":3,"time":"2017-12-03T20:48:14+01:00","remoteAddr":"192.168.11.200","user":"admininistrator","app":"no app in context","method":"GET","url":"\/settings\/admin","message":"issuetemplate","userAgent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/58.0.3029.110 Safari\/537.36 Edge\/16.16299","version":"12.0.3.3"}
{"reqId":"R8dpPUOZkizA3lyRi0SR","level":3,"time":"2017-12-03T20:48:16+01:00","remoteAddr":"192.168.11.200","user":"admininistrator","app":"no app in context","method":"GET","url":"\/settings\/admin\/issuetemplate","message":"issuetemplate","userAgent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/58.0.3029.110 Safari\/537.36 Edge\/16.16299","version":"12.0.3.3"}
{"reqId":"R8dpPUOZkizA3lyRi0SR","level":3,"time":"2017-12-03T20:48:16+01:00","remoteAddr":"192.168.11.200","user":"admininistrator","app":"PHP","method":"GET","url":"\/settings\/admin\/issuetemplate","message":"Array to string conversion at \/var\/www\/nextcloud\/apps\/issuetemplate\/lib\/DetailManager.php#104","userAgent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/58.0.3029.110 Safari\/537.36 Edge\/16.16299","version":"12.0.3.3"}
{"reqId":"olPvzLidHICqj5zJTfXr","level":3,"time":"2017-12-03T20:50:01+01:00","remoteAddr":"","user":"--","app":"PHP","method":"--","url":"--","message":"Narrowing occurred during type inference. Please file a bug report on bugs.php.net at \/var\/www\/nextcloud\/lib\/composer\/composer\/ClassLoader.php#444","userAgent":"--","version":"12.0.3.3"}
{"reqId":"nhlzY8uFxeEqQryiLxXI","level":3,"time":"2017-12-03T20:50:53+01:00","remoteAddr":"192.168.11.200","user":"admininistrator","app":"no app in context","method":"GET","url":"\/settings\/admin\/logging","message":"issuetemplate","userAgent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/58.0.3029.110 Safari\/537.36 Edge\/16.16299","version":"12.0.3.3"}

Activity

  1. Wikinaut commented on Dec 6, 2017

    @Wikinaut
    Contributor

    needs urgently to be fixed

  2. Tsuroerusu commented on Dec 6, 2017

    @Tsuroerusu

    I agree with @Wikinaut , I am also seeing this in my server logs, it is completely out of control. I would go so far as to say that a hotfix-release ought to be issued to deal with this.

  3. thebeline commented on Dec 7, 2017

    @thebeline

    Same here, fresh install of NextCloud and PHP7.1 yesterday, and it's really flooding in. Not sure how dangerous it is, but considering I do not have opcacheing on at the moment, I am getting a deluge of these...

  4. Tsuroerusu commented on Dec 8, 2017

    @Tsuroerusu

    This seems to be a bug in PHP 7.1.12 and not in Nextcloud:
    https://bugs.php.net/bug.php?id=75570
    https://bugs.php.net/bug.php?id=75608

    Looking at the changelogs for PHP itself, this shoud be fixed in 7.1.13 which comes out in January:
    "- Opcache:
    . Fixed bug #75608 ("Narrowing occurred during type inference" error).
    (Laruence, Dmitry)
    . Fixed bug #75570 ("Narrowing occurred during type inference" error).
    (Dmitry)"
    Source: https://raw.githubusercontent.com/php/php-src/PHP-7.1/NEWS

    The fix seems to be from this commit:
    php/php-src@776bef8

    So I guess the only solution at the moment is to manually compile PHP with that fix or use the RC1 of 7.1.13.

    One thing that would be nice is if the Nextcloud logs could be pruned by the type of error, so that this mess caused to my log files by PHP 7.1.12 could be flushed down the drain.

  5. acao commented on Dec 8, 2017

    @acao

    FYI, we had this bug in another PHP application I was working on (magento 2.2), and temporarily reverting to 7.1.11 worked as well, if that's an option.

  6. t-zuehlsdorff commented on Dec 14, 2017

    @t-zuehlsdorff

    Aloha,
    i'm the PHP maintainer for FreeBSD. I just committed the patches of the PHP team so everyone using FreeBSD will get rid of the error by an update of www/php71-opcache :)
    Greetings,
    Torsten

  7. MorrisJobke commented on Dec 15, 2017

    @MorrisJobke
    Member

    This needs an update of the underlying PHP package. Sadly we can't do anything here. Sorry :(

    Please reach out to the maintainers of the PHP package that you use.

  8. snapper87 commented on Dec 15, 2017

    @snapper87

    Fix is already available upstream. Backported to ondrej's ppa already. https://launchpad.net/~ondrej/+archive/ubuntu/php

  9. haroonahmad194 commented on Dec 18, 2017

    @haroonahmad194

    Warning: Narrowing occurred during type inference. Please file a bug report on bugs.php.net in /home/kmccoy42/public_html/plazafitnessperformance.com/wp-content/plugins/LayerSlider/layerslider.php on line 64
    I am getting this issue on my website which was recently moved to a new server. How can i fix this issue ??

  10. Tsuroerusu commented on Dec 18, 2017

    @Tsuroerusu

    @haroonahmad194 The problem is caused by the server using PHP 7.1.12 which has a bug that causes this error. There is nothing to do except asking the server administrator to either downgrade to 7.1.11 or build and install a custom 7.1.12 with the relevant patches. If the server is running FreeBSD, an update should be available within a few days, I think.

  11. joekerna commented on Dec 18, 2017

    @joekerna

    Fix is already available upstream. Backported to ondrej's ppa already. https://launchpad.net/~ondrej/+archive/ubuntu/php

    This fixed the issue for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions