PHP error:Narrowing occurred during type inference?

I installed Nextcloud newly, but the following error log is output periodically.
It looks like it is being output when Cron is running, but how do I deal with it?
It seems that there is no problem with the operation of NextCloud, but is there any adverse affected error?
If you disable Opcache, it seems that error will not come out.

{"reqId":"hutA6R06EvELNBtgHGMa","level":3,"time":"2017-11-27T05:15:01+00: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":"aeitdaduJqAuMgErT6Wl","level":3,"time":"2017-11-27T05:30:01+00: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":"DSSQhuGIPyzb5mKPBdBC","level":3,"time":"2017-11-27T05:45:01+00: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":"dphgsDR28Mq9MB3PoTHh","level":3,"time":"2017-11-27T06:00:02+00: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":"R57n3TgXEKqYPIthdIFg","level":3,"time":"2017-11-27T06:15:01+00: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"}

Hi,

I have the same issue. It started on November 25th out of the sudden:

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-11-25T01:40:01+0100

While I have automated system updates at 1:30 AM and these error messages appeared 10 minutes afterwards, I see a connection there. That day there were some PHP related updates:

php-7.1.12-1
php-fpm-7.1.12-1
php-gd-7.1.12-1
php-intl-7.1.12-1

Maybe it’s the same for you.
Now that I found that relation, I’m going to look for a solution.

Same problem for me. And the web login to my cloud account (as admin) takes more than 1 minute.

Hi all,

I run Arch Linux onmy server with Nextcloud. In my logs that same error appeared when I upgraded my PHP to the latest 7.1.12-1. The message appears anytime the cronjob is run or when the system is booted and thus Nextcloud started.

My web logins work as expected, though.

I reported the bug on PHP bug tracker.
See here: https://bugs.php.net/bug.php?id=74980

1 Like

Here the same issues, thank you matteo!

Same here!

Looks like the two ways to go are

  • downgrade php to the older version again
  • wait for the next release of Nextcloud and hope it will support php7.1.12-1

@MorrisJobke do you have some insights regarding the supported versions of PHP in Nextcloud 13 and 12.4?

Please create an issue on the nextcloud bug tracker as well: https://github.com/nextcloud/server/issues

Hi @tflidd

Thanks for the advice. I created a new issue here:

1 Like

And another one on Ubuntu 16.04:

Should I provide my text in english? I was not sure about the preferred language in this forum?

There is an international section where you can use any language. The user base in English is the biggest, so it is much more likely to get an answer.

Same here.
CentOS 7, php.x86_64 0:7.1.12-4.el7.remi, MariaDB 10.2.11, Apache/2.4.6, Redis server v=4.0.6

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:

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.

1 Like

Problem is that would be part of the next minor release, which might be a bit late (php is already fixed and many have the problem now). But sure, some sort of workaround would be nice (either in NC code or cronjob that manually cleans the logs).

In the meanwhile…
# pacman -U /var/cache/pacman/pkg/php*7.1.11-2-x86_64.pkg.tar.xz