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

static:warm command failing #4749

Closed
jonassiewertsen opened this issue Nov 16, 2021 · 13 comments
Closed

static:warm command failing #4749

jonassiewertsen opened this issue Nov 16, 2021 · 13 comments

Comments

@jonassiewertsen
Copy link
Contributor

jonassiewertsen commented Nov 16, 2021

Bug description

If running static:warm on a production site I get the following error:

Screenshot 2021-11-16 at 18 37 02

How to reproduce

I am not sure how this can be reproduced. As our site has round about 3.000 entries, I am not sure how this is related.

The page is not doing anything fancy, the does simply has a few more entries than normal.

Logs

Statamic\Console\Commands\StaticWarm::outputFailureLine(): Argument #1 ($exception) must be of type Psr\Http\Client\ClientExceptionInterface, GuzzleHttp\Exception\ClientException given at vendor/statamic/cms/src/Console/Commands/StaticWarm.php:78

Versions

Statamic 3.2.22 Pro
Laravel 7.30.4
PHP 8.0.3
pecotamic/sitemap 1.2.7
spatie/statamic-responsive-images 2.8.5
statamic/seo-pro 2.3.2

Installation

Other (please explain)

Additional details

No response

@jasonvarga
Copy link
Member

Okay, the real exception is being masked by this output one.

I wonder if it's related to #4746.

@jonassiewertsen
Copy link
Contributor Author

It might be related somehow for sure.

The errors are a little different though:
This Error does get thrown if warming the stache stache:warm

Issue #4746 does get thrown if updating the search and the Algolia driver search:update.

@jasonvarga
Copy link
Member

I understand they happen at different times. But in both cases you are interacting with entries, so maybe the problem entry is triggering the error in both cases.

@jonassiewertsen
Copy link
Contributor Author

That's really likely.

@jonassiewertsen
Copy link
Contributor Author

This is odd ... as descried in #4746, I had problems using Algolia to search in the cp.

Setting searchables inside the config/statamic/search.php to all does include assets.
As far as I did set searchables to explicit collections only, everything does work as expected.

This error message from my logs might help

[2021-11-16 20:36:16] production.ERROR: Call to undefined method Statamic\Assets\Asset::collection() {"userId":"XXXX","exception":"[object] (Error(code: 0): Call to undefined method Statamic\\Assets\\Asset::collection() at /home/forge/production.page.com/vendor/statamic/cms/src/Http/Resources/CP/Entries/ListedEntry.php:31)

Somehow the ListedEntry class does try to get a collection from an Asset ... this will not work.

I couldn't dig deeper but am hoping that this will help.

@jonassiewertsen
Copy link
Contributor Author

This is odd ... as descried in #4746, I had problems using Algolia to search in the cp.

Setting searchables inside the config/statamic/search.php to all does include assets. As far as I did set searchables to explicit collections only, everything does work as expected.

This error message from my logs might help

[2021-11-16 20:36:16] production.ERROR: Call to undefined method Statamic\Assets\Asset::collection() {"userId":"XXXX","exception":"[object] (Error(code: 0): Call to undefined method Statamic\\Assets\\Asset::collection() at /home/forge/production.page.com/vendor/statamic/cms/src/Http/Resources/CP/Entries/ListedEntry.php:31)

Somehow the ListedEntry class does try to get a collection from an Asset ... this will not work.

I couldn't dig deeper but am hoping that this will help.

It seems that those issues are not related.

@arthurperton
Copy link
Contributor

Statamic\Console\Commands \StaticWarm: :outputFailureLine(): Argument #1 ($exception) must be of tvpe
Pr\Http\Client\ClientExceptionInterface, GuzzleHttp\Exception\ClientException given

I am puzzled, as GuzzleHttp\Exception\ClientException actually inherits from a class that implements Pr\Http\Client\ClientExceptionInterface.

Maybe it has to do with the installed Guzzle version? Looking at my composer.lock file I am on Guzzle v7.4.1. @jonassiewertsen if this issue still happens for you, can you share the version of Guzzle you have installed please?

@jonassiewertsen
Copy link
Contributor Author

@arthurperton I don't have access to that project anymore, but I asked for the version from someone who has.

@juliawarnke
Copy link
Contributor

@jonassiewertsen and @arthurperton. The installed Guzzle version is 6.5.5.

@jasonvarga
Copy link
Member

Unless you are using Guzzle 6 for a specific reason, we suggest you just update to version 7 of guzzlehttp/guzzle.

That should resolve the issue. We'll reopen the issue if you really need Guzzle 6.

@enxoco
Copy link

enxoco commented Feb 3, 2022

I too am experiencing this same issue on a site I am migrating from Statamic 2 to Statamic 3.

image

@jasonvarga
Copy link
Member

Upgrade to Guzzle 7.

@enxoco
Copy link

enxoco commented Feb 3, 2022

@jasonvarga Thanks. I was initially having an issue upgrading Guzzle because I had a custom plugin requiring guzzle6-adaptor but I got it sorted. Upgrading Guzzle solved the issue for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants