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
You cannot create React\Promise\FulfilledPromise #996
Comments
Can you give a stack trace?
|
Of course: #0 */vendor/guzzlehttp/guzzle/src/RequestFsm.php(173): GuzzleHttp\Exception\RequestException::wrapException(Object(GuzzleHttp\Message\Request), Object(InvalidArgumentException)) #1 */vendor/guzzlehttp/guzzle/src/RequestFsm.php(92): GuzzleHttp\RequestFsm->error(Object(GuzzleHttp\Transaction)) #2 */vendor/guzzlehttp/guzzle/src/Client.php(245): GuzzleHttp\RequestFsm->__invoke(Object(GuzzleHttp\Transaction)) Edit: That is from XDebug:
|
Thanks. Can you update to the latest version of Guzzle? Is there a reproducible snippet of code you can provide that I can play around with? |
Still same problem. The request is very simple: $body = 'valid xml'; $request->setHeader('Content-Type', 'text/xml'); BTW I just saw two warnings before exception:
|
I just found the problem: This is my other question, how can I modify response before ANY validation? I'm integrating with XML API which is returning ALWAYS HTTP Status = 0 ? I need to modify Status to be always 200 so it won't broke Guzzle. |
Weird. That could be a bug in Guzzle. Are you sure that the service actually returns a status of |
Yes, everything is ok with raw curl. Status is 0. https://github.com/guzzle/RingPHP/blob/master/src/Client/CurlFactory.php#L89 https://github.com/guzzle/RingPHP/blob/master/src/Client/CurlFactory.php#L108 - There is no real error, actually request is succesfull. https://github.com/guzzle/RingPHP/blob/master/src/Client/CurlFactory.php#L109 = yes, it's empty. so, it call internally retryFailedRewing calls recursively https://github.com/guzzle/RingPHP/blob/master/src/Client/CurlHandler.php#L60 which return CompletedFutureArray and outside of that call is wrapped again with CompletedFutureArray If i set Also there isn't any headers. |
$array["key"] = 0;
var_dump(isset($array["key"]));
bool(true) So the problem is not that the status is
Can you debug this block? In particular, this line. If it sets the value to The following could explain a lot too though, but the statement is rather vague...
Can you elaborate? You mean the API you are calling does not return any headers at all? |
Yes, the remote API we call does not return any headers. This is curl_info: 'content_type' => null |
Well... that is one seriously broken API. |
It's API of payment broker. :) Data is in XML. (Also the status code) |
I don't really know how to deal with this. If a subscriber with a I would definitely contact your payment broker though and ask them why their API is so broken, and request that they fix it. I've worked with a lot of payment providers in the past, and I have never encountered something like this before. |
I tried to make them fix it, but they don't want to do it. I tried and the following: |
Not returning a status code or headers is not a valid HTTP response. I don't think guzzle needs to be modified to support that type of response. Maybe better error reporting would have been better though, and I'd gladly accept a PR along those lines. |
InvalidArgumentException: You cannot create React\Promise\FulfilledPromise with a promise. Use React\Promise\resolve($promiseOrValue) instead. in /*/vendor/react/promise/src/FulfilledPromise.php on line 12
Any ideas?
The text was updated successfully, but these errors were encountered: