Partkeepr: Setup fails at Warming up the cache (monolog error)

Created on 23 Sep 2017  ·  20Comments  ·  Source: partkeepr/PartKeepr

System Information

  • PartKeepr Version: 1.3.0
  • PHP version 7.2

When I reach the last step I have the error from the image:

2017-09-22 15_28_28-partkeepr setup

move-to-wiki

Most helpful comment

You can fix this quick and dirty:
go to file -> /vendor/symfony/monolog-bundle/DependencyInjection/Configuration.php

around line 594 comment out or remove line below:

// ->ifTrue(function ($v) { return ('fingers_crossed' === $v['type'] || 'buffer' === $v['type'] || 'filter' === $v['type']) && 1 !== count($v['handler']); })

add the following line:
->ifTrue(function ($v) { return ('fingers_crossed' === $v['type'] || 'buffer' === $v['type'] || 'filter' === $v['type']) && (empty($v['handler']) || !is_string($v['handler'])); })

the installer will than finish the install and you have access to the application.

All 20 comments

The bug:

Invalid configuration for path "monolog.handlers.main": Warning: count(): Parameter must be an array or an object that implements Countable

is caused by PHP 7.2, temporary workaround is downgrading to PHP 7.1.

The bug is in upstream symfony, see: https://github.com/symfony/monolog-bundle/issues/223

Any fix for this ? I'm working with linux Mint, and i'm not an expert linux user to install php7.1... Linux Mint only offers 7.2 standard...

You can fix this quick and dirty:
go to file -> /vendor/symfony/monolog-bundle/DependencyInjection/Configuration.php

around line 594 comment out or remove line below:

// ->ifTrue(function ($v) { return ('fingers_crossed' === $v['type'] || 'buffer' === $v['type'] || 'filter' === $v['type']) && 1 !== count($v['handler']); })

add the following line:
->ifTrue(function ($v) { return ('fingers_crossed' === $v['type'] || 'buffer' === $v['type'] || 'filter' === $v['type']) && (empty($v['handler']) || !is_string($v['handler'])); })

the installer will than finish the install and you have access to the application.

Is this still the recommended fix?

Yes, it seems like it.
The fix in symphony/monolog-bundle was released in version 3.1.2, and PartKeepr is using 2.4.
To be able to use the new version of monolog-bundle, symphony would have to be updated and that is not easily doable (without a quite large time investment).
The workaround from @erikvanberkum is still the best way to do it.

Gotcha. Maybe have an automated fix as part of the setup script?
That is, an automated fix that replaces that line.

I had this issue when trying to install Partkeepr on a Raspberry Pi 3+

I gave up and did a clean reflash and reinstalled OS and Partkeepr from scratch following
this page- https://wiki.partkeepr.org/wiki/PartKeepr_on_Debian_%22Stretch%22

I set the timeout to 130 instead of 120, and then after the database parameters page, I followed this page
https://wiki.partkeepr.org/wiki/APC_Metadata_Caching

to edit the yaml and the continued along and it installed fine.

Which of all these forks are the one with working/latest code?
I've now tried 13 of them and still can't even install it :(
Using CentOS.

My Info:

cat /etc/centos-release

CentOS Linux release 7.6.1810 (Core)

uname -a

Linux xxx.org 3.10.0-957.12.2.el7.x86_64 #1 SMP Tue May 14 21:24:32 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

php -v

PHP 7.2.19 (cli) (built: May 29 2019 11:04:13) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

mysql --version

mysql Ver 15.1 Distrib 5.5.60-MariaDB, for Linux (x86_64) using readline 5.1

httpd -v

Server version: Apache/2.4.6 (CentOS)
Server built: Apr 24 2019 13:45:48

Errors I get:

[Sat Jun 01 00:22:58.384109 2019] [php7:warn] [pid 13807] [client 155.4.14.39:56332] PHP Warning: require_once(/webdata1/partkeepr/web/../app/bootstrap.php.cache): failed to open stream: No such file or directory in /webdata1/partkeepr/web/app.php on line 6, referer: http://partkeepr.ddns.net/setup/index.html
[Sat Jun 01 00:22:58.384190 2019] [php7:error] [pid 13807] [client 155.4.14.39:56332] PHP Fatal error: require_once(): Failed opening required '/webdata1/partkeepr/web/../app/bootstrap.php.cache' (include_path='.:/usr/share/pear:/usr/share/php') in /webdata1/partkeepr/web/app.php on line 6, referer: http://partkeepr.ddns.net/setup/index.html
[Sat Jun 01 00:22:58.394956 2019] [php7:warn] [pid 13797] [client 155.4.14.39:56331] PHP Warning: require_once(/webdata1/partkeepr/web/../app/bootstrap.php.cache): failed to open stream: No such file or directory in /webdata1/partkeepr/web/app.php on line 6, referer: http://partkeepr.ddns.net/setup/index.html
[Sat Jun 01 00:22:58.395025 2019] [php7:error] [pid 13797] [client 155.4.14.39:56331] PHP Fatal error: require_once(): Failed opening required '/webdata1/partkeepr/web/../app/bootstrap.php.cache' (include_path='.:/usr/share/pear:/usr/share/php') in /webdata1/partkeepr/web/app.php on line 6, referer: http://partkeepr.ddns.net/setup/index.html
[Sat Jun 01 00:22:58.565949 2019] [php7:warn] [pid 13799] [client 155.4.14.39:56334] PHP Warning: require_once(/webdata1/partkeepr/web/../app/bootstrap.php.cache): failed to open stream: No such file or directory in /webdata1/partkeepr/web/app.php on line 6, referer: http://partkeepr.ddns.net/setup/index.html
[Sat Jun 01 00:22:58.566015 2019] [php7:error] [pid 13799] [client 155.4.14.39:56334] PHP Fatal error: require_once(): Failed opening required '/webdata1/partkeepr/web/../app/bootstrap.php.cache' (include_path='.:/usr/share/pear:/usr/share/php') in /webdata1/partkeepr/web/app.php on line 6, referer: http://partkeepr.ddns.net/setup/index.html4

I recently installed Partkeepr and did not get this message. Thus, I am closing it. If anyone runs into it, we will reopen.

@christianlupus I got the error and the fix is #1065 ...

Got this issue. Fixed with update to monolog-bundle >3.1.0
composer require symfony/monolog-bundle:3.1.* fixed it

@christianlupus I think this is a good one to be added to the docs :)

I can put it in the docs (at least the staging ones) but I doubt this is a really good idea. You are changing part of bundle from 2.7 to 3.1. This is a major version change and I am unaware of any side effects this might have or not have.
In fact you make the users to do the update to symphony 3 themselves partly. I had very bad experience with such zombie programs of mixed versions.... It might not fail now but it might fail any time. I'd rather not give the official advice to heck that much into a system we both do not know much about. My first check did not yield any broken dependencies but this was done only in a quick manual fashion.

@baradhili Do you have more information or knowledge that this is a safe advice?

@christianlupus ah not doing a module upgrade.. but @erikvanberkum 's comment

<<
You can fix this quick and dirty:
go to file -> /vendor/symfony/monolog-bundle/DependencyInjection/Configuration.php

around line 594 comment out or remove line below:

// ->ifTrue(function ($v) { return ('fingers_crossed' === $v['type'] || 'buffer' === $v['type'] || 'filter' === $v['type']) && 1 !== count($v['handler']); })

add the following line:
->ifTrue(function ($v) { return ('fingers_crossed' === $v['type'] || 'buffer' === $v['type'] || 'filter' === $v['type']) && (empty($v['handler']) || !is_string($v['handler'])); })

the installer will than finish the install and you have access to the application.

>

Ahh, OK, I see. I will keep it open until I wrote it to the docs.

I have same problem with this.. and cant find the way to install older version of php...?? can i get some help..
the problem:

Invalid configuration for path "monolog.handlers.main": Warning: count(): Parameter must be an array or an object that implements Countable

i tryed to fix it by:

go to file -> /vendor/symfony/monolog-bundle/DependencyInjection/Configuration.php

around line 594 comment out or remove line below:

// ->ifTrue(function ($v) { return ('fingers_crossed' === $v['type'] || 'buffer' === $v['type'] || 'filter' === $v['type']) && 1 !== count($v['handler']); })

add the following line:
->ifTrue(function ($v) { return ('fingers_crossed' === $v['type'] || 'buffer' === $v['type'] || 'filter' === $v['type']) && (empty($v['handler']) || !is_string($v['handler'])); })

but just get this err:
err

@stegl please open a new issue with Help request to not hiccup this issue here. You can link to this one nevertheless. Thank you very much.

@christianlupus ah not doing a module upgrade.. but @erikvanberkum 's comment

<<
You can fix this quick and dirty:
go to file -> /vendor/symfony/monolog-bundle/DependencyInjection/Configuration.php

around line 594 comment out or remove line below:

// ->ifTrue(function ($v) { return ('fingers_crossed' === $v['type'] || 'buffer' === $v['type'] || 'filter' === $v['type']) && 1 !== count($v['handler']); })

add the following line:
->ifTrue(function ($v) { return ('fingers_crossed' === $v['type'] || 'buffer' === $v['type'] || 'filter' === $v['type']) && (empty($v['handler']) || !is_string($v['handler'])); })

the installer will than finish the install and you have access to the application.

>

I tried this fix but I get a different error now.

"Invalid response from server"

Is this fix still valid?

@xadonxander the named "fix" was never a fix. It is plainly hacking into the dependency code which is a clear error.

So to make it clear once more: Do not change anything under the /vendor folder. It is no fix to tweak things there.

The best fix in the meantime is to use PHP 7.0 or 7.1. Then the error should not appear at all. Apart from that we definitively need to update, see #1083.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dani2bunny picture dani2bunny  ·  24Comments

Gasman2014 picture Gasman2014  ·  26Comments

kgabryszewska picture kgabryszewska  ·  8Comments

HolgerHeckeroth picture HolgerHeckeroth  ·  4Comments

integralmedia picture integralmedia  ·  4Comments