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
Installation: detect disabled gzcompress/gzuncompress #1776
Comments
Edit config/config.ini.php, adding 'charset = utf8' to the database connection settings. |
It is already (Version 1.0) [database] |
Has it always been charset=utf8? A mangled row was inserted. You'll have to delete the bad row in the archive table. Piwik should regenerate it. |
Are you sure you're looking at the right config? Your stacktrace shows PDO_MYSQL while comment:2 shows MYSQLI. |
Attachment: |
Attachment: |
Attachment: |
If you haven't already deleted the affected row in your table... You can also try the attached patch + .php files (put them in the core/Archive folder). If gzuncompress() fails, it'll try to use Emanuele Iannone's decompression class (based on the official Zlib code). |
I tried MYSQLI and PDO_MYSQL, each time I used a new database/new installation. I applied the patch (in the old database, and later on new database) "Last visitor graph" works, "Live visitors" works but not "List of keywords" or for example "Length of Visits". Any more clues? |
What version of mysql server are you using? |
My only other thought is to use mysql's compress/uncompress functions ... this would any encoding errors between php and mysql server. |
MYSQL version is: 5.0.51a-24+lenny4-log I think I just use go for another server. Thanks for the great help! |
5.0.51a is old and buggy. Upgrading mysql generally won't hurt. Can you check your my.cnf for max_allowed_packet? If this is set too low, I suspect the INSERT fails (eg blob is truncated), which would explain the data error when we SELECT and gzuncompress). |
max allowed packet = 16,776,192 |
Attachment: |
This second patch uses MySQL's native compress/uncompress functions per comment:8. |
Wahoo it works! This is what I call service! Thanks again. |
We still don't know what the exact cause is, since it works "as-is" usually. This may not make it into Piwik 1.1as it needs changes to the Installer and adapters, and affects the db abstraction in #1368. |
I took another look at your phpinfo. Was gzcompress always disabled on your system? |
Yes it was. A solution would be to expand the System Check in the installation. |
What should we test for in order to prevent this bug then? thx |
Check if gzcompress is enabled on the server. |
Ok. I was thinking of a custom adapter that would use the built-in MySQL functions, but let's go with the quick fix of detecting this at installation. |
(In [3321]) fixes #1776 |
Looking at the error message "function.gzuncompress: data error", it makes me believe that the function was properly defined, but just didn't work as expected. Otherwise the error message is more like: 'Fatal error: Call to undefined function' So I don't think the SVN commit would really fix this issue - thoughts? |
That's because gzcompress was disabled while gzuncompress was enabled. We're good here. |
Thanks, good stuff vipsoft! |
On the Dashboard almost all the Tabs show the same bug.
Here is the phpinfo from the server I am using: http://23.se.gp/phpinfo.php
The text was updated successfully, but these errors were encountered: