ekinhbayar / gitamp

Listen to music generated by events across github.
MIT License
29 stars 10 forks source link

v2_rewrite #45

Closed ekinhbayar closed 7 years ago

ekinhbayar commented 7 years ago

May I keep this issue open for issues and questions that come up when debugging/rewriting gitamp for amp v2 @kelunik, @trowski, everyone?

To start with, here is what I look at when I try to run it on v2_rewrite branch.

If I try to get the previous exception in BasicClient, var_dump($dnsException->getPrevious()->getMessage()); It shows me string(27) "Multiple errors encountered", which is also on above gist. Btw, getReasons() is undefined, @kelunik. Am I doing something wrong here?

kelunik commented 7 years ago

@ekinhbayar Probably, yes, see https://github.com/amphp/amp/blob/bb1db1609fb1a07bbb621e944dd4c170af3319e7/lib/MultiReasonException.php#L22-L24.

ekinhbayar commented 7 years ago

If I catch the MultiReasonException and call for getReasons() I end up with this dump ... @kelunik. Also I found out, if I disable OPcache and rerun it again, I get

[2017-06-30 20:13:03] gitamp.ERROR: Failed to send GET request to API endpoint {"exception":"[object] (Amp\Artax\DnsException(code: 0): Resolving the specified domain failed: 'api.github.com:443' at /home/ekinhb/PhpstormProjects/gitampLatest/vendor/amphp/artax/lib/BasicClient.php:351, Amp\Dns\NoRecordException(code: 0): No records returned for api.github.com at /home/ekinhb/PhpstormProjects/gitampLatest/vendor/amphp/dns/lib/BasicResolver.php:247)"} [] [2017-06-30 20:13:03] critical Amp\Dns\NoRecordException: No records returned for api.github.com in /home/ekinhb/PhpstormProjects/gitampLatest/vendor/amphp/dns/lib/BasicResolver.php:247

first.

kelunik commented 7 years ago

I really don't get why it's failing with

string(235) "Argument 1 passed to Amp\Dns\BasicResolver::assertAcceptableResponse() must be an instance of LibDNS\Messages\Message, array given, called in /home/ekinhb/PhpstormProjects/gitampLatest/vendor/amphp/dns/lib/BasicResolver.php on line 212"

As far as I can see from the trace, it's a Message object and no array. Could you try dumping the result inside BasicResolver?

ekinhbayar commented 7 years ago

This gist have both cases @kelunik, with and without OPcache enabled here.

Err... Edit: Sorry, I pasted it in reverse order...I updated the gist now. If I have OPcache enabled it is an empty array.

kelunik commented 7 years ago

There's definitely a bug in OPCache.

ekinhbayar commented 7 years ago

Yes, that's what I believe as well.

kelunik commented 7 years ago

See amphp/dns#58.

ekinhbayar commented 7 years ago

BTW, these are what I see when I run amphp/dns tests on my end @kelunik.

kelunik commented 7 years ago

Yes, looks pretty much like that here, too. Works fine without OPCache.

ekinhbayar commented 7 years ago

Looking at this bit made me worried about my own dev environment as I still have Errors: 9, Failures: 1.

Edit: It was indeed my own dns issue.