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

Installation: detect disabled gzcompress/gzuncompress #1776

Closed
anonymous-matomo-user opened this issue Oct 21, 2010 · 27 comments
Closed

Installation: detect disabled gzcompress/gzuncompress #1776

anonymous-matomo-user opened this issue Oct 21, 2010 · 27 comments
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@anonymous-matomo-user
Copy link

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

Warning: gzuncompress() [<a href='function.gzuncompress'>function.gzuncompress</a>]: data error in /data/multiserv/users/452235/projects/1039869/www/piwik/core/Archive/Single.php on line 270

Backtrace -->
#0 Piwik_ErrorHandler(2, gzuncompress() [<a href='function.gzuncompress'>function.gzuncompress</a>]: data error, /data/multiserv/users/452235/projects/1039869/www/piwik/core/Archive/Single.php, 270, Array ([name] => UserSettings_browser,[typeValue] => blob,[table] => piwik_archive_blob_2010_10,[db] => Piwik_Db_Adapter_Pdo_Mysql Object ([] => mysql,[] => Array ([0] => 0,[1] => 1,[2] => 2,[INT] => 0,[INTEGER] => 0,[MEDIUMINT] => 0,[SMALLINT] => 0,[TINYINT] => 0,[BIGINT] => 1,[SERIAL] => 1,[DEC] => 2,[DECIMAL] => 2,[DOUBLE] => 2,[DOUBLE PRECISION] => 2,[FIXED] => 2,[FLOAT] => 2),[] => Zend_Db_Statement_Pdo,[] => Array (),[] => 2,[] => Zend_Db_Profiler Object ([] => Array (),[] => ,[] => ,[] => ),[] => Zend_Db_Profiler,[] => PDO Object (),[] => 0,[] => 1,[] => 1,[] => ),[value] => ))
#1 gzuncompress() called at [/data/multiserv/users/452235/projects/1039869/www/piwik/core/Archive/Single.php:270]
#2 Piwik_Archive_Single->get(UserSettings_browser, blob) called at [/data/multiserv/users/452235/projects/1039869/www/piwik/core/Archive/Single.php:443]
#3 Piwik_Archive_Single->getDataTable(UserSettings_browser) called at [/data/multiserv/users/452235/projects/1039869/www/piwik/plugins/UserSettings/API.php:39]
#4 Piwik_UserSettings_API->getDataTable(UserSettings_browser, 1, day, 2010-10-21) called at [/data/multiserv/users/452235/projects/1039869/www/piwik/plugins/UserSettings/API.php:70]
#5 Piwik_UserSettings_API->getBrowser(1, day, 2010-10-21)
#6 call_user_func_array(Array ([0] => Piwik_UserSettings_API Object (),[1] => getBrowser), Array ([0] => 1,[1] => day,[2] => 2010-10-21)) called at [/data/multiserv/users/452235/projects/1039869/www/piwik/core/API/Proxy.php:151]
#7 Piwik_API_Proxy->call(Piwik_UserSettings_API, getBrowser, Array ([method] => UserSettings.getBrowser,[format] => original,[filter_limit] => 5,[filter_sort_column] => nb_uniq_visitors,[filter_sort_order] => desc,[module] => UserSettings,[action] => getBrowser,[idSite] => 1,[period] => day,[date] => 2010-10-21)) called at [/data/multiserv/users/452235/projects/1039869/www/piwik/core/API/Request.php:117]
#8 Piwik_API_Request->process() called at [/data/multiserv/users/452235/projects/1039869/www/piwik/core/ViewDataTable.php:367]
#9 Piwik_ViewDataTable->loadDataTableFromAPI() called at [/data/multiserv/users/452235/projects/1039869/www/piwik/core/ViewDataTable/HtmlTable.php:75]
#10 Piwik_ViewDataTable_HtmlTable->main() called at [/data/multiserv/users/452235/projects/1039869/www/piwik/core/Controller.php:140]
#11 Piwik_Controller->renderView(Piwik_ViewDataTable_HtmlTable Object ([] => ,[arrayDataTable] => ,[] => CoreHome/templates/datatable.tpl,[] => 1,[] => Array ([enable_sort] => 1,[filter_sort_column] => nb_uniq_visitors,[filter_sort_order] => desc,[filter_limit] => 5),[] => Array ([show_goals] => ,[show_search] => ,[show_table] => 1,[show_table_all_columns] => 1,[show_all_views_icons] => 1,[show_export_as_image_icon] => ,[show_exclude_low_population] => ,[show_offset_information] => 1,[show_pagination_control] => 1,[show_footer] => 1,[show_footer_icons] => 1,[apiMethodToRequestDataTable] => UserSettings.getBrowser,[uniqueId] => UserSettingsgetBrowser),[] => 0,[] => ,[] => Array (),[] => getBrowser,[] => UserSettings,[] => ,[] => UserSettings.getBrowser,[] => ,[] => Array ([nb_visits] => Visits,[nb_uniq_visitors] => Unique visitors,[nb_actions] => Actions,[nb_actions_per_visit] => Actions per Visit,[avg_time_on_site] => Avg. Time on Website,[bounce_rate] => Bounce Rate,[conversion_rate] ...
#12 Piwik_UserSettings_Controller->getBrowser()
#13 call_user_func_array(Array ([0] => Piwik_UserSettings_Controller Object ([] => UserSettings,[] => 2010-10-21,[] => Piwik_Date Object ([] => 1287619200,[] => UTC),[] => 1,[] => Piwik_Site Object ([] => 1)),[1] => getBrowser), Array ()) called at [/data/multiserv/users/452235/projects/1039869/www/piwik/core/FrontController.php:126]
#14 Piwik_FrontController->dispatch() called at [/data/multiserv/users/452235/projects/1039869/www/piwik/index.php:60]
@robocoder
Copy link
Contributor

Edit config/config.ini.php, adding 'charset = utf8' to the database connection settings.

@anonymous-matomo-user
Copy link
Author

It is already (Version 1.0)

[database]
host = "localhost"
username = "xxx
password = "xxx"
dbname = "xxx"
tables_prefix = "piwik_"
adapter = "MYSQLI"
port = 3306
charset = "utf8"

@robocoder
Copy link
Contributor

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.

@robocoder
Copy link
Contributor

Are you sure you're looking at the right config? Your stacktrace shows PDO_MYSQL while comment:2 shows MYSQLI.

@robocoder
Copy link
Contributor

Attachment:
ZlibDecompress.php

@robocoder
Copy link
Contributor

Attachment:
HuffmanTable.php

@robocoder
Copy link
Contributor

Attachment:
1776.patch

@robocoder
Copy link
Contributor

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).

@anonymous-matomo-user
Copy link
Author

I tried MYSQLI and PDO_MYSQL, each time I used a new database/new installation.
There are no installation errors either, everything is checked green.
charset = "utf8" is always set by default.

I applied the patch (in the old database, and later on new database)
but then it goes "...ZlibDecompress.php on line 174..." which is
"trigger_error("Out of input", E_USER_ERROR);"

"Last visitor graph" works, "Live visitors" works but not "List of keywords" or for example "Length of Visits".

Any more clues?

@robocoder
Copy link
Contributor

What version of mysql server are you using?

@robocoder
Copy link
Contributor

My only other thought is to use mysql's compress/uncompress functions ... this would any encoding errors between php and mysql server.

@anonymous-matomo-user
Copy link
Author

MYSQL version is: 5.0.51a-24+lenny4-log

I think I just use go for another server.

Thanks for the great help!

@robocoder
Copy link
Contributor

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).

@anonymous-matomo-user
Copy link
Author

max allowed packet = 16,776,192

@robocoder
Copy link
Contributor

Attachment:
1776-2.patch

@robocoder
Copy link
Contributor

This second patch uses MySQL's native compress/uncompress functions per comment:8.

@anonymous-matomo-user
Copy link
Author

Wahoo it works!

This is what I call service! Thanks again.
Who needs Google anyway? ;)

@robocoder
Copy link
Contributor

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.

@robocoder
Copy link
Contributor

I took another look at your phpinfo. Was gzcompress always disabled on your system?

@anonymous-matomo-user
Copy link
Author

Yes it was.
My mistake, I didn't look into it.

A solution would be to expand the System Check in the installation.
At least until there is a better way.

@mattab
Copy link
Member

mattab commented Nov 16, 2010

What should we test for in order to prevent this bug then? thx

@anonymous-matomo-user
Copy link
Author

Check if gzcompress is enabled on the server.

@robocoder
Copy link
Contributor

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.

@robocoder
Copy link
Contributor

(In [3321]) fixes #1776

@mattab
Copy link
Member

mattab commented Nov 18, 2010

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?

@robocoder
Copy link
Contributor

That's because gzcompress was disabled while gzuncompress was enabled.

We're good here.

@mattab
Copy link
Member

mattab commented Nov 18, 2010

Thanks, good stuff vipsoft!

@anonymous-matomo-user anonymous-matomo-user added this to the Piwik 1.1 milestone Jul 8, 2014
This issue was closed.
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

No branches or pull requests

3 participants