Problem/Motivation
Pages with remote videos crashing with an error
"Could not retrieve the oEmbed provider database from https://www-site-url/get-media-providers"
Steps to reproduce
1. Add a media type remote video.
2. Create a content type use this media type.
3. Go to this created content type node add form. Click on add video media button you added. Ajax error will be thrown in console.
4. Check on recent error messages:
Type: php
Message: Drupal\media\OEmbed\ProviderException: Could not retrieve the oEmbed provider database from https://www-site-url/get-media-providers in Drupal\media\OEmbed\ProviderRepository->getAll() (line 138 of /site-url/core/modules/media/src/OEmbed/ProviderRepository.php)
This error is thrown on linux server only. It works fine on my local windows environment.
current Drupal Version 9.4.5
Comments
Comment #2
cilefen commentedWhat happens if you curl that URL from a shell on that server?
Comment #3
cilefen commentedAlso: does the message literally say “https://www-site-url/get-media-providers” or have you changed that when posting this here for privacy?
Comment #4
arpitk commentedFor privacy I have removed full url and used site name instead. also if i use this url https://www-site-url/get-media-providers directly into browser i can see the json data which hold all providers. If I curl the url from shell on server with dev working on Drupal 9.4.5 i get this error "curl: (60) Peer's Certificate issuer is not recognized." and Currently on Prod if i curl same url same error "curl: (60) Peer's Certificate issuer is not recognized." is thown but everything works fine there currently prod is on Drupal 8.9.20.
Comment #5
cilefen commentedReading through the source code, the default oembed_providers_url is https://oembed.com/providers.json. Do you know why it is not the default on this site?
Comment #6
arpitk commentedEven I checked the same and not sure why it is coming like that.
Update: this url is coming from the media.settings.yml where i see oembed_providers_url: is having values generated differently for all Dev and Test enivonments accordingly.
Comment #7
cilefen commentedThis looks like a contributed or a custom module, or a custom setup, on your end, so I am changing this to a support request. According to how you have the module configured, something on the same site responds to get requests on a /get-media-providers route. I have no independent way of determining that. Only you can identify what that may be.
On top of that there appears to be an inability for PHP to complete an HTTP GET request to https://www-site-url/get-media-providers which is platform-specific. That too is probably a setup issue on your end, possibly involving certificates or. name lookup.
Comment #8
cilefen commentedComment #9
arpitk commentedThanks Cilefen. I figured out the problem. The issue was in the custom code that was causing problem after updating to Drupal 9. It is fixed.
Comment #10
arpitk commented