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

Core:archive error #16719

Open
pixel8383 opened this issue Nov 15, 2020 · 8 comments
Open

Core:archive error #16719

pixel8383 opened this issue Nov 15, 2020 · 8 comments

Comments

@pixel8383
Copy link

Every day I get this error from my Matomo installation:

ERROR [2020-11-15 22:59:05] 3  Error unserializing the following response from ?module=API&method=API.get&idSite=1&period=week&date=last2&format=php&trigger=archivephp: Got invalid response from API request: https://mysite.it/piwik/?module=API&method=API.get&idSite=1&period=week&date=last2&format=php&trigger=archivephp&token_auth=removed. Response was 'curl_exec: Could not resolve host: mysite.it. Hostname requested was: mysite.it'
ERROR [2020-11-15 22:59:05] 3  1 total errors during this script execution, please investigate and try and fix these errors.
ERROR [2020-11-15 22:59:05] 3  Uncaught exception: /home/webuser/public_html/mysite/piwik/core/CronArchive.php(606): 1 total errors during this script execution, please investigate and try and fix these errors.
1 total errors during this script execution, please investigate and try and fix these errors.
#0 /home/webuser/public_html/mysite/piwik/core/CronArchive.php(599): Piwik\CronArchive->logFatalError('1 total errors ...')
#1 /home/webuser/public_html/mysite/piwik/core/CronArchive.php(331): Piwik\CronArchive->end()
#2 /home/webuser/public_html/mysite/piwik/core/Access.php(635): Piwik\CronArchive->Piwik\{closure}()
#3 /home/webuser/public_html/mysite/piwik/core/CronArchive.php(335): Piwik\Access::doAsSuperUser(Object(Closure))
#4 /home/webuser/public_html/mysite/piwik/plugins/CoreConsole/Commands/CoreArchiver.php(27): Piwik\CronArchive->main()
#5 /home/webuser/public_html/mysite/piwik/vendor/symfony/console/Symfony/Component/Console/Command/Command.php(257): Piwik\Plugins\CoreConsole\Commands\CoreArchiver->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#6 /home/webuser/public_html/mysite/piwik/vendor/symfony/console/Symfony/Component/Console/Application.php(874): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#7 /home/webuser/public_html/mysite/piwik/vendor/symfony/console/Symfony/Component/Console/Application.php(195): Symfony\Component\Console\Application->doRunCommand(Object(Piwik\Plugins\CoreConsole\Commands\CoreArchiver), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 [internal function]: Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 /home/webuser/public_html/mysite/piwik/core/Console.php(140): call_user_func(Array, Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 /home/webuser/public_html/mysite/piwik/core/Access.php(644): Piwik\Console->Piwik\{closure}()
#11 /home/webuser/public_html/mysite/piwik/core/Console.php(141): Piwik\Access::doAsSuperUser(Object(Closure))
#12 /home/webuser/public_html/mysite/piwik/core/Console.php(93): Piwik\Console->doRunImpl(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 /home/webuser/public_html/mysite/piwik/vendor/symfony/console/Symfony/Component/Console/Application.php(126): Piwik\Console->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 /home/webuser/public_html/mysite/piwik/console(32): Symfony\Component\Console\Application->run()
#15 {main}


                                                                                                 
  [Exception]                                                                                    
  1 total errors during this script execution, please investigate and try and fix these errors.  

(I changed my website name with mysite.it)

I already tried to check the host resolution via SSH with host mysite.it and the machine can resolve the name correctly.

What can I do in order to fix it?

@tsteur
Copy link
Member

tsteur commented Nov 15, 2020

Hi @pixel8383 thanks for creating this issue. It sounds like some kind of server configuration issue to me which we might not be able to help with here and you might be better off asking this question in our forum: https://forum.matomo.org/

Can you confirm the actual domain it is trying to fetch the data from is correct? (the original domain you replaced with mysite.it)

In case you are familiar with MySQL and can access the database, any chance you could also verify the URL/domain shown when executing below query is correct and it if eg https is used, that the webserver supports this?

select * from matomo_option where option_name like '%piwikurl%'

@pixel8383
Copy link
Author

Hello @tsteur thanks for your support. I did the query as you suggested and later I tested via SSH the url I got with "curl ". Everything was fine, what I got is a login webpage to piwik/matomo. So, the url to fetch is correct.

@tsteur
Copy link
Member

tsteur commented Nov 16, 2020

@pixel8383 I suggest you ask for more help in the forum (or on stackoverflow).

If you search for curl_exec: Could not resolve host . Hostname requested was you might also get more information such as https://stackoverflow.com/questions/1341644/curl-and-https-cannot-resolve-host

I'm wondering if there's some issue with IPv4 and IPv6 and that PHP resolves to different IP (pretty sure we've seen this before and there's also #11508 )

in case you are familiar with editing PHP files: For one user it helped to add a new line around https://github.com/matomo-org/matomo/blob/3.14.1/core/Http.php#L591 with such content: curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 );

any chance can you disable/enable IPv6 on your server and see if it changes anything?

@pixel8383
Copy link
Author

Unfortunately I cannot setup the network (I am on a Shared Hosting, I installed Matomo using Softaculous (and I loved to share Matamo as perfect alternative to Google Analytics). I couldn't locate where to insert that content (I mean, I can edit the file but can't locate the line). What I don't get is that the url is fetched fine if I directly try to curl it on the machine, seems like something PHP related maybe.

@pixel8383
Copy link
Author

I just tried to setup a test php file as shown here and the https website is fetched fine.

@tsteur
Copy link
Member

tsteur commented Nov 16, 2020

@pixel8383 any chance maybe a proxy is configured in the config/config.ini.php? Like

[proxy]
host = ...
port = ...

Matomo sets a few more options see the lines in https://github.com/matomo-org/matomo/blob/3.14.1/core/Http.php#L547-L632

In case you are familiar with PHP you could some lines one after another and see if it eventually starts working and maybe this way find out why it is failing

@pixel8383
Copy link
Author

Hello @tsteur sorry for the delay in my answer. No, there is not any proxy configured inside the config.ini.php file. The issue is still there.

@tsteur
Copy link
Member

tsteur commented Jan 12, 2021

@pixel8383 It sounds like some kind of webserver configuration where we might not be able to help. Is it maybe possible that we get access to your server aka to the files where Matomo is installed on your server and ideally also a way to execute commands (eg through SSH) so we can try and reproduce and then debug this problem?

It might also help to post this question eg in our forum https://forum.matomo.org/ or on stackoverflow or so as it might not be related to Matomo (but considering it works when you test it like mentioned in #16719 (comment) it could be an issue with Matomo). We are just not able to reproduce it unfortunately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants