Error in html5 playlist player

From time to time I get an error in the playlist player and the log file says this:

PHP Fatal error: Uncaught exception ‘Exception’ with message ‘Error getting sources from server. Please try again.\nOperation timed out after 20001 milliseconds with 0 out of -1 bytes received’ in /opt/kaltura/web/html5/html5lib/v2.61/modules/KalturaSupport/Client/KalturaClientHelper.php:65\nStack trace:\n#0 /opt/kaltura/web/html5/html5lib/v2.61/modules/KalturaSupport/Client/KalturaClientHelper.php(53): KalturaClientHelper->generateKS(’_100’)\n#1 /opt/kaltura/web/html5/html5lib/v2.61/modules/KalturaSupport/Client/KalturaClientHelper.php(16): KalturaClientHelper->getClient()\n#2 /opt/kaltura/web/html5/html5lib/v2.61/modules/KalturaSupport/KalturaCommon.php(124): KalturaClientHelper->__construct(Array)\n#3 /opt/kaltura/web/html5/html5lib/v2.61/includes/Pimple.php(122): {closure}(Object(Pimple))\n#4 /opt/kaltura/web/html5/html5lib/v2.61/includes/Pimple.php(83): Pimple->{closure}(Object(Pimple))\n#5 /opt/kaltura/web/html5/html5lib/v2.61/modules/KalturaSupport/kalturaIframeClass.php(29): Pimple->offsetGet(‘client_helper’)\n#6 /opt/kaltura/ in /opt/kaltura/web/html5/html5lib/v2.61/modules/KalturaSupport/Client/KalturaClientHelper.php on line 65

I can not figure out what is the source of these errors.

Hello @benny_1,

Start by using a HTTP sniffer (you can just utilise the browser’s dev tools module) and tracking the failing API request. Look at the response headers and find the X-Kaltura-Session value. Then, in /opt/kaltura/log/kaltura_api_v3.log find the lines associated with this API request and see what has failed.
Also check /opt/kaltura/log/kaltura_apache_errors_*log and /opt/kaltura/log/kaltura_prod.log for erroneous patterns.

It is hard to “catch” the error in chrome dev tools since it does not happen very often.
Most of the times it is OK.

The kaltura_prod.log has nothing relevant and the api log does not seem to include anything that corresponds to the errors in kaltura_apache_erros.log like I have attached above.

I’ve managed to reproduce this timeout error using this URL:

http://myskalturaserver.com/p/100/sp/10000/embedIframeJs/uiconf_id/23448180/partner_id/100?autoembed=true&entry_id=0_gjdh755i&playerId=kaltura_player_1559129993&cache_st=1559129993&width=560&height=395&flashvars[streamerType]=auto&flashvars[ks]=MGQ5YmVlMDNdsgfdgdfgrOzs%3D&flashvars[liveAnalytics.plugin]=false&flashvars[liveAnalytics.relativeTo]=PlayerHolder&flashvars[liveAnalytics.position]=after&flashvars[liveAnalytics.loadingPolicy]=onDemand

It takes a long time (about 60 seconds) to get a response sometimes.

Where is the bottle neck?
I do not see anything using much resources on the server when this query is running.