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

BUG?: unserialize error when archiving #15280

Closed
pcmoore opened this issue Dec 17, 2019 · 12 comments
Closed

BUG?: unserialize error when archiving #15280

pcmoore opened this issue Dec 17, 2019 · 12 comments
Labels
answered For when a question was asked and we referred to forum or answered it.

Comments

@pcmoore
Copy link

pcmoore commented Dec 17, 2019

I get the following error when running core:archive:

WARNING [2019-12-17 13:57:38] 11972 /usr/share/webapps/matomo/core/Common.php(271): Notice - unserialize(): Error at offset 0 of 5695492 bytes - Matomo 3.13.0 - Please report this message in the Matomo forums: https://forum.matomo.org (please do a search first as it might have been reported already)

Command line used:

# ./matomo/console core:archive --url="https://127.0.0.1/matomo" \
        --force-all-websites \
        --force-all-periods=315576000 --force-date-last-n=1000

System Information:

  • Arch Linux
  • Matomo 3.13.0
  • PHP 7.4.0
@tsteur
Copy link
Member

tsteur commented Dec 17, 2019

Is there any chance you could give us access to your Matomo to debug the issue?

@pcmoore
Copy link
Author

pcmoore commented Dec 17, 2019 via email

@tsteur
Copy link
Member

tsteur commented Dec 18, 2019

@pcmoore are you familiar with PHP?
If so, in core/Common.php in line 271 can you temporarily change

                return unserialize($string, ['allowed_classes' => empty($allowedClasses) ? false : $allowedClasses]);

to

                $response = unserialize($string, ['allowed_classes' => empty($allowedClasses) ? false : $allowedClasses]);

                if (empty($response)) {
	                debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
                }
                return $response;

and let us know the output?

By any chance, do you know if you are using litespeed?

@pcmoore
Copy link
Author

pcmoore commented Dec 18, 2019 via email

@tsteur
Copy link
Member

tsteur commented Dec 19, 2019

I see. Are you using PHP 7.4? You might need to wait for our next 3.13.1 release where we make sure everything is PHP 7.4 compatible. Unless you wanted to make these changes manually:

https://github.com/matomo-org/matomo/pull/15204/files
https://github.com/matomo-org/matomo/pull/15224/files

@pcmoore
Copy link
Author

pcmoore commented Dec 19, 2019 via email

@tsteur
Copy link
Member

tsteur commented Dec 19, 2019

Thanks @pcmoore
In Common.php can you try once more a similar change and then run it again but this time change it to this?

                $test = unserialize($string, ['allowed_classes' => empty($allowedClasses) ? false : $allowedClasses]);
                if (empty($test)) {
                    echo $string;
                }
                return $test;

@pcmoore
Copy link
Author

pcmoore commented Dec 19, 2019 via email

@pcmoore
Copy link
Author

pcmoore commented Dec 19, 2019 via email

@tsteur
Copy link
Member

tsteur commented Dec 19, 2019

@pcmoore it looks like the archiving actually worked there? Can't see any error there.

@pcmoore
Copy link
Author

pcmoore commented Dec 19, 2019 via email

@tsteur
Copy link
Member

tsteur commented Dec 19, 2019

Glad it works, cheers

@tsteur tsteur closed this as completed Dec 19, 2019
@tsteur tsteur added the answered For when a question was asked and we referred to forum or answered it. label Dec 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered For when a question was asked and we referred to forum or answered it.
Projects
None yet
Development

No branches or pull requests

2 participants