Closed amjad1233 closed 3 years ago
Hi @amjad1233
We had this issue crop up in a Drupal site using oembed. This is related to the "https://oembed.com/providers.json" file returning a 200 (i.e. so it passes checks), but returning bad file contents via curl:
`$ curl "https://oembed.com/providers.json"
Fatal error: Uncaught Error: Call to undefined function yaml_parse_file() in /var/www/html/oembed.com/www/json.php:14
Stack trace:
thrown in /var/www/html/oembed.com/www/json.php on line 14
`
`$ php -r "var_dump(file_get_contents('https://oembed.com/providers.json'));"
string(237) "
Fatal error: Uncaught Error: Call to undefined function yaml_parse_file() in /var/www/html/oembed.com/www/json.php:14
Stack trace:
thrown in /var/www/html/oembed.com/www/json.php on line 14
`
It seems to work fine via a browser or with the Accept-Encoding header.
Potential resolution is to create a local copy of providers.json and serve it from local disk until oembed resolve the issue. We also suspect this could be a regional issue with a Cloudfront edge node having cached a bad copy of the endpoint (We're in AU region) as other regions seem to not have this issue.
Cheers,
Thanks @GuyRus we had the same issue on Drupal. I did create local copy and pointed it there which resolves the issue temporarily. The good thing was it was in config as well.
For any drupallers this may help.
drush cset media.settings oembed_providers_url "https://URL to local file"
Cloudfare could be right because we are using it as well, and we are in AU as well.
this should now be fixed
I am having this problem too. navigating to the url in the browser seems fine. But here is a curl request. I think I am testing this correctly
root@98084fd12b50:/var/www/html# curl https://oembed.com/providers.json
Fatal error: Uncaught Error: Call to undefined function yaml_parse_file() in /var/www/html/oembed.com/www/json.php:14
Stack trace:
thrown in /var/www/html/oembed.com/www/json.php on line 14
once all caches empty (should be in the next 10 mins) then it should be functional everywhere
once all caches empty (should be in the next 10 mins) then it should be functional everywhere
can do a purge cache in cloudflare? still not working in other countries.
Still failing in AUS via the SYD4-C2 CloudFront pop:
$ curl -v "https://oembed.com/providers.json"
...
* Connection state changed (MAX_CONCURRENT_STREAMS == 128)!
< HTTP/2 200
< content-type: text/plain; charset=utf-8
< content-length: 237
< date: Wed, 02 Dec 2020 20:50:59 GMT
< server: Apache
< vary: Accept-Encoding
< x-cache: Hit from cloudfront
< via: 1.1 bb9f263574d02812181ed6540110c7f3.cloudfront.net (CloudFront)
< x-amz-cf-pop: SYD4-C2
< x-amz-cf-id: yOVrMYCYz2wPx9vKUO-E6-2tHeCWgXuUkLV7KcUn7WbnCsAz-_VXBg==
< age: 28040
<
<br />
<b>Fatal error</b>: Uncaught Error: Call to undefined function yaml_parse_file() in /var/www/html/oembed.com/www/json.php:14
Stack trace:
#0 {main}
thrown in <b>/var/www/html/oembed.com/www/json.php</b> on line <b>14</b><br />
* Connection #0 to host oembed.com left intact
I tested a few IPs listed on https://www.whatsmydns.net/#A/oembed.com
Also failing from France on 143.204.226.104 (CDG3-C1).
Cloudfront is showing this with an age of 31000, ie about 8 hrs, so I'm not sure the purge worked
Not working from Norway
not working from Austria
Also not working in Belgium:
$ curl -v https://oembed.com/providers.json
...
* Connection state changed (MAX_CONCURRENT_STREAMS updated)!
< HTTP/2 200
< content-type: text/plain; charset=utf-8
< content-length: 237
< date: Thu, 03 Dec 2020 01:38:05 GMT
< server: Apache
< vary: Accept-Encoding
< x-cache: Hit from cloudfront
< via: 1.1 425cbe8f956bdcb8754c19eb873fd2d1.cloudfront.net (CloudFront)
< x-amz-cf-pop: AMS50-C1
< x-amz-cf-id: ry_PdDCHIewNn4z_Sn0Gf9DPt8ruWVkVT4ogHcLhsKOU6_4qdaLNdQ==
< age: 25781
The fact that the age has gone down (25781 in last comment, 31000 before when I checked) would indicate that is not fixed at the source yet
not working
Still not working from France
Also not working for me in Switzerland.
I'm getting the following request headers:
age: 32450
content-encoding: gzip
content-length: 184
content-type: text/plain; charset=utf-8
date: Thu, 03 Dec 2020 01:30:09 GMT
server: Apache
status: 200
vary: Accept-Encoding
via: 1.1 08c5e904e2f0226b2d9c1417f32b12f2.cloudfront.net (CloudFront)
x-amz-cf-id: vVb9tEK3XiHnO2D43rGDZeU51W94qXT8_t8AsOzcXrm8DHnWUj580Q==
x-amz-cf-pop: ZRH50-C1
x-cache: Hit from cloudfront
I suspect a lot of people here are using Drupal because our error handling is bad. For those, see https://www.drupal.org/project/drupal/issues/3186184#comment-13924958 for a long-term fix and my short-term workaround.
Drupal users can get around the problem by using the oembed_providers module as explained in the this core issue
Still giving this issue, created a new issue.
Hi There,
When I am trying to curl to the providers URL I am getting following.
`Fatal error: Uncaught Error: Call to undefined function yaml_parse_file() in /var/www/html/oembed.com/www/json.php:14 Stack trace:
0 {main}
thrown in /var/www/html/oembed.com/www/json.php on line 14