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

Fatal Error on Guzzle dependency #512

Closed
jjtroberts opened this issue Jul 1, 2020 · 5 comments
Closed

Fatal Error on Guzzle dependency #512

jjtroberts opened this issue Jul 1, 2020 · 5 comments

Comments

@jjtroberts
Copy link

I just updated guzzle via composer:
guzzlehttp/guzzle (6.5.4 => 6.5.5)

Using WordPress 5.4.2, PHP 7.3 and wp-stateless 2.3.2

( ! ) Fatal error: Uncaught Error: Undefined class constant 'MAJOR_VERSION' in /var/www/html/vendor/guzzlehttp/guzzle/src/Utils.php on line 121
--
1 | 0.0324 | 3606504 | {main}( ) | .../plugins.php:0
2 | 0.0327 | 3655168 | require_once( '/var/www/html/web/wp/wp-admin/admin.php' ) | .../plugins.php:10
3 | 0.0328 | 3669808 | require_once( '/var/www/html/web/wp/wp-load.php' ) | .../admin.php:34
4 | 0.0329 | 3671464 | require_once( '/var/www/html/web/wp-config.php' ) | .../wp-load.php:42
5 | 0.0435 | 5185168 | require_once( '/var/www/html/web/wp/wp-settings.php' ) | .../wp-config.php:9
6 | 0.5137 | 59299824 | do_action( ) | .../wp-settings.php:403
7 | 0.5137 | 59300200 | WP_Hook->do_action( ) | .../plugin.php:478
8 | 0.5137 | 59300200 | WP_Hook->apply_filters( ) | .../class-wp-hook.php:311
9 | 0.8996 | 86941440 | wpCloud\StatelessMedia\Bootstrap->pre_init( ) | .../class-wp-hook.php:287
10 | 0.8996 | 86941440 | wpCloud\StatelessMedia\Bootstrap->init( ) | .../class-bootstrap-plugin.php:56
11 | 0.9105 | 87440344 | wpCloud\StatelessMedia\Bootstrap->is_connected_to_gs( ) | .../class-bootstrap.php:155
12 | 0.9214 | 88140416 | wpCloud\StatelessMedia\GS_Client->is_connected( ) | .../class-bootstrap.php:1180
13 | 0.9214 | 88140416 | wpCloud\StatelessMedia\Google_Client\Google_Service_Storage_Resource_Buckets->get( ) | .../class-gs-client.php:365
14 | 0.9214 | 88141168 | wpCloud\StatelessMedia\Google_Client\Google_Service_Storage_Resource_Buckets->call( ) | .../Buckets.php:70
15 | 0.9251 | 88516960 | wpCloud\StatelessMedia\Google_Client\Google_Client->execute( ) | .../Resource.php:233
16 | 0.9251 | 88518384 | wpCloud\StatelessMedia\Google_Client\Google_Client->authorize( ) | .../Client.php:797
17 | 0.9251 | 88518384 | wpCloud\StatelessMedia\Google_Client\Google_Client->getHttpClient( ) | .../Client.php:356
18 | 0.9251 | 88518384 | wpCloud\StatelessMedia\Google_Client\Google_Client->createDefaultHttpClient( ) | .../Client.php:1043
19 | 0.9258 | 88585112 | GuzzleHttp\Client->__construct( ) | .../Client.php:1069
20 | 0.9293 | 88947480 | GuzzleHttp\Client->configureDefaults( ) | .../Client.php:75
21 | 0.9297 | 88979296 | GuzzleHttp\default_user_agent( ) | .../Client.php:194
22 | 0.9297 | 88979296 | GuzzleHttp\Utils::defaultUserAgent( ) | .../functions.php:61
@jjtroberts
Copy link
Author

jjtroberts commented Jul 1, 2020

Please disregard as this was unrelated to wp-stateless. I was using spatie/crawler with dependencies unpinned, so it pulled in guzzle and few other updates that I think are related to:
guzzle/guzzle#2678
guzzle/guzzle#2579

I removed spatie/crawler and redeployed, site works fine.

@ckeeney
Copy link
Contributor

ckeeney commented Jul 23, 2020

I ran into this, and I think it's because Guzzle 7 recently was released. I'm not using spatie/crawler, but my composer.lock shows quite a few other plugins supporting Guzzle 7, and when that was installed it conflicted with the version of Guzzle committed in this repo.

Maybe this issue should be re-opened... Is there a way to reorganize this plugin so Guzzle is a dependency installed by composer?

As a work-around, I added "guzzlehttp/guzzle": "6.5.5", to my own composer.json.

@Inwerpsel
Copy link

We also ran into this issue and needed to do the same workaround as @ckeeney . Weird that this didn't get any attention yet as it seems easy to avoid and completely breaks the functionality with a fatal error if it occurs. I opened a quick draft PR to add the depenency #618

@Inwerpsel
Copy link

I did overlook that we are still using 2.x, so I didn't test if the issue still occurs in the latest version, which my current draft PR targets.

@Ref34t
Copy link

Ref34t commented Aug 20, 2021

@Inwerpsel can you elaborate on the workaround @ckeeney mentioned I'm not able apply it

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

4 participants