@anonymous-piwik-user opened this Issue on October 21st 2010

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 -->
<a href='/0'>#0</a> 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] => ))
<a href='/1'>#1</a> gzuncompress() called at [/data/multiserv/users/452235/projects/1039869/www/piwik/core/Archive/Single.php:270]
<a href='/2'>#2</a> Piwik_Archive_Single->get(UserSettings_browser, blob) called at [/data/multiserv/users/452235/projects/1039869/www/piwik/core/Archive/Single.php:443]
<a href='/3'>#3</a> Piwik_Archive_Single->getDataTable(UserSettings_browser) called at [/data/multiserv/users/452235/projects/1039869/www/piwik/plugins/UserSettings/API.php:39]
<a href='/4'>#4</a> 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]
<a href='/5'>#5</a> Piwik_UserSettings_API->getBrowser(1, day, 2010-10-21)
<a href='/6'>#6</a> 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]
<a href='/7'>#7</a> 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]
<a href='/8'>#8</a> Piwik_API_Request->process() called at [/data/multiserv/users/452235/projects/1039869/www/piwik/core/ViewDataTable.php:367]
<a href='/9'>#9</a> Piwik_ViewDataTable->loadDataTableFromAPI() called at [/data/multiserv/users/452235/projects/1039869/www/piwik/core/ViewDataTable/HtmlTable.php:75]
<a href='/10'>#10</a> Piwik_ViewDataTable_HtmlTable->main() called at [/data/multiserv/users/452235/projects/1039869/www/piwik/core/Controller.php:140]
<a href='/11'>#11</a> 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] ...
<a href='/12'>#12</a> Piwik_UserSettings_Controller->getBrowser()
<a href='/13'>#13</a> 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]
<a href='/14'>#14</a> Piwik_FrontController->dispatch() called at [/data/multiserv/users/452235/projects/1039869/www/piwik/index.php:60]
@robocoder commented on October 22nd 2010 Contributor

Attachment:
ZlibDecompress.php

@robocoder commented on October 22nd 2010 Contributor

Attachment:
HuffmanTable.php

@robocoder commented on October 22nd 2010 Contributor

Attachment:
1776.patch

@robocoder commented on October 24th 2010 Contributor

Attachment:
1776-2.patch

@robocoder commented on October 21st 2010 Contributor

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

@anonymous-piwik-user commented on October 21st 2010

It is already (Version 1.0)

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

@robocoder commented on October 21st 2010 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 commented on October 22nd 2010 Contributor

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

@robocoder commented on October 22nd 2010 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-piwik-user commented on October 22nd 2010

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 commented on October 24th 2010 Contributor

What version of mysql server are you using?

@robocoder commented on October 24th 2010 Contributor

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

@anonymous-piwik-user commented on October 24th 2010

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

I think I just use go for another server.

Thanks for the great help!

@robocoder commented on October 24th 2010 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-piwik-user commented on October 24th 2010

max allowed packet = 16,776,192

@robocoder commented on October 24th 2010 Contributor

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

@anonymous-piwik-user commented on October 25th 2010

Wahoo it works!

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

@robocoder commented on October 25th 2010 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 commented on October 25th 2010 Contributor

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

@anonymous-piwik-user commented on October 25th 2010

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 commented on November 16th 2010 Member

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

@anonymous-piwik-user commented on November 17th 2010

Check if gzcompress is enabled on the server.

@robocoder commented on November 17th 2010 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 commented on November 17th 2010 Contributor

(In [3321]) fixes #1776

@mattab commented on November 18th 2010 Member

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 commented on November 18th 2010 Contributor

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

We're good here.

@mattab commented on November 18th 2010 Member

Thanks, good stuff vipsoft!

This Issue was closed on November 18th 2010
Powered by GitHub Issue Mirror