Requested URL /api_v3/index.php was not found when using https

Hello

We recently noticed our staging kaltura environment giving errors when doing an API call directly to the kaltura server, here’s my setup:

  • We have multiple application, either running on the same network and outside, drupal, laravel, etc… that make API call to kaltura

  • We have a web server which is also acting as a proxy

  • The kaltura server

When we call the API from outside the network, let’s say https://kaltura_host/api_v3/index.php we get an answer, no errors, but when we call it within the same network we get a 404 error:

PHP Fatal error: Uncaught exception 'Exception' with message 'Error getting sources from server. Please try again.\nfailed to unserialize server result\n<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">\n<html><head>\n<title>404 Not Found</title>\n</head><body>\n<h1>Not Found</h1>\n<p>The requested URL /api_v3/index.php was not found on this server.</p>\n<hr>\n<address>Apache/2.2.15 (Red Hat) Server at kaltura_host.ca Port 443</address>\n</body></html>\n' in /client/kaltura/web/html5/html5lib/v2.69.5/modules/KalturaSupport/Client/KalturaClientHelper.php:65\nStack trace:\n#0 /client/kaltura/web/html5/html5lib/v2.69.5/modules/KalturaSupport/Client/KalturaClientHelper.php(53): KalturaClientHelper->generateKS('_101')\n#1 /client/kaltura/web/html5/html5lib/v2.69.5/modules/KalturaSupport/Client/KalturaClientHelper.php(16): KalturaClientHelper->getClient()\n#2 /client/kaltura/web/html5/html5lib/v2.69.5/modules/KalturaSupport/KalturaCommon.php(124): KalturaClientHelper->__construct(Array)\n#3 /client/kaltura/web/html5/html5lib/v2.69.5/includ in /client/kaltura/web/html5/html5lib/v2.69.5/modules/KalturaSupport/Client/KalturaClientHelper.php on line 65, referer: https://inside_network_host.ca/

Out of curiosity, i tried the following:

From the kaltura server directly,

curl -l -v -k https://127.0.0.1/api_v3/index.php
curl -l -v -k https://localhost/api_v3/index.php

Same error with the above

If i try the same but with HTTP instead i get no error, the API returns the intended string saying i have no action. but this solution is not good since our applications are SSL and can’t request from a HTTP site.

Here’s the output of :

apachectl -t -DDUMP_VHOSTS

VirtualHost configuration:
wildcard NameVirtualHosts and default servers:
default:443 kaltura_host.ca (/etc/httpd/conf.d/ssl.conf:74)
*:80 kaltura_host.ca (/etc/httpd/conf.d/zzzkaltura.conf:1)
Syntax OK

I also compared our prod setup with our staging, and everything is consistent (prod setup is working)
I’m not sure what else i can check for this error.

Thank you!

Hello @cedricguindon,

Sounds like a DNS issue to me. I’d start by running:

$ host  kaltura_host.ca

Both from within the host and from a machine outside the LAN and comparing the results. Also, check whether you’re overriding DNS in /etc/hosts.

Thank you Jess

I ran the command from within the same server and outside and both returned the same IP address.

Whats interesting, from the kaltura server directly, i did curl -l -v -k https://localhost and got the generic apache page, but doing curl -l -v -k https://localhost/api_v3/index.php i’m getting a 404.

It seems there’s a broken redirect for the api_v3 path

Update

I think i found the problem, it seems that my documentroot was setup differently for internal and external entry to the server, and the file /api_v3/index.php was missing for some reason from the internal documentroot path, once i added it it started to work again.

Thank you for your help Jess