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

Running the archive via cron will result often in errors "Illegal string offset 'XAxisDisplay' 'XAxisFormat' " #11116

Closed
tuxmaster opened this issue Dec 30, 2016 · 11 comments · Fixed by #11559
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@tuxmaster
Copy link

Some jobs will run without any error and other will fail.
Piwik: 3.0.0
PHP: 7.1
Here the error:
NFO [2016-12-30 06:50:05] Scheduler: executing task Piwik\Plugins\ScheduledReports\API.sendReport_4...
WARNING [2016-12-30 06:50:17] /var/www/piwik/libs/pChart/class/pData.class.php(73): Warning - Illegal string offset 'XAxisDisplay' - Piwik 3.0.0 - Please report this message in the Piwik forums: http://forum.piwik.org (please do a search first as it might have been reported already)
WARNING [2016-12-30 06:50:17] /var/www/piwik/libs/pChart/class/pData.class.php(74): Warning - Illegal string offset 'XAxisFormat' - Piwik 3.0.0 - Please report this message in the Piwik forums: http://forum.piwik.org (please do a search first as it might have been reported already)
WARNING [2016-12-30 06:50:17] /var/www/piwik/libs/pChart/class/pData.class.php(74): Warning - Cannot assign an empty string to a string offset - Piwik 3.0.0 - Please report this message in the Piwik forums: http://forum.piwik.org (please do a search first as it might have been reported already)
WARNING [2016-12-30 06:50:17] /var/www/piwik/libs/pChart/class/pData.class.php(75): Warning - Illegal string offset 'XAxisName' - Piwik 3.0.0 - Please report this message in the Piwik forums: http://forum.piwik.org (please do a search first as it might have been reported already)
WARNING [2016-12-30 06:50:17] /var/www/piwik/libs/pChart/class/pData.class.php(75): Warning - Cannot assign an empty string to a string offset - Piwik 3.0.0 - Please report this message in the Piwik forums: http://forum.piwik.org (please do a search first as it might have been reported already)
WARNING [2016-12-30 06:50:17] /var/www/piwik/libs/pChart/class/pData.class.php(76): Warning - Illegal string offset 'XAxisUnit' - Piwik 3.0.0 - Please report this message in the Piwik forums: http://forum.piwik.org (please do a search first as it might have been reported already)
WARNING [2016-12-30 06:50:17] /var/www/piwik/libs/pChart/class/pData.class.php(76): Warning - Cannot assign an empty string to a string offset - Piwik 3.0.0 - Please report this message in the Piwik forums: http://forum.piwik.org (please do a search first as it might have been reported already)
WARNING [2016-12-30 06:50:17] /var/www/piwik/libs/pChart/class/pData.class.php(77): Warning - Illegal string offset 'Abscissa' - Piwik 3.0.0 - Please report this message in the Piwik forums: http://forum.piwik.org (please do a search first as it might have been reported already)
WARNING [2016-12-30 06:50:17] /var/www/piwik/libs/pChart/class/pData.class.php(77): Warning - Cannot assign an empty string to a string offset - Piwik 3.0.0 - Please report this message in the Piwik forums: http://forum.piwik.org (please do a search first as it might have been reported already)
WARNING [2016-12-30 06:50:17] /var/www/piwik/libs/pChart/class/pData.class.php(78): Warning - Illegal string offset 'AbsicssaPosition' - Piwik 3.0.0 - Please report this message in the Piwik forums: http://forum.piwik.org (please do a search first as it might have been reported already)
WARNING [2016-12-30 06:50:17] /var/www/piwik/libs/pChart/class/pData.class.php(80): Warning - Illegal string offset 'Axis' - Piwik 3.0.0 - Please report this message in the Piwik forums: http://forum.piwik.org (please do a search first as it might have been reported already)
Uncaught exception: Cannot use string offset as an array
in /var/www/piwik/libs/pChart/class/pData.class.php line 80
#0 /var/www/piwik/plugins/ImageGraph/StaticGraph.php(241): pData->__construct()
#1 /var/www/piwik/plugins/ImageGraph/StaticGraph/GridGraph.php(68): Piwik\Plugins\ImageGraph\StaticGraph->initpData()
#2 /var/www/piwik/plugins/ImageGraph/StaticGraph/Evolution.php(24): Piwik\Plugins\ImageGraph\StaticGraph\GridGraph->initGridChart(true, 691053, false, true, true)
#3 /var/www/piwik/plugins/ImageGraph/API.php(493): Piwik\Plugins\ImageGraph\StaticGraph\Evolution->renderGraph()
#4 [internal function]: Piwik\Plugins\ImageGraph\API->get('2', 'day', '2016-11-30,2016...', 'MultiSites', 'getAll', 'evolution', '2', false, false, true, 700, 200, 9, 11, true, false, false, '222222', 'FFFFFF', 'CCCCCC', false, true, false, false)
#5 /var/www/piwik/core/API/Proxy.php(219): call_user_func_array(Array, Array)
#6 /var/www/piwik/core/API/Request.php(236): Piwik\API\Proxy->call('\Piwik\Plugins\...', 'get', Array)
#7 /var/www/piwik/core/ReportRenderer.php(261): Piwik\API\Request->process()
#8 /var/www/piwik/core/ReportRenderer/Html.php(210): Piwik\ReportRenderer::getStaticGraph(Array, 700, 200, true, NULL)
#9 /var/www/piwik/core/ReportRenderer/Html.php(175): Piwik\ReportRenderer\Html->getAttachment(Array, Array, 'Donnerstag, 29....')
#10 /var/www/piwik/plugins/ScheduledReports/API.php(942): Piwik\ReportRenderer\Html->getAttachments(Array, Array, 'Donnerstag, 29....')
#11 /var/www/piwik/plugins/ScheduledReports/API.php(500): Piwik\Plugins\ScheduledReports\API->getAttachments(Object(Piwik\ReportRenderer\Html), Array, Array, 'Donnerstag, 29....')
#12 /var/www/piwik/plugins/ScheduledReports/API.php(557): Piwik\Plugins\ScheduledReports\API->generateReport('4', '2016-12-29', 'de', 2, 'day')
#13 [internal function]: Piwik\Plugins\ScheduledReports\API->sendReport('4')
#14 /var/www/piwik/core/Scheduler/Scheduler.php(227): call_user_func(Array, '4')
#15 /var/www/piwik/core/Scheduler/Scheduler.php(124): Piwik\Scheduler\Scheduler->executeTask(Object(Piwik\Scheduler\Task))
#16 /var/www/piwik/plugins/CoreAdminHome/API.php(58): Piwik\Scheduler\Scheduler->run()
#17 /var/www/piwik/core/CronArchive.php(536): Piwik\Plugins\CoreAdminHome\API->runScheduledTasks()
#18 /var/www/piwik/core/CronArchive.php(290): Piwik\CronArchive->runScheduledTasks()
#19 /var/www/piwik/core/Access.php(469): Piwik\CronArchive->Piwik{closure}()
#20 /var/www/piwik/core/CronArchive.php(292): Piwik\Access::doAsSuperUser(Object(Closure))
#21 /var/www/piwik/plugins/CoreConsole/Commands/CoreArchiver.php(27): Piwik\CronArchive->main()
#22 /var/www/piwik/vendor/symfony/console/Symfony/Component/Console/Command/Command.php(257): Piwik\Plugins\CoreConsole\Commands\CoreArchiver->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#23 /var/www/piwik/vendor/symfony/console/Symfony/Component/Console/Application.php(874): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#24 /var/www/piwik/vendor/symfony/console/Symfony/Component/Console/Application.php(195): Symfony\Component\Console\Application->doRunCommand(Object(Piwik\Plugins\CoreConsole\Commands\CoreArchiver), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#25 [internal function]: Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#26 /var/www/piwik/core/Console.php(79): call_user_func(Array, Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#27 /var/www/piwik/core/Access.php(469): Piwik\Console->Piwik{closure}()
#28 /var/www/piwik/core/Console.php(80): Piwik\Access::doAsSuperUser(Object(Closure))
#29 /var/www/piwik/vendor/symfony/console/Symfony/Component/Console/Application.php(126): Piwik\Console->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#30 /var/www/piwik/console(27): Symfony\Component\Console\Application->run()
#31 {main}

@mattab
Copy link
Member

mattab commented Jan 2, 2017

Reupload all files from Piwik 3 as it looks like some files are not uploaded correctly?

@mattab mattab closed this as completed Jan 2, 2017
@mattab mattab added the answered For when a question was asked and we referred to forum or answered it. label Jan 2, 2017
@tuxmaster
Copy link
Author

The update was done via the update function of piwik and no error was reported.
So the update function has an problem or the files are correct and the problem comes from anywhere else.

@mattab mattab removed the answered For when a question was asked and we referred to forum or answered it. label Jan 2, 2017
@mattab mattab changed the title Running the archive via cron will result often in errors Running the archive via cron will result often in errors "Illegal string offset 'XAxisDisplay' 'XAxisFormat' " Jan 2, 2017
@mattab mattab added the Bug For errors / faults / flaws / inconsistencies etc. label Jan 2, 2017
@mattab
Copy link
Member

mattab commented Jan 2, 2017

Ok re-opening this issue. Does anyone else experience this error message?

@CarlOrff
Copy link

CarlOrff commented Jan 4, 2017

Yes, I get this particular error message even with manual download of PDF reports. And it doesn't depend upon the PHP version (tried 7.1.0, 7.0.14 and 5.5.9).

Piwik encoutered an error: Uncaught Error: Cannot use string offset as an array in /var/www/vhosts/xxxxxxx/piwik/libs/pChart/class/pData.class.php:80 Stack trace: #0 /var/www/vhosts/xxxxxxx/piwik/plugins/ImageGraph/StaticGraph.php(241): pData->__construct() #1 /var/www/vhosts/xxxxxxx/piwik/plugins/ImageGraph/StaticGraph/GridGraph.php(68): Piwik\Plugins\ImageGraph\StaticGraph->initpData() #2 /var/www/vhosts/xxxxxxx/piwik/plugins/ImageGraph/StaticGraph/Evolution.php(24): Piwik\Plugins\ImageGraph\StaticGraph\GridGraph->initGridChart(true, 691053, false, true, true) #3 /var/www/vhosts/xxxxxxx/piwik/plugins/ImageGraph/API.php(493): Piwik\Plugins\ImageGraph\StaticGraph\Evolution->renderGraph() #4 [internal function]: Piwik\Plugins\ImageGraph\API->get('1', 'day', 'last30', 'VisitsSummary', 'get', 'evolution', '2', false, false, true, 760, 220, 9, 11, true, false, false, '222222', 'FFFFFF', 'CCCCCC', false (which lead to: Uncaught Error: Cannot use string offset as an array in /var/www/vhosts/xxxxxxx/piwik/libs/pChart/class/pData.class.php:80 Stack trace: #0 /var/www/vhosts/xxxxxxx/piwik/plugins/ImageGraph/StaticGraph.php(241): pData->__construct() #1 /var/www/vhosts/xxxxxxx/piwik/plugins/ImageGraph/StaticGraph/GridGraph.php(68): Piwik\Plugins\ImageGraph\StaticGraph->initpData() #2 /var/www/vhosts/xxxxxxx/piwik/plugins/ImageGraph/StaticGraph/Evolution.php(24): Piwik\Plugins\ImageGraph\StaticGraph\GridGraph->initGridChart(true, 691053, false, true, true) #3 /var/www/vhosts/xxxxxxx/piwik/plugins/ImageGraph/API.php(493): Piwik\Plugins\ImageGraph\StaticGraph\Evolution->renderGraph() #4 [internal function]: Piwik\Plugins\ImageGraph\API->get('1', 'day', 'last30', 'VisitsSummary', 'get', 'evolution', '2', false, false, true, 760, 220, 9, 11, true, false, false, '222222', 'FFFFFF', 'CCCCCC', false)

@ozbarshalom
Copy link

Same here.
Using php 7.1, Getting this error when trying to download an html report.
Pdf reports are working.

@mattab mattab reopened this Jan 9, 2017
@Wilkolicious
Copy link

Not using piwik, but found this through googling for a similar problem for our project:

From: http://php.net/manual/en/migration71.incompatible.php

The empty index operator is not supported for strings anymore

Applying the empty index operator to a string (e.g. $str[] = $x) throws a fatal error instead of converting silently to array.

PChart is getting relatively old now (hasn't been updated since 2014). You'll need to search for any places in the code where the variable is initialised as a string, then array elements are added.

These (member) variables should be initialised as an array().

It's a fairly big task, and really, pChart needs to be re-written/refined for PHP7.1 .

@senden9
Copy link

senden9 commented Jan 25, 2017

I also get this messages if i try to generate a mail report:

DEBUG Piwik\Plugin\Manager[2017-01-25 20:30:55] [8c16b] Loaded plugins: CorePluginsAdmin, CoreAdminHome, CoreHome, WebsiteMeasurable, Diagnostics, CoreVisualizations, Proxy, API, ExamplePlugin, Widgetize, Transitions, LanguagesManager, Actions, Dashboard, MultiSites, Referrers, UserLanguage, DevicesDetection, Goals, Ecommerce, SEO, Events, UserCountry, VisitsSummary, VisitFrequency, VisitTime, VisitorInterest, ExampleAPI, RssWidget, Feedback, Monolog, Login, UsersManager, SitesManager, Installation, CoreUpdater, CoreConsole, ScheduledReports, UserCountryMap, Live, CustomVariables, PrivacyManager, ImageGraph, Annotations, MobileMessaging, Overlay, SegmentEditor, Insights, Morpheus, Contents, BulkTracking, Resolution, DevicePlugins, Heartbeat, Intl, Marketplace, ProfessionalServices, UserId, CustomPiwikJs
WARNING ImageGraph[2017-01-25 20:30:55] [8c16b] /var/www/piwik/libs/pChart/class/pData.class.php(73): Warning - Illegal string offset 'XAxisDisplay' - Piwik 3.0.1 - Please report this message in the Piwik forums: http://forum.piwik.org (please do a search first as it might have been reported already)
WARNING ImageGraph[2017-01-25 20:30:55] [8c16b] /var/www/piwik/libs/pChart/class/pData.class.php(74): Warning - Illegal string offset 'XAxisFormat' - Piwik 3.0.1 - Please report this message in the Piwik forums: http://forum.piwik.org (please do a search first as it might have been reported already)
WARNING ImageGraph[2017-01-25 20:30:55] [8c16b] /var/www/piwik/libs/pChart/class/pData.class.php(74): Warning - Cannot assign an empty string to a string offset - Piwik 3.0.1 - Please report this message in thePiwik forums: http://forum.piwik.org (please do a search first as it might have been reported already)
WARNING ImageGraph[2017-01-25 20:30:55] [8c16b] /var/www/piwik/libs/pChart/class/pData.class.php(75): Warning - Illegal string offset 'XAxisName' - Piwik 3.0.1 - Please report this message in the Piwik forums: http://forum.piwik.org (please do a search first as it might have been reported already)
WARNING ImageGraph[2017-01-25 20:30:55] [8c16b] /var/www/piwik/libs/pChart/class/pData.class.php(75): Warning - Cannot assign an empty string to a string offset - Piwik 3.0.1 - Please report this message in thePiwik forums: http://forum.piwik.org (please do a search first as it might have been reported already)
WARNING ImageGraph[2017-01-25 20:30:55] [8c16b] /var/www/piwik/libs/pChart/class/pData.class.php(76): Warning - Illegal string offset 'XAxisUnit' - Piwik 3.0.1 - Please report this message in the Piwik forums: http://forum.piwik.org (please do a search first as it might have been reported already)
WARNING ImageGraph[2017-01-25 20:30:55] [8c16b] /var/www/piwik/libs/pChart/class/pData.class.php(76): Warning - Cannot assign an empty string to a string offset - Piwik 3.0.1 - Please report this message in thePiwik forums: http://forum.piwik.org (please do a search first as it might have been reported already)
WARNING ImageGraph[2017-01-25 20:30:55] [8c16b] /var/www/piwik/libs/pChart/class/pData.class.php(77): Warning - Illegal string offset 'Abscissa' - Piwik 3.0.1 - Please report this message in the Piwik forums: http://forum.piwik.org (please do a search first as it might have been reported already)
WARNING ImageGraph[2017-01-25 20:30:55] [8c16b] /var/www/piwik/libs/pChart/class/pData.class.php(77): Warning - Cannot assign an empty string to a string offset - Piwik 3.0.1 - Please report this message in thePiwik forums: http://forum.piwik.org (please do a search first as it might have been reported already)
WARNING ImageGraph[2017-01-25 20:30:55] [8c16b] /var/www/piwik/libs/pChart/class/pData.class.php(78): Warning - Illegal string offset 'AbsicssaPosition' - Piwik 3.0.1 - Please report this message in the Piwik forums: http://forum.piwik.org (please do a search first as it might have been reported already)
WARNING ImageGraph[2017-01-25 20:30:55] [8c16b] /var/www/piwik/libs/pChart/class/pData.class.php(80): Warning - Illegal string offset 'Axis' - Piwik 3.0.1 - Please report this message in the Piwik forums: http://forum.piwik.org (please do a search first as it might have been reported already)

System:

$ php -v
PHP 7.1.1 (cli) (built: Jan 18 2017 18:44:22) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies

@daberlin
Copy link

This looks promising: https://github.com/bozhinov/pChart2.0-for-PHP7

@mattab
Copy link
Member

mattab commented Feb 20, 2017

Thanks for the link @daberlin - maybe you would like to try use this updated pChart in Piwik? We'd love your help on this one and a pull request 😎

@mattab mattab added this to the 3.0.3 milestone Feb 20, 2017
@mattab
Copy link
Member

mattab commented Mar 28, 2017

@sgiehl probably this issue is about

@mattab
Copy link
Member

mattab commented Apr 3, 2017

This will be released in 3.0.3-rc1 due in the next few hours, feedback welcome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants