Skip to content

Auto Geoip Db update may fail, Tar library not loading in some server configs #4533

@jloh

Description

@jloh

If you don't have php-pear installed on the system and use the GeoIP auto-updater it fails to download/unpack the new files with a error like this:

Error: Got invalid response from API request: https://stats.example.comstats.example.com/index.php?module=API&method=CoreAdminHome.runScheduledTasks&format=csv&convertToUnicode=0&token_auth=00000000000000000000&trigger=archivephp. Response was '<div style='word-wrap: break-word; border: 3px solid red; padding:4px; width:70%; background-color:#FFFF96;'>
        <strong>There is an error. Please report the message (Piwik 2.0.3)
        and full backtrace in the <a href='?module=Proxy&action=redirect&url=http://forum.piwik.org' target='_blank'>Piwik forums</a> (please do a Search first as it might have been reported already!).<br /><br/>
        Warning:</strong> <em>require_once(PEAR.php): failed to open stream: No such file or directory</em> in <strong>/var/www/stats.example.com/docroot/libs/Archive_Tar/Tar.php</strong> on line <strong>42</strong>
<br /><br />Backtrace --&gt;<div style="font-family:Courier;font-size:10pt"><br />
#0  Piwik\Error::errorHandler(...) called at [/var/www/stats.example.com/docroot/libs/Archive_Tar/Tar.php:42]<br />
#1  require_once(...) called at [/var/www/stats.example.com/docroot/libs/Archive_Tar/Tar.php:42]<br />
#2  require_once(...) called at [/var/www/stats.example.com/docroot/core/Unzip/Tar.php:18]<br />
#3  require_once(...) called at [/var/www/stats.example.com/docroot/core/Loader.php:101]<br />
#4  Piwik\Loader::tryToLoadClass(...) called at [/var/www/stats.example.com/docroot/core/Loader.php:89]<br />
#5  Piwik\Loader::loadClass(...) called at [/var/www/stats.example.com/docroot/core/Loader.php:117]<br />
#6  Piwik\Loader::autoload(...) called at [:]<br />
#7  spl_autoload_call(...) called at [/var/www/stats.example.com/docroot/core/Unzip.php:41]<br />
#8  Piwik\Unzip::factory(...) called at [/var/www/stats.example.com/docroot/plugins/UserCountry/GeoIPAutoUpdater.php:186]<br />
#9  Piwik\Plugins\UserCountry\GeoIPAutoUpdater::unzipDownloadedFile(...) called at [/var/www/stats.example.com/docroot/plugins/UserCountry/GeoIPAutoUpdater.php:158]<br />
#10  Piwik\Plugins\UserCountry\GeoIPAutoUpdater->downloadFile(...) called at [/var/www/stats.example.com/docroot/plugins/UserCountry/GeoIPAutoUpdater.php:102]<br />
#11  Piwik\Plugins\UserCountry\GeoIPAutoUpdater->update(...) called at [:]<br />
#12  call_user_func(...) called at [/var/www/stats.example.com/docroot/core/TaskScheduler.php:196]<br />
#13  Piwik\TaskScheduler::executeTask(...) called at [/var/www/stats.example.com/docroot/core/TaskScheduler.php:133]<br />
#14  Piwik\TaskScheduler->doRunTasks(...) called at [/var/www/stats.example.com/docroot/core/TaskScheduler.php:83]<br />
#15  Piwik\TaskScheduler::runTasks(...) called at [/var/www/stats.example.com/docroot/plugins/CoreAdminHome/API.php:41]<br />
#16  Piwik\Plugins\CoreAdminHome\API->runScheduledTasks(...) called at [:]<br />
#17  call_user_func_array(...) called at [/var/www/stats.example.com/docroot/core/API/Proxy.php:213]<br />
#18  Piwik\API\Proxy->call(...) called at [/var/www/stats.example.com/docroot/core/API/Request.php:220]<br />
#19  Piwik\API\Request->process(...) called at [/var/www/stats.example.com/docroot/plugins/API/Controller.php:34]<br />
#20  Piwik\Plugins\API\Controller->index(...) called at [:]<br />
#21  call_user_func_array(...) called at [/var/www/stats.example.com/docroot/core/FrontController.php:117]<br />
#22  Piwik\FrontController->dispatch(...) called at [/var/www/stats.example.com/docroot/index.php:62]<br />
</div><br />
 </pre></div><br />'
1 total errors during this script execution, please investigate and try and fix these errors
ERROR: 1 total errors during this script execution, please investigate and try and fix these errors. First error was: Got invalid response from API request: https://stats.example.com/index.php?module=API&method=CoreAdminHome.runScheduledTasks&format=csv&convertToUnicode=0&token_auth=00000000000000000000&trigger=archivephp. Response was '<div style='word-wrap: break-word; border: 3px solid red; padding:4px; width:70%; background-color:#FFFF96;'>
        <strong>There is an error. Please report the message (Piwik 2.0.3)
        and full backtrace in the <a href='?module=Proxy&action=redirect&url=http://forum.piwik.org' target='_blank'>Piwik forums</a> (please do a Search first as it might have been reported already!).<br /><br/>
        Warning:</strong> <em>require_once(PEAR.php): failed to open stream: No such file or directory</em> in <strong>/var/www/stats.example.com/docroot/libs/Archive_Tar/Tar.php</strong> on line <strong>42</strong>
<br /><br />Backtrace --&gt;<div style="font-family:Courier;font-size:10pt"><br />
#0  Piwik\Error::errorHandler(...) called at [/var/www/stats.example.com/docroot/libs/Archive_Tar/Tar.php:42]<br />
#1  require_once(...) called at [/var/www/stats.example.com/docroot/libs/Archive_Tar/Tar.php:42]<br />
#2  require_once(...) called at [/var/www/stats.example.com/docroot/core/Unzip/Tar.php:18]<br />
#3  require_once(...) called at [/var/www/stats.example.com/docroot/core/Loader.php:101]<br />
#4  Piwik\Loader::tryToLoadClass(...) called at [/var/www/stats.example.com/docroot/core/Loader.php:89]<br />
#5  Piwik\Loader::loadClass(...) called at [/var/www/stats.example.com/docroot/core/Loader.php:117]<br />
#6  Piwik\Loader::autoload(...) called at [:]<br />
#7  spl_autoload_call(...) called at [/var/www/stats.example.com/docroot/core/Unzip.php:41]<br />
#8  Piwik\Unzip::factory(...) called at [/var/www/stats.example.com/docroot/plugins/UserCountry/GeoIPAutoUpdater.php:186]<br />
#9  Piwik\Plugins\UserCountry\GeoIPAutoUpdater::unzipDownloadedFile(...) called at [/var/www/stats.example.com/docroot/plugins/UserCountry/GeoIPAutoUpdater.php:158]<br />
#10  Piwik\Plugins\UserCountry\GeoIPAutoUpdater->downloadFile(...) called at [/var/www/stats.example.com/docroot/plugins/UserCountry/GeoIPAutoUpdater.php:102]<br />
#11  Piwik\Plugins\UserCountry\GeoIPAutoUpdater->update(...) called at [:]<br />
#12  call_user_func(...) called at [/var/www/stats.example.com/docroot/core/TaskScheduler.php:196]<br />
#13  Piwik\TaskScheduler::executeTask(...) called at [/var/www/stats.example.com/docroot/core/TaskScheduler.php:133]<br />
#14  Piwik\TaskScheduler->doRunTasks(...) called at [/var/www/stats.example.com/docroot/core/TaskScheduler.php:83]<br />
#15  Piwik\TaskScheduler::runTasks(...) called at [/var/www/stats.example.com/docroot/plugins/CoreAdminHome/API.php:41]<br />
#16  Piwik\Plugins\CoreAdminHome\API->runScheduledTasks(...) called at [:]<br />
#17  call_user_func_array(...) called at [/var/www/stats.example.com/docroot/core/API/Proxy.php:213]<br />
#18  Piwik\API\Proxy->call(...) called at [/var/www/stats.example.com/docroot/core/API/Request.php:220]<br />
#19  Piwik\API\Request->process(...) called at [/var/www/stats.example.com/docroot/plugins/API/Controller.php:34]<br />
#20  Piwik\Plugins\API\Controller->index(...) called at [:]<br />
#21  call_user_func_array(...) called at [/var/www/stats.example.com/docroot/core/FrontController.php:117]<br />
#22  Piwik\FrontController->dispatch(...) called at [/var/www/stats.example.com/docroot/index.php:62]<br />
</div><br />
 </pre></div><br />'

Once php-pear is installed the error goes away and the system works fine.

I've confirmed this bug several times on debain 6/7

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugFor errors / faults / flaws / inconsistencies etc.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions