GuzzleHttp Exception in PHP 7

Created on 5 December 2015, about 9 years ago
Updated 20 May 2024, 7 months ago

After upgrading PHP to 7.0, nodes that contain oEmbed elements became inaccessible, due to the following errors:

GuzzleHttp\Exception\RequestException: cURL error 3: <url> malformed (see http://curl.haxx.se/libcurl/c/libcurl-errors.html) in GuzzleHttp\Handler\CurlFactory::createRejection() (line 187 of vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php).
GuzzleHttp\Handler\CurlFactory::finishError(Object, Object, Object)
GuzzleHttp\Handler\CurlFactory::finish(Object, Object, Object)
GuzzleHttp\Handler\CurlMultiHandler->processMessages()
GuzzleHttp\Handler\CurlMultiHandler->tick()
GuzzleHttp\Handler\CurlMultiHandler->execute(1)
GuzzleHttp\Promise\Promise->invokeWaitFn()
GuzzleHttp\Promise\Promise->waitIfPending()
GuzzleHttp\Promise\Promise->invokeWaitList()
GuzzleHttp\Promise\Promise->waitIfPending()
GuzzleHttp\Promise\Promise->wait()
GuzzleHttp\Client->request('get', '//ckeditor.iframe.ly/api/oembed?url=https://www.youtube.com/watch?v=h3DUlII23pk', Array)
GuzzleHttp\Client->__call('get', Array)
Drupal\ckeditor_media_embed\Embed->getEmbedObject('https://www.youtube.com/watch?v=h3DUlII23pk')

It seems that the oembed url that starts with "//" is causing the problem. I tried curl "//ckeditor.iframe.ly" in command line and got the same error <url> malformed.

Workaround

  • Manually change provider URL to something like http://ckeditor.iframe.ly/api/oembed?url={url}&callback={callback} in config file ckeditor_media_embed.settings.yml, since the Administration UI does not allow provider URLs that have http:// or https:// in them.
  • You can use drush to change the config.
    drush config-edit ckeditor_media_embed.settings
🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

No activities found.

Production build 0.71.5 2024