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

Error when running cron_esi.php #97

Open
StinGer-ShoGuN opened this issue Nov 27, 2018 · 4 comments
Open

Error when running cron_esi.php #97

StinGer-ShoGuN opened this issue Nov 27, 2018 · 4 comments

Comments

@StinGer-ShoGuN
Copy link
Contributor

Running cron_esi.php from crontab or through php-fpm (i.e. accessing cron/cron_esi.php from a web browser) fails with the following log:

"NOTICE: PHP message: PHP Warning:  curl_error(): supplied resource is not a valid cURL handle resource in /path/to/kb/common/includes/esi/class.esisso.php on line 428"
"NOTICE: PHP message: PHP Fatal error:  Uncaught EDK\ESI\EdkSsoException: Error querying OAUTH SSO server while fetching refreshed OAUTH SSO access access token: (HTTP Code: 0) in /path/to/kb/common/includes/esi/class.esisso.php:431"
"Stack trace:"
"#0 /path/to/kb/common/includes/esi/class.esisso.php(76): EDK\ESI\ESISSO->refreshAccessToken(false)"
"#1 /path/to/kb/common/includes/esi/class.esifetch.php(62): EDK\ESI\ESISSO->__construct('1')"
"#2 /path/to/kb/common/includes/esi/class.esifetch.php(86): EDK\ESI\ESIFetch::getByID('1')"
"#3 /path/to/kb/cron/cron_esi.php(27): EDK\ESI\ESIFetch::getAll()"
"#4 {main}"
"  thrown in /path/to/kb/common/includes/esi/class.esisso.php on line 431"

I have PHP 7.1.22 and curl 7.61.1. I think I made an update on curl not so long ago, and this is when the issue arose.

It seems the problem is caused by IPv6: curl is looking for an AAAA record for esi.evetech.com, which does not exist.
The solution is to tell curl to use IPv4 and look fo an A record.

When I have time, I will try to add this settings to curl configuration. In the meantime, if someone wants to fix it, I'll be more than happy.

@Salvoxia
Copy link
Member

Hi,

nice catch!
Could you please check if this resolves the issue?
b9b155f

Best Regards,
Salvoxia

@StinGer-ShoGuN
Copy link
Contributor Author

Sorry for the Close/Open: I misclicked (yeah, I know, I need new fingers, maybe new brain as well...).

@StinGer-ShoGuN
Copy link
Contributor Author

Regarding the commit, nope, it doesn't solve the issue.

Also forgot to mention that it also affects the "Fetch kills" button in the SSO Keys page of the admin panel.

Now, I said the issue was with curl and IPv6 but I might be wrong...

Digging a bit further, I find that curl_close is called too early: the handle is closed on line 424 in class_esisso.php, but accessed further on line 428 if there is no result.
I created pull request #99 to fix this. Now, the message changes to:

"NOTICE: PHP message: PHP Fatal error:  Uncaught EDK\ESI\EdkoException: Error querying OAUTH SSO server while fetching refreshed OAUTH SSO access access token: Could not resolve host: login.eveonlincom(HTTP Code: 0) in /path/to/kb/common/includes/esi/class.esisso.php:430"
"Stack trace:"
"#0 /path/to/kb/common/includes/e/class.esisso.php(76): EDK\ESI\ESISSO->refreshAccessToken(false)"
"#1 /path/to/kb/common/includes/e/class.esifetch.php(62): EDK\ESI\ESISSO->__construct('1')"
"#2 /path/to/kb/common/includes/e/class.esifetch.php(86): EDK\ESI\ESIFetch::getByID('1')"
"#3 /path/to/kb/cron/cron_esi.php7): EDK\ESI\ESIFetch::getAll()"
"#4 {main}"
"  thrown in /path/to/kb/common/iludes/esi/class.esisso.php on line 430"

Which is what led me to say it was an IPv6 related issue.

I need to dig this further to find the core issue.

@Salvoxia
Copy link
Member

Salvoxia commented Nov 27, 2018

Well, it might still be an IPv6 issue, since silly me didn't remember that cURL is used in different places. Your error was thrown when refreshing the access token, and there the IPv4 IP resolution setting is not present.
Might still be worth a try.

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

2 participants