ERROR 1046 (3D000) at line 1: No database selected
kaltura-base.postinst FAILED with: 24998 on line 64
solved this by adding use $DB1_NAME; to the query on line 64
After solving this it throws error on line 65 -P requires an argument. The $DB1_PORT variable was not included in /etc/kaltura.d/system.ini in the previous version, I suppose and this was the cause of it.
Also I had to hardcode the super user and password in the postinstall script as it was not asking for them as usual. After this the postinstall script executed successfully.
Then I had to rm -f /etc/apache2/sites-enabled/zzzkaltura.ssl.conf because of:
Feb 14 21:15:12 streamhub1.go.ro apache2[25457]: AH00526: Syntax error on line 19 of /etc/apache2/sites-enabled/zzzkaltura.ssl.conf:
Feb 14 21:15:12 streamhub1.go.ro apache2[25457]: SSLCertificateFile: file '/etc/apache2/@SSL_CERTIFICATE_FILE@' does not exist or is empty
Feb 14 21:15:12 streamhub1.go.ro apache2[25457]: Action 'configtest' failed.
Feb 14 21:15:12 streamhub1.go.ro apache2[25457]: The Apache error log may have more information.
Feb 14 21:15:12 streamhub1.go.ro systemd[1]: apache2.service: Control process exited, code=exited status=1
Feb 14 21:15:13 streamhub1.go.ro systemd[1]: Failed to start LSB: Apache2 web server.
Feb 14 21:15:13 streamhub1.go.ro systemd[1]: apache2.service: Unit entered failed state.
Feb 14 21:15:13 streamhub1.go.ro systemd[1]: apache2.service: Failed with result 'exit-code'.
Only then the kaltura-base install from aptitude was successful and I was able to reconfigure with dpkg-reconfigure.
For kaltura-nginx I had to apt install libzvbi* because the nginx service was searching for the lib and failed to start.
All the DB1_.* ENV vars and other important vars the postinst scripts use are defined in /etc/kaltura.d/system.ini which is a symlink to /opt/kaltura/app/configurations/system.ini.
Is it possible you deleted it by mistake?
It would surely exist now since you’ve reconfigured the kaltura-base package successfully [which triggers the exec of /var/lib/dpkg/info/kaltura-base.postinst] but if it didn’t exist when you tried to upgrade the reason for failure is obvious.
the file existed but it was not including the DB1_PORT var.
the problem started from the fact that the mysql cli was not reading the db name at the end of the command, although the var contained the correct value.
These are the packages I have related to mysql:
# dpkg -l|grep mysql
ii libdbd-mysql-perl 4.033-1ubuntu0.1 amd64 Perl5 database interface to the MySQL database
ii libmysqlclient20:amd64 5.7.21-0ubuntu0.16.04.1 amd64 MySQL database client library
ii mysql-common 5.7.21-0ubuntu0.16.04.1 all MySQL database common files, e.g. /etc/mysql/my.cnf
ii percona-server-common-5.5 5.5.59-rel38.11-1.xenial amd64 Percona Server database common files (e.g. /etc/mysql/my.cnf)
ii php-mysql 1:7.0+35ubuntu6 all MySQL module for PHP [default]
ii php7.0-mysql 7.0.25-0ubuntu0.16.04.1 amd64 MySQL module for PHP