Self hosted. All in one instance: from v6 uninstall to v13.5.0-1 new install

I have uninstall kaltura v6. During the kaltura-server-13.15.0-1 installation I get the error message: kaltura-sphinx-config.sh FAILED with: 1 on line 63
Any suggestions will be greatly appreciated.
Thanks,
Dmitri

line 63:

 63 /etc/init.d/kaltura-sphinx restart >/dev/null 2>&1

 64 /etc/init.d/kaltura-populate restart >/dev/null 2>&1
 65 ln -sf $BASE_DIR/app/configurations/monit/monit.avail/sphinx.rc $BASE_DIR/app/configurations/monit/monit.d/enabled.sphinx.rc
 66 ln -sf $BASE_DIR/app/configurations/monit/monit.avail/sphinx.populate.rc $BASE_DIR/app/configurations/monit/monit.d/enabled.sphinx.populate.rc
kaltura-front-13.15.0-1.noarch
Enabling Apache config - apps.conf
Enabling Apache config - var.conf
Enabling Apache config - admin.conf


=================================================

Stopping httpd:                                            [  OK  ]
Starting httpd: [Thu Mar 22 07:36:44 2018] [warn] module ssl_module is already loaded, skipping

[Thu Mar 22 07:36:44 2018] **[warn]** The Alias directive in /opt/kaltura/app/configurations/apache/conf.d/enabled.apps.conf at line 38 will probably never match because it overlaps an earlier Alias.

line 38:
 38 Alias /apps/kea "/opt/kaltura/apps/kea"
     39 <Directory "/opt/kaltura/apps/kea">
     40     DirectoryIndex index.php


                                                           [  OK  ]
Stopping memcached:                                        [  OK  ]
Starting memcached:                                        [  OK  ]
Shutting down monit:                                       [  OK  ]
Starting monit: Starting Monit 5.23.0 daemon with http interface at [127.0.0.1]:2812
                                                           [  OK  ]
Running Sphinx config...


kaltura-sphinx-2.2.1-23.x86_64
base-config completed successfully, if you ever want to re-configure your system (e.g. change DB hostname) run the following script:
# rm /opt/kaltura/app/base-config.lock
# /opt/kaltura/bin/kaltura-base-config.sh

kaltura-sphinx-config.sh **FAILED** with: 1 on line 63

Archving logs to /opt/kaltura/log/log_22_03_18_07_36.tar.gz...
ERROR: /opt/kaltura/bin/kaltura-sphinx-config.sh failed:( You can re-run it when the issue is fixed.

Hi @astrava,

Most probable reason is that an old searchd proc is still occupying the port 9312 TCP.
Start with:

# netstat -plnt|grep 9312

If I’m right, kill that process.
In case that’s not the issue, try:

#  bash -x /etc/init.d/kaltura-sphinx restart

and look at the debug info outputted to STDERR to understand what the issue is.
Also, check /opt/kaltura/log/sphinx/kaltura_sphinx_searchd.log

Hi Jess,

Thanks for reply. Please advise. I appreciate your help and your time.
Thanks,
Dmitri

nothing on the port 9312

# /opt/kaltura/sphinx/bin/searchd --status
Sphinx 2.2.1-id64-dev (r4097)

using config file '/opt/kaltura/app/configurations/sphinx/sphinx.conf'...
WARNING: failed to connect to 0.0.0.0:9312: Connection refused

FATAL: failed to connect to daemon: please specify listen with sphinx protocol in your config file

# /opt/kaltura/sphinx/bin/searchd --status
 /opt/kaltura/app/configurations/sphinx/sphinx.conf: No such file or directory

I did copied file from sphinx.conf
/usr/share/doc/kaltura-sphinx-2.2.1/sphinx.conf.dist

 /opt/kaltura/sphinx/bin/searchd --config /usr/local/sphinx/etc/sphinx.conf
Sphinx 2.2.1-id64-dev (r4097)
Copyright (c) 2001-2013, Andrew Aksyonoff
Copyright (c) 2008-2013, Sphinx Technologies Inc (http://sphinxsearch.com)


-----------

Stopping searchd: + /opt/kaltura/sphinx/bin/searchd --config /opt/kaltura/app/configurations/sphinx/kaltura.conf --stopwait
Sphinx 2.2.1-id64-dev (r4097)
Copyright (c) 2001-2013, Andrew Aksyonoff
Copyright (c) 2008-2013, Sphinx Technologies Inc (http://sphinxsearch.com)

using config file '/opt/kaltura/app/configurations/sphinx/kaltura.conf'...
**FATAL**: stop: pid file '/opt/kaltura/sphinx/searchd.pid' does not exist or is not readable
+ sleep 10
+ retval=0
+ echo

+ '[' 0 -eq 0 ']'
+ return 0
+ start
+ '[' -x /opt/kaltura/sphinx/bin/searchd ']'
+ '[' -f /opt/kaltura/app/configurations/sphinx/kaltura.conf ']'
+ echo -n 'Starting searchd: '
Starting searchd: + su kaltura -c '/opt/kaltura/sphinx/bin/searchd --config /opt/kaltura/app/configurations/sphinx/kaltura.conf'

> This account is currently not available.

+ retval=1
+ echo

+ return 1
+ exit 1

Hi @astrava,

# id kaltura 
# grep kaltura /etc/passwd

The kaltura user is created in the kaltura-base pre-install phase. Among other things, it is the user that Sphinx and batch daemons run under.
From your output, it looks as though it was not correctly created. Possibly because you already had a kaltura user on your system but with incorrect attributes.

id kaltura
uid=494(kaltura) gid=487(kaltura) groups=487(kaltura),48(apache)

# grep kaltura /etc/passwd
kaltura:x:494:487:Kaltura:/software/kaltura:/sbin/nologin
monit:x:493:486:monit daemon:/opt/kaltura//var/lib/monit:/bin/sh

I have to change to

Kaltura server:/opt/kaltura:/bin/bash

from my old install /software/kaltura

Hi @astrava,

So in other words, my assumption was correct. You had a kaltura user you created manually.
Changing the user’s home dir and giving it a shell is not enough though.
You also need:

# usermod -a -G kaltura apache
# usermod -g kaltura kaltura

also, we set the user ID to 7373. Generally speaking, things should work even if the kaltura user has a different ID but in a cluster, it is important that the kaltura user ID is the same across all [mostly because of NFS].

What other procs are run with the kaltura user on that machine? If possible, it would be best to delete and recreate it with the same attributes as the kaltura-base pre-install script does.
You can see exactly how it’s created by running:

# rpm -q --scripts kaltura-base
# create user/group, and update permissions
getent group kaltura >/dev/null || groupadd -r kaltura -g7373 2>/dev/null
getent passwd kaltura >/dev/null || useradd -m -r -u7373 -d /opt/kaltura -s /bin/bash -c "Kaltura server" -g kaltura kaltura 2>/dev/null

getent group apache >/dev/null || groupadd -g 48 -r apache
getent passwd apache >/dev/null || \
  useradd -r -u 48 -g apache -s /sbin/nologin \
    -d /var/www -c "Apache" apache
usermod -a -G kaltura apache

usermod -g kaltura kaltura 2>/dev/null || true

Hi Jess,

You are right with kaltura user. I have rectified user.

kaltura:x:7373:7373:Kaltura:/opt/kaltura:/bin/bash

we have all-in -one server

Your Kaltura Service URL [http://sb-kaltura.....com]
(Base URL where the Kaltura API and Apps will be accessed from - this would be your Load Balancer URL on a cluster or same as your virtual host in an all-in-one Kaltura server - Must be accessible from both inside the machine and from any clients / browsers that will use Kaltura):
http://sb-kaltura.....com

using config file '/opt/kaltura/app/configurations/sphinx/kaltura.conf'...
listening on all interfaces, port=9312
WARNING: index 'kaltura_base': no fields configured (use rt_field directive) - NOT SERVING
WARNING: index 'kaltura_base_gt_in_charset': no fields configured (use rt_field directive) - NOT SERVING
precaching index 'kaltura_entry'
WARNING: index 'kaltura_entry': preload: failed to open /opt/kaltura/sphinx/kaltura_rt.lock: Permission denied; NOT SERVING
precaching index 'kaltura_category'
WARNING: index 'kaltura_category': preload: failed to open /opt/kaltura/sphinx/kaltura_category_rt.lock: Permission denied; NOT SERVING
precaching index 'kaltura_kuser'
WARNING: index 'kaltura_kuser': preload: failed to open /opt/kaltura/sphinx/kaltura_kuser_rt.lock: Permission denied; NOT SERVING
precaching index 'kaltura_category_kuser'
WARNING: index 'kaltura_category_kuser': preload: failed to open /opt/kaltura/sphinx/kaltura_category_kuser_rt.lock: Permission denied; NOT SERVING



FATAL: no valid indexes to serve
+ retval=0
+ echo
-rw-------.  1 root    root        4 Mar 22 11:03 kaltura_caption_item_rt.kill
-rw-------.  1 root    root        0 Mar 22 11:02 kaltura_caption_item_rt.lock
-rw-------.  1 root    root    51816 Mar 22 11:03 kaltura_caption_item_rt.meta
-rw-------.  1 root    root       12 Mar 22 11:03 kaltura_caption_item_rt.ram

Hi Jess,

The database ‘kaltura’; database doesn’t exist. And all other kaltura db’s:
kaltura kaltura_sphinx_log kalturadw kalturadw_ds kalturadw_bisources kalturalog

Please advise. I appreciate your help and your time.
Thanks,
Dmitri

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
+--------------------

Hi @astrava,

This is because you ran the following as root from an interactive shell when testing:

# /opt/kaltura/sphinx/bin/searchd --config /usr/local/sphinx/etc/sphinx.conf

So the files under /opt/kaltura/sphinx were created with root.root 600 and now when the init script tries to run searchd as the kaltura user, it cannot write there.
I suggest you:

# rm $BASE_DIR/sphinx/kaltura_*  $LOG_DIR/sphinx/data/binlog.*

and rerun the configure script.

Hi Jess,

Thanks for reply.
I dont have the kaltura db: kaltura kaltura_sphinx_log kalturadw kalturadw_ds kalturadw_bisources kalturalog

/opt/kaltura/bin/kaltura-db-config.sh localhost root root 13306
Checking MySQL version…
Ver 5.1.73 found compatible

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…
ERROR: Couldn’t make an API request to http://sb-kaltura…com/api_v3/index.php?service=system&action=ping.
Please check your setup and then run /opt/kaltura/bin/kaltura-db-config.sh again.

kaltura:x:7373:7373:Kaltura:/opt/kaltura:/bin/bash
monit:x:493:486:monit daemon:/opt/kaltura//var/lib/monit:/bin/sh
mysql:x:27:27:MySQL Server:/var/lib/mysql:/bin/bash

Hi @astrava,

The main Sphinx conf file is here:
/opt/kaltura/app/configurations/sphinx/kaltura.conf

As you can see in /etc/init.d/kaltura-sphinx:

config="$APP_DIR/configurations/sphinx/kaltura.conf"

None of the Kaltura RPMs write files to /usr/local.
To see all the files shipped with kaltura-sphinx, run:

# rpm -ql kaltura-sphinx

Hi Jess,

Thank you for your help.

/opt/kaltura/bin/kaltura-sanity.sh

DEBUG: Restoring dir to [/opt/kaltura/clients-generator]
INFO: php5full generated successfully

[Check httpd daemon status] [FAILED, RC: 1] - [.112451766]
Napping 1 seconds to allow the daemon httpd to finish its init after monit restarted it…

root@sb-kaltura dsmirnof]# kaltlog
tail: cannot open `/opt/kaltura/log/batch/*.log’ for reading: No such file or directory
[2018-03-22 13:30:19]failed to connect [1] [0.003572940826416] mysql:host=127.0.0.1;port=3306;dbname=kaltura_sphinx_log;
PHP Fatal error: Uncaught exception ‘PropelException’ with message ‘Unable to open PDO connection dsn[mysql:host=127.0.0.1;port=3306;dbname=kaltura_sphinx_log;] user[kaltura] password[B…N] [wrapped: SQLSTATE[42000] [1049] Unknown database ‘kaltura_sphinx_log’]’ in /opt/kaltura/app/vendor/propel/Propel.php:649
Stack trace:
#0 /opt/kaltura/app/vendor/propel/Propel.php(532): Propel::initConnection(Array, ‘sphinx_log_read’)

ls -al /opt/kaltura/log/batch/
total 8
drwxrwxr-x. 2 kaltura apache 4096 Feb 26 07:59 .
drwxrwxr-x. 4 kaltura apache 4096 Mar 22 13:31 …

I’m running DB setup and getting error bellow:
I can see my port is blocked
/opt/kaltura/bin/kaltura-db-config.sh

Removing kaltura…Removing kaltura_sphinx_log…Removing kalturadw…Removing kalturadw_ds…Removing kalturadw_bisources…Removing kalturalog…
Successfully dropped kaltura databases and users
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://sb-kaltura…com/api_v3/index.php?service=system&action=ping.
Please check your setup and then run /opt/kaltura/bin/kaltura-db-config.sh again.

curl -I -v http://…:80/api_v3/index.php?service=system&action=ping

Hi @astrava,

The hostname you provide MUST be resolvable both from inside the Kaltura server and from any machine you’ll be using the kaltura API/web I/Fs and player embeds from.

According to your output, the curl command trying to verify the hostname is accessible over HTTP failed.
You need to understand why that is.
If the hostname IS resolvable then something must be wrong with your Apache configuration. If that’s the case, what’s the output for:

# apachectl -t -DDUMP_VHOSTS

?

Hi Jess,

I removed kaltura and started with new install.

kaltura-db-config.sh FAILED with: 255 on line 193

Archving logs to /opt/kaltura/log/log_27_03_18_08_38.tar.gz…
ERROR: we failed on something else…

193 php $APP_DIR/deployment/base/scripts/insertContent.php >> $LOG_DIR/insertContent.log 2>&1
194 if [ $? -ne 0 ];then
195 cat << EOF

/opt/kaltura/app/deployment/base/scripts/insertContent.php

There is no “insertContent.log” created.

I appreciate your time and effort.
Thank you for your support.
Dmitri

Hi @astrava,

Try running:

# php /opt/kaltura/app/deployment/base/scripts/insertContent.php

from the shell and let’s look at the output.

Hi Jess,

I have fixed my httpd with SSL. Thank you.

What should I do with enabled.apps.conf?
I re-run /opt/kaltura/bin/kaltura-config-all.sh

Stopping httpd: [ OK ]
Starting httpd: [Tue Mar 27 10:01:56 2018] [warn] The Alias directive in /opt/kaltura/app/configurations/apache/conf.d/enabled.apps.conf at line 38 will probably never match because it overlaps an earlier Alias.
(98)Address already in use: make_sock: could not bind to address [::]:80
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs

kaltura-front-config.sh FAILED with: 1 on line 282 (282 service httpd restart)

Archving logs to /opt/kaltura/log/log_27_03_18_10_29.tar.gz…
ERROR: /opt/kaltura/bin/kaltura-front-config.sh failed:( You can re-run it when the issue is fixed.

38 Alias /apps/kea “/opt/kaltura/apps/kea”
39 <Directory “/opt/kaltura/apps/kea”>

Hi @astrava,

is just a warning. This is not what’s preventing Apache from successfully restarting.
Is there a different daemon currently listening on port 80 or is it just an errant/orphan Apache proc that cannot be stopped with SIGTERM? If the former, need to either stop it or set up Apache on a diff port, if the latter, try sending SIGKILL to all currently running Apache procs and then make sure restarting Apache with the init script works as expected. Once done, you can re-run the config script.

Hi Jess,

Thank you for reply. I run in another httpd error:

Starting httpd: [Tue Mar 27 13:07:50 2018] [warn] The Alias directive in /opt/kaltura/app/configurations/apache/conf.d/enabled.apps.conf at line 38 will probably never match because it overlaps an earlier Alias.

Syntax error on line 19 of /etc/httpd/conf.d/zzzkaltura.ssl.conf:
19 SSLCertificateFile @SSL_CERTIFICATE_FILE@
20 SSLCertificateKeyFile @SSL_CERTIFICATE_KEY_FILE@
21 SSLCACertificateFile @SSL_CERTIFICATE_CHAIN_FILE@

SSLCertificateFile: file ‘/etc/httpd/@SSL_CERTIFICATE_FILE@’ does not exist or is empty
[FAILED]

kaltura-batch-config.sh FAILED with: 1 on line 105

PHP Fatal error: Uncaught exception ‘KalturaClientException’ with message ‘couldn’t connect to host’ in /opt/kaltura/app/tests/lib/KalturaClientBase.php:362

Stack trace:
#0 /opt/kaltura/app/tests/lib/KalturaClientBase.php(953): KalturaClientBase->doQueue()
#1 /opt/kaltura/app/tests/standAloneClient/exec.php(345): KalturaClientBase->doMultiRequest()
#2 {main}
thrown in /opt/kaltura/app/tests/lib/KalturaClientBase.php on line 362

359 if ($error)
360 {
361 $this->resetRequest();
362 throw new KalturaClientException($error, KalturaClientException::ERROR_GENERIC);
363 }
364 else
365 {

service httpd reload
Reloading httpd: not reloading due to configuration syntax error
[FAILED]

kaltlog
in /opt/kaltura/app/tests/lib/KalturaClientBase.php:401
Stack trace:
0 /opt/kaltura/app/tests/lib/KalturaClientBase.php(953): KalturaClientBase->doQueue()

2018-03-27 08:34:03 [688530780] [addPermissionsAndItems.php] [addItemToPermissions] ALERT: exception ‘Exception’ with message ‘ERROR - Permission name [BATCH_BASE] for partner [0] not found in database - skipping!’ in /opt/kaltura/app/infra/log/KalturaLog.php:65

-rw-r–r--. 1 root root 5413 Mar 7 10:23 /opt/kaltura/app/infra/log/KalturaLog.php

Stack trace:
0 /opt/kaltura/app/alpha/scripts/utils/permissions/addPermissionsAndItems.php(284): KalturaLog::alert(‘ERROR - Permiss…’)
tail: cannot open `/opt/kaltura/log/batch/*.log’ for reading: No such file or directory

ls -al /opt/kaltura/log/batch/
total 8
drwxrwxr-x. 2 kaltura apache 4096 Feb 26 07:59 .
drwxrwxr-x. 4 kaltura apache 4096 Mar 27 13:41 …