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

Bug in guzzle with PHP Version 7.3.0 #1561

Closed
drrhf opened this issue Dec 8, 2018 · 8 comments
Closed

Bug in guzzle with PHP Version 7.3.0 #1561

drrhf opened this issue Dec 8, 2018 · 8 comments
Assignees
Labels
status: investigating The issue is under investigation, which is determined to be non-trivial. type: question Request for information or clarification. Not an issue.

Comments

@drrhf
Copy link

drrhf commented Dec 8, 2018

I have a problem with PHP Version 7.3.0 (similar to what I had earlier with bug #1507).

I am using the latest release: google-api-php-client-2.2.2., which apparently uses Guzzle 6.3.
My code works perfectly now with PHP Version 7.2.8.
However, when I switch to PHP Version 7.3.0, I get the following error:

fseek() expects parameter 3 to be int, array given

[C:/wamp64/f3.6.4/lib/base.php:2219] Base->error()
[C:/wamp64/creds/google-api-php-client-2.2.2/vendor/guzzlehttp/psr7/src/Stream.php:199] fseek()
[C:/wamp64/creds/google-api-php-client-2.2.2/vendor/guzzlehttp/psr7/src/Stream.php:93] GuzzleHttp\Psr7\Stream->seek()
[C:/wamp64/creds/google-api-php-client-2.2.2/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:256] GuzzleHttp\Psr7\Stream->__toString()
[C:/wamp64/creds/google-api-php-client-2.2.2/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:224] GuzzleHttp\Handler\CurlFactory->applyBody()
[C:/wamp64/creds/google-api-php-client-2.2.2/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:42] GuzzleHttp\Handler\CurlFactory->applyMethod()
[C:/wamp64/creds/google-api-php-client-2.2.2/vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php:39] GuzzleHttp\Handler\CurlFactory->create()
[C:/wamp64/creds/google-api-php-client-2.2.2/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php:28] GuzzleHttp\Handler\CurlHandler->__invoke()

It seems there may be a Guzzle statement that is incompatible with PHP Version 7.3.0.

Bob

@JustinBeckwith JustinBeckwith added the triage me I really want to be triaged. label Dec 9, 2018
@mattwhisenhunt mattwhisenhunt added the type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. label Dec 10, 2018
@JustinBeckwith JustinBeckwith removed the triage me I really want to be triaged. label Dec 10, 2018
@drrhf
Copy link
Author

drrhf commented Jan 8, 2019

Just wondered if you looked at this. There is a simple work-around, but I don't know the consequences.
In C:\wamp64\creds\google-api-php-client-2.2.2\vendor\guzzlehttp\psr7\src\Stream.php
replace Line 199

-      } elseif (fseek($this->stream, $offset, $whence) === -1) {
+      } elseif (fseek($this->stream, $offset) === -1) {

@danielgsims
Copy link

Hi @drrhf. I'm just getting up to speed here and haven't had a chance to look at this one. It sounds like you verified that this is an issue with Guzzle? Have you opened an issue for Guzzle on github?

I don't know what has changed there between Guzzle versions and PHP versions, but altering vendor code isn't a great solution; composer will inevitably overwrite that file and you will lose your change.

I will review this in depth soon and verify that we're interfacing with Guzzle correctly. Could you provide me a sample of your code that leads to your stack trace above?

@danielgsims danielgsims added type: question Request for information or clarification. Not an issue. status: investigating The issue is under investigation, which is determined to be non-trivial. and removed type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. labels Jan 13, 2019
@drrhf
Copy link
Author

drrhf commented Jan 13, 2019

Have you opened an issue for Guzzle on github? No.

altering vendor code isn't a great solution; composer will inevitably overwrite that file and you will lose your change. I agree.

Could you provide me a sample of your code that leads to your stack trace above? This will take me some time and I am not sure how useful it will be to you. I use a MVC architecture, with different operations in several different files.

I think the key point is that the code works perfectly with PHP version 7.2.8.
It fails with the errors above when I switch to PHP version 7.3.0, and it works fine with version 7.3.0 when I remove the $whence argument from the fseek function call above.

It seems that maybe there was a change in the fseek function between the two PHP versions.

@jdpedrie
Copy link
Contributor

jdpedrie commented Apr 9, 2019

This has been fixed upstream.

guzzle/psr7@08d8706

@jdpedrie jdpedrie closed this as completed Apr 9, 2019
@drrhf
Copy link
Author

drrhf commented May 16, 2019

Hi @jdpedrie.

I made the fix you cited in my local code and the program works properly.
It would be nice if that change could be incorporated in the latest release on
https://github.com/googleapis/google-api-php-client/releases
for those of us who "abhor using composer".

Thanks, Bob

@jdpedrie
Copy link
Contributor

@drrhf I'll work on getting something released this week.

@jdpedrie
Copy link
Contributor

@drrhf
Copy link
Author

drrhf commented May 24, 2019

Thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: investigating The issue is under investigation, which is determined to be non-trivial. type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

5 participants