spicywebau / craft-embedded-assets

Manage YouTube videos, Instagram photos and more as first class assets in Craft CMS
MIT License
171 stars 35 forks source link

No longer able to embed anything #265

Closed peteeveleigh closed 3 months ago

peteeveleigh commented 3 months ago

Bug Description

The plugin has been working fine but we have just received a report from our client informing us that it is no longer working when trying to embed a Vimeo video.

Testing has shown that the same issue occurs with any type media, not just Vimeo. I've tried Vimeo, YouTube, Google Maps, X, Instagram, and a regular web page.

When attempting the embed, we see a message in the Craft CP saying "Could not retrieve the embed information"

Also a JS error in the console

https://www.client.org/adminurl/actions/embeddedassets/actions/preview?showContent=1&callback=embeddedassetsiam2uguyfhq6&url=https%3A%2F%2Fvimeo.com%2F949584866%3Fshare%3Dcopy 500 (Internal Server Error)

Which seems to just indicate that the resource couldn't be loaded.

We see an error like this in the server logs

`RuntimeException: No ResponseFactoryInterface detected in /home/forge/www.client.org/vendor/embed/embed/src/Http/FactoryDiscovery.php:61 Stack trace:

0 /home/forge/www.client.org/vendor/embed/embed/src/Http/CurlClient.php(21): Embed\Http\FactoryDiscovery::getResponseFactory()

1 /home/forge/www.client.org/vendor/spicyweb/craft-embedded-assets/src/Service.php(156): Embed\Http\CurlClient->__construct()

2 /home/forge/www.client.org/vendor/spicyweb/craft-embedded-assets/src/Service.php(79): spicyweb\embeddedassets\Service->_getDataFromEmbed()

3 /home/forge/www.client.org/vendor/spicyweb/craft-embedded-assets/src/Controller.php(207): spicyweb\embeddedassets\Service->requestUrl()

4 [internal function]: spicyweb\embeddedassets\Controller->actionPreview()

5 /home/forge/www.client.org/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array()

6 /home/forge/www.client.org/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams()

7 /home/forge/www.client.org/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction()

8 /home/forge/www.client.org/vendor/craftcms/cms/src/web/Application.php(340): yii\base\Module->runAction()

9 /home/forge/www.client.org/vendor/craftcms/cms/src/web/Application.php(641): craft\web\Application->runAction()

10 /home/forge/www.client.org/vendor/craftcms/cms/src/web/Application.php(302): craft\web\Application->_processActionRequest()

11 /home/forge/www.client.org/vendor/yiisoft/yii2/base/Application.php(384): craft\web\Application->handleRequest()

12 /home/forge/www.client.org/web/index.php(21): yii\base\Application->run()

13 {main}`

The site is being served through Cloudflare with RocketLoader but I have just tried disabling that and still the problem persists.

Do you have any idea what might be causing this problem?

Steps to reproduce

I think this might be a localised issue rather than a plugin issue per se but...

  1. Try to embed the following video https://vimeo.com/949584866?share=copy. But, as I say, we have the problem with any kind of Asset

Expected behaviour

Asset should be embedded

Embedded Assets version

4.1.0

Craft CMS version

Craft Pro 4.10.2

peteeveleigh commented 3 months ago

Rolling back to 3.2.0 fixes the issue locally

Looks like 4.0.0 still works too But the problem occurs when installing 4.0.1

ttempleton commented 3 months ago

That error message suggests that none of these classes exists for your Craft install. I've just run a fresh install of Craft 4 and confirmed that the GuzzleHttp\Psr7\HttpFactory class does exist, so I'm guessing that has somehow gone missing in your Craft install, and you will need to reinstall your Composer packages.

peteeveleigh commented 3 months ago

@ttempleton I ran composer update when downgrading/upgrading so that should have taken care of any missing classes should it not?

I'll give it a go though and report back.