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

Notice - unserialize(): Error at offset 0 of 53988 bytes #14229

Closed
Findus23 opened this issue Mar 19, 2019 · 56 comments
Closed

Notice - unserialize(): Error at offset 0 of 53988 bytes #14229

Findus23 opened this issue Mar 19, 2019 · 56 comments
Labels
Bug For errors / faults / flaws / inconsistencies etc. Regression Indicates a feature used to work in a certain way but it no longer does even though it should.
Milestone

Comments

@Findus23
Copy link
Member

Findus23 commented Mar 19, 2019

The source of the error has been found, please take a look at #14229 for the fix.


This error has been reported quite a few times on the forum, so I'll create an issue.

What is known:

https://forum.matomo.org/t/empty-or-invalid-response/31848
https://forum.matomo.org/t/empty-or-invalid-response-when-core-archive/32106
https://forum.matomo.org/t/error-making-archive/32110

@comete-upn
Copy link

We encounter the same error since updating to Matomo 3.9 this morning.

We are using PHP 7.0.33 though.

@ZAZmaster
Copy link

Has same issue!

@Guite
Copy link

Guite commented Mar 19, 2019

Same problem since updating to Matomo 3.9. Using PHP 7.2.

@mattab
Copy link
Member

mattab commented Mar 19, 2019

Is the problem maybe that some logging seems to be enabled? eg. the response is:

ERROR [2019-03-19 06:38:22] 17061  Empty or invalid response '[2019-03-19 06:38:21] piwik.DEBUG: Loaded plugins: CorePluginsAdmin, CoreAdminHome, CoreHome, WebsiteMeasurable, IntranetMeasurable, 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, TwoFactorAuth, 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, BotTracker, QueuedTracking, ReferrersManager, SecurityInfo [] {"class":"Piwik\\Plugin\\Manager","request_id":17148} a:52:{s:10:"2019-01-27";a:40:{s:16:"nb_uniq_visitors";d:5;s:9:"nb_visits";d:5;s:8:"nb_users";i:0;s:10:"nb_actions";d:5;s:11:"max_actions";d:1;s:12:"bounce_count";d:5;s:16:"sum_visit_length";i:0;s:19:"nb_visits_returning";d:1;s:20:"nb_actions_returning";d:1;s:26:"nb_uniq_visitors_returning";d:1;s:18:"nb_users_returning";i:0;s:21:"max_actions_returning";d:1;s:21:"bounce_rate_returning";s:4:"100%";s:30:"nb_actions_per_visit_returning";d:1;s:26:"avg_time_on_site_returning";d:0;s:14[...................]

and the first line is ERROR [2019-03-19 06:38:22] 17061 Empty or invalid response '[2019-03-19 06:38:21] piwik.DEBUG: Loaded plugins:

Can you maybe check that DEBUG logging is disabled? https://matomo.org/faq/troubleshooting/faq_115/

@mattab mattab added this to the 3.10.0 milestone Mar 19, 2019
@mattab mattab added Regression Indicates a feature used to work in a certain way but it no longer does even though it should. Bug For errors / faults / flaws / inconsistencies etc. labels Mar 19, 2019
@Guite
Copy link

Guite commented Mar 19, 2019

log_level is set to WARN in global.ini.php and does not exist in config.ini.php.
But indeed the cronjob's output contains DEBUG messages.

@ZAZmaster
Copy link

global.ini.php log_level = WARN
In system check: Last Successful Archiving Completion Archiving has not yet run successfully.

@dogsbody
Copy link

I believe I have the same issue since upgrading to Matomo 3.9.0 this morning.
Ubuntu 18.04 with PHP 7.2

@arndbernstein
Copy link

Same here. I also get a "Password changed" mail each time I login via LDAP.

@maisen20
Copy link

same here. maybe this issue will have a lot other users.

@creopard
Copy link

Using the "real" cron feature for the first time in Matomo 3.9.0 and got this error straight away.
Changing the "log_level" to e.g. "ERROR" does not seem to fix it.

@poldixd
Copy link

poldixd commented Mar 19, 2019

Same issue here:

Matomo-Version: 3.9.0
MySQL-Version: 5.5.60-0+deb7u1-log
PHP-Version: 7.2.14

@fdellwing
Copy link
Contributor

I did stumple across an interessting case:

Our archiving was running fine with php7.0 (I hardcoded it sometime ago in the cron, website runs 7.2). I just ran the command with php7.2 and got the error, afterwards I was not able to run the command with php7.0 again.

@Findus23
Copy link
Member Author

@fdellwing As I have no idea why this could happen, I'd suggest running console cache:clear and checking if this fixes it again (until you repeat the steps)

@fdellwing
Copy link
Contributor

Clearing the cache did not solve the problem.

@fdellwing
Copy link
Contributor

Ok, this error is definitely a regression of #13923

You may apply the attached patch file to your Matomo instance to revert these changes until the problem is solved.

git apply --reject ~/0001-Revert-Enable-fingers-crossed-handler-via-INI-config.patch

(Calling with --reject because some files are not packed into release)

0001-Revert-Enable-fingers-crossed-handler-via-INI-config.patch.txt

//cc @diosmosis

@timEulitz
Copy link

@fdellwing Your patch seems to work fine for us, thanks a lot!

Do we have to keep anything in mind when updating Matomo via the user interface the next time or will it simply overwrite the patched parts of the code without causing a fuss?

@Findus23
Copy link
Member Author

@timEulitz
The next update will overwrite all files, so you should be fine once you have installed it. And if some file is not overwritten, the integrity checker will tell you what to do.

@arndbernstein
Copy link

Patch solved the cron problem. Still get the password changed notification, seems to be unrelated.

@Findus23
Copy link
Member Author

Findus23 commented Mar 19, 2019

@arndbernstein This sounds completely unrelated, could you please open an issue here:
https://github.com/matomo-org/plugin-LoginLdap

@comete-upn
Copy link

Applying the patch solved the problem on our hand.
Thanks!

@diosmosis
Copy link
Member

If I had to guess there is error occurring that is now visible in whatever is trying to be unserialize()'d. From what's been reported, this only happens during cron archiving, correct? If it happens at another time, please let me know.

@jgkirschbaum
Copy link

@arndbernstein This sounds completely unrelated, could you please open an issue here:
https://github.com/matomo-org/plugin-LoginLdap

matomo-org/plugin-LoginLdap#180

@maisen20
Copy link

after apply the patch, the file integrity check fails and reports that there are some files with not the expected file sizes. did i something wrong or is that normal!?

@ghost
Copy link

ghost commented Mar 19, 2019

Patch fixed it, thanks!

But now i get an "SQLSTATE Syntax error or access violation" when i run the cron archiving:

ERROR [2019-03-19 14:58:46] 17845 Got invalid response from API request: ?module=API&method=API.get&idSite=52&period=day&date=last52&format=php&trigger=archivephp. Response was 'a:2:{s:6:"result";s:5:"error";s:7:"message";s:427:"SQLSTATE[42000]: Syntax error or access violation: 1064 Routing query to backend failed. See the error log for further details. - in plugin Actions, caused by: SQLSTATE[42000]: Syntax error or access violation: 1064 Routing query to backend failed. See the error log for further details., caused by: SQLSTATE[42000]: Syntax error or access violation: 1064 Routing query to backend failed. See the error log for further details.";}'

I'm using MariaDB 10.3.13 Galera Cluster, maybe unrelated?

@pixel8383
Copy link

Same issue to my installation. I don't have ssh access to my hosting, how can I fix it?

@Findus23
Copy link
Member Author

@fdellwing Even when you update from the release candidate to the stable version?

@fdellwing
Copy link
Contributor

I only tried 3 step upgrade after the auto update failed. But I now can do it unlimited times with always the problem afterwards.

@diosmosis
Copy link
Member

@Findus23 Yes, that's how I was able to reproduce and fix the other issue affecting the update. But I don't have an issue w/ core:archive. It's possibly due to using a mac, I'll try going through docker.

@michaellass @fdellwing The output is truncated, there's likely much more not being displayed. If PIWIK_ARCHIVE_NO_TRUNCATE is defined, you'll be able to see the whole message which would definitely help.

@michaellass
Copy link

@diosmosis thanks for the tip! Here's the full output.

matomo-error-long.log

@diosmosis
Copy link
Member

Thanks @michaellass! Looks like there is actually no error or warning, the log level is simply changed to DEBUG for some reason, but only in those archiving requests. I'll see if I can pinpoint a cause.

@diosmosis
Copy link
Member

@michaellass could you try the following change to see if it fixes the issue for you? comment out https://github.com/matomo-org/matomo/blob/3.x-dev/plugins/Monolog/config/config.php#L51-L62

@michaellass
Copy link

@michaellass could you try the following change to see if it fixes the issue for you? comment out https://github.com/matomo-org/matomo/blob/3.x-dev/plugins/Monolog/config/config.php#L51-L62

I tried but that's not it. The errors still occur.

@diosmosis
Copy link
Member

I am now able to reproduce this through docker, will put up a fix as soon as possible.

@diosmosis
Copy link
Member

@michaellass created a fix here: #14239

Can you see if it works for you?

@michaellass
Copy link

@michaellass created a fix here: #14239

Can you see if it works for you?

Yes, that change fixes it! 🎉

@ZAZmaster
Copy link

Ok, this error is definitely a regression of #13923

You may apply the attached patch file to your Matomo instance to revert these changes until the problem is solved.

git apply --reject ~/0001-Revert-Enable-fingers-crossed-handler-via-INI-config.patch

(Calling with --reject because some files are not packed into release)

0001-Revert-Enable-fingers-crossed-handler-via-INI-config.patch.txt

//cc @diosmosis

And what if my installation does not use git?

@diosmosis
Copy link
Member

@ZAZmaster there's a fix here: #14239, it's a small change that can be applied directly. Or you might be able to workaround it by just enabling the file logger in your INI config.

@ZAZmaster
Copy link

@diosmosis thx!

@comete-upn
Copy link

The fix #14239 works perfectly.
Thanks!

@kartolo
Copy link

kartolo commented Mar 20, 2019

@michaellass created a fix here: #14239

Can you see if it works for you?

works for me too. Archiving CLI works again

@fdellwing
Copy link
Contributor

And what if my installation does not use git?

@ZAZmaster Just to make you aware of this: You just need git installed to apply a patch, it does not need to be a git repo or something along those line.

@diosmosis Fix works for me.

@nathanlesage
Copy link

Can confirm, the fix in #14239 works, the Cron runs smoothly on my installation now!

@fdellwing
Copy link
Contributor

A quick note, you do not need to type the changes yourself, you can just get the patch from GitHub: https://patch-diff.githubusercontent.com/raw/matomo-org/matomo/pull/14239.patch

@sgiehl sgiehl modified the milestones: 3.10.0, 3.9.1 Mar 20, 2019
@jhit
Copy link

jhit commented Mar 20, 2019

Confirm #14239 works here. Had the issue after upgrading to 3.9.0 running PHP 7.0.32.

@timscha
Copy link

timscha commented Mar 20, 2019

I can also confirm the patch is working with PHP 7.3

@ToeiRei
Copy link

ToeiRei commented Mar 20, 2019

Patch works with 7.3.3

@adundovi
Copy link

The patch works both on PHP 7.0 and 7.1. Tnx.

@bst2002git
Copy link

Mysql 5.7.23-23-57
PHP version: 7.2.16

Patch working

@jokermanse
Copy link

PHP 7.0.21
Patch working. Thanks!

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. Regression Indicates a feature used to work in a certain way but it no longer does even though it should.
Projects
None yet
Development

No branches or pull requests