Kaltura-front failing on install

Im trying to install a secure Kaltura server, Im using ubuntu14.04 and I’ve created the certificate with lets-encrypt. After creating the certificated I ran the installation script “install_kaltura_all_in_1.sh” and everything looks good until kaltura-front package, Im seeing this in the log:

The following partially installed packages will be configured:
kaltura-front
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 28 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.
Setting up kaltura-front (12.17.0-1) …

Considering dependency setenvif for ssl:
Module setenvif already enabled
Considering dependency mime for ssl:
Module mime already enabled
Considering dependency socache_shmcb for ssl:
Module socache_shmcb already enabled
Module ssl already enabled
unable to load Private Key
140464209876640:error:0906D06C:PEM routines:PEM_read_bio:no start line:pem_lib.c:703:Expecting: ANY PRIVATE KEY

		ERROR: MD5 sums between .key and .crt files DO NOT MATCH
		# openssl rsa -in  -modulus -noout | openssl md5
		
		# openssl x509 -in  -modulus -noout | openssl md5

dpkg: error processing package kaltura-front (–configure):
subprocess installed post-installation script returned error exit status 3
Errors were encountered while processing:
kaltura-front
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install. Trying to recover:
Setting up kaltura-front (12.17.0-1) …

Considering dependency setenvif for ssl:
Module setenvif already enabled
Considering dependency mime for ssl:
Module mime already enabled
Considering dependency socache_shmcb for ssl:
Module socache_shmcb already enabled
Module ssl already enabled
unable to load Private Key
140402354853536:error:0906D06C:PEM routines:PEM_read_bio:no start line:pem_lib.c:703:Expecting: ANY PRIVATE KEY

		ERROR: MD5 sums between .key and .crt files DO NOT MATCH
		# openssl rsa -in  -modulus -noout | openssl md5
		
		# openssl x509 -in  -modulus -noout | openssl md5

dpkg: error processing package kaltura-front (–configure):
subprocess installed post-installation script returned error exit status 3
Errors were encountered while processing:
kaltura-front

When the installation script prompt me for a certificate I’ve used

/etc/letsencrypt/live/mydomain/cert.pem
/etc/letsencrypt/live/mydomain/chain.pem
/etc/letsencrypt/live/mydomain/privkey.pem

as was specified by Lets Encrypt installation

Any ideas?

Hi @juanpanie,

Let’s start by installing the debconf-utils package and running:

# debconf-get-selections |grep kaltura-front

Make sure the inputs for:
kaltura-front/apache_ssl_chain
kaltura-front/apache_ssl_key
kaltura-front/apache_ssl_cert

are correct.

The postinst code for kaltura-front runs the following commands:

CRT_SUM=`openssl x509 -in $CRT_FILE -modulus -noout | openssl md5`
KEY_SUM=`openssl rsa -in $KEY_FILE -modulus -noout | openssl md5`

The CRT_SUM and KEY_SUM values should match, otherwise, the files are invalid. After making sure your inputs were correct, if it still does not work, I suggest you run these commands manually and look at the results.

Remember that if you’ve made mistakes during the initial config phase, you can always run:

# aptitude install -f

and also, that at any time [assuming the package is set to “install ok installed” status] you can reconfigure with:

# dpkg-reconfigure <package-name>
So, for instance:
# dpkg-reconfigure kaltura-front
would re-prompt for all inputs needed by this package.

I found that there us an error on the kaltura-front/apache_ssl_key how can I change the value and resume the installation?

Like I said, you can use dpkg-reconfigure kaltura-front but since the package is now in a bad state, dpkg may not let you do that, if it does not, then you can use:

# echo kaltura-front   kaltura-front/apache_ssl_key    string /path/to/your/key| debconf-set-selections
# aptitude install -f

And then you can continue running the install_kaltura_all_in_1.sh script.

Hi @jess, thanks for the quick response, yes I was not able to run dpkg but I was able to make the changes on the ssl key value and continue with the installation, which led me to a new issue, that I was trying to avoid with a new fresh installation. Basically I cannot reach the API during Kaltura-db package install, I saw another post related with the issue, and the solution was removing any other vhost that could affect the altura installation, I did that before run the install script but is still happening.

This is the error:

Checking MySQL version..
innodb_log_file_size => 32M
mysql stop/waiting
mysql start/running, process 26076
CREATE USER kaltura;
CREATE USER etl@'%';
CREATE DATABASE kaltura;
CREATE DATABASE kaltura_sphinx_log;
CREATE DATABASE kalturadw;
CREATE DATABASE kalturadw_ds;
CREATE DATABASE kalturadw_bisources;
CREATE DATABASE kalturalog;
Checking connectivity to needed daemons...
Connectivity test passed:)
ERROR: Couldn't make an API request to http://mydomain.com/api_v3/index.php?service=system&action=ping.
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install.  Trying to recover:
Setting up kaltura-db (12.15.0-1+b4) ...

After that I’ve tried to run dpkg-reconfigure kaltura-db but having errors:

    PHP Fatal error:  Uncaught exception 'Exception' with message 'Storage Profile [] not found' in /opt/kaltura/app/alpha/apps/kaltura/lib/storage/kPathManager.php:75
Stack trace:
0 /opt/kaltura/app/alpha/apps/kaltura/lib/storage/kFileSyncUtils.class.php(965): kPathManager::getFilePathArr(Object(FileSyncKey))
1 /opt/kaltura/app/alpha/apps/kaltura/lib/storage/kFileSyncUtils.class.php(216): kFileSyncUtils::getLocalFilePathArrForKey(Object(FileSyncKey))
2 /opt/kaltura/app/alpha/lib/model/uiConf.php(340): kFileSyncUtils::file_put_contents(Object(FileSyncKey), '{"version":"v2....')
3 /opt/kaltura/app/alpha/lib/model/uiConf.php(143): uiConf->saveConfFileToDisk('{"version":"v2....', 'config', false)
4 /opt/kaltura/app/deployment/uiconf/deploy_v2.php(356): uiConf->save()
5 /opt/kaltura/app/deployment/uiconf/deploy_v2.php(181): uiConfDeployment::addUiConfThroughPropel(Object(uiConf))
6 /opt/kaltura/app/deployment/uiconf/deploy_v2.php(49): uiConfDeployment::deploy(Object(Zend_Config_Ini))
7 {main}
  thrown in /opt/kaltura/app/alpha/apps/kaltura/lib/storage/kPathManager.php on line 75
chown: cannot access ‘/opt/kaltura/web/content/generatedUiConf/’: No such file or directory
find: `/opt/kaltura/web/content/generatedUiConf': No such file or directory

This is curious for me because I tried to be careful in disabling the sites with a2dissite $SITENAME

Now after running the installation script (and getting the errors), I get:

a2dissite $SITENAME
Your choices are: admin apps var zzzkaltura.ssl
Which site(s) do you want to disable (wildcards ok)? 

Should i remove all sites and then reinstall?

Also, I can move this to the other thread if you like

Thanks in advance.

Juan Pablo.

Hi @juanpanie,

Judging by your output, you have a half baked DB which should be removed and repopulated.
You can easily purge the current DB by running:

# aptitude purge kaltura-db
# /opt/kaltura/bin/kaltura-drop-db.sh

I then recommend you review your existing Apache VHosts, making sure there is nothing to conflict with the configuration of the Kaltura VHost [configured by the kaltura-front package].
You can output all your active VHosts by running:

#  apachectl -t -DDUMP_VHOSTS

Then, to make sure your requests hit the right VHost, run:
# curl -v "http://mydomain.com/api_v3/index.php?service=system&action=ping"
which should output something along the lines of:

<?xml version="1.0" encoding="utf-8"?><xml><result>1</result><executionTime>0.095550060272217</executionTime></xml>

Once you get that, try to redeploy and populate the DB with:

# aptitude install kaltura-db

Hi @jess, thanks again for you response, I’ve checked the VHosts and I’ve just have one:

# apachectl -t -DDUMP_VHOSTS

VirtualHost configuration:
XX.XXX.XXX.XXX:80      mydomain.com (/etc/apache2/sites-enabled/zzzkaltura.ssl.conf:22) 

Even in that way im not able to reach http://mydomain.com/api_v3/indePreformatted text`x.php?service=system&action=ping

For some reason the API deployment failed, and Im not able to continue with the installation process.

Hi @jess in addition to my previous reply, I’ve just want to mention that I was able to run the install in another server, but without the ssl configuration, Im having this issues since I start trying with a ssl.

Regards.

Juan Pablo.

Hi @juanpanie,

Something is off here… your vhost output says the VHost is configured on port 80, yet the configuration used is the SSL config. For SSL, you will want to use 443 [default HTTPs], it can be any other port technically, but I certainly won’t recommend 80, which is one the “well known ports” and is HTTP’s default. Using SSL on port 80 will cause much confusion.
At any rate, with SSL, you should try:

**https**://mydomain.com/api_v3/index.php?service=system&action=ping

Not:

http://mydomain.com/api_v3/index.php?service=system&action=ping

Hi @jess, I undestand, Im not sure when I indicate Kaltura installation the port 80 for SSL, but even in that way, https is not working since Im receiving a bad response while hitting the https url. Should I start the installation from scratch? It was easy to deploy without SSL and without the domain name (it was ok just using the EC2 domain), now that I have a ssl certificate and “mydomain.com” I cannot get through the installation process.

Thanks again

Hello @juanpanie,

I’m not sure what your current configuration is but if it’s the same as it was during my last reply, then you should correct it.
You can reconfigure any Kaltura package [or any other deb package for that matter] by running dpkg-reconfigure , to reconfigure an entire all in one server run:

# dpkg-reconfigure kaltura-base
# dpkg-reconfigure kaltura-front
# dpkg-reconfigure kaltura-batch

From your past posts, it would appear your DB deployment didn’t go well either [because of the same faulty Apache configuration], see my response about how to drop and repopulate it once the Apache configuration issue is resolved.