Error at install

Hi.
I am trying to install kaltura on ubuntu server and foloowed tutorial.
My install always fails with this error ERROR 1396 (HY000) at line 1: Operation CREATE USER failed for 'kaltura'@'%'
What may be reason?
I am providing correct mysql user and pass, and tried several times.
Thank you in advance.

Hello,

I suggest you edit /var/lib/dpkg/info/kaltura-db.postinst, add -x:
#!/bin/bash -x
then run:
# dpkg-reconfigure kaltura-db
it will output debug info showing the failing command. Are you providing the root credentials to the install script? you must provide super user creds in order to create the user ‘kaltura’.

Thank you for help.
After I have done what you said I have this error

/usr/sbin/dpkg-reconfigure: kaltura-db is broken or not fully installed

I am providing mysql root user and pass to kaltura installation.
Thank you in advance.

Most welcome, of course.
Try:
# aptitude install -f

It should try to reconfigure kaltura-db.

Oh, you are really trying to help.
I am pasting whole return of command.
Thank you so much again.

aptitude install -f

The following partially installed packages will be configured:
kaltura-db
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.
Setting up kaltura-db (10.10.0+b1) …
Checking MySQL version…

CREATE USER kaltura;
ERROR 1396 (HY000) at line 1: Operation CREATE USER failed for ‘kaltura’@’%’

	Archving logs to /opt/kaltura/log/log_05_05_15_16_34.tar.gz...

dpkg: error processing package kaltura-db (–configure):
subprocess installed post-installation script returned error exit status 11
Errors were encountered while processing:
kaltura-db
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install. Trying to recover:
Setting up kaltura-db (10.10.0+b1) …
Checking MySQL version…

CREATE USER kaltura;
ERROR 1396 (HY000) at line 1: Operation CREATE USER failed for ‘kaltura’@’%’

	Archving logs to /opt/kaltura/log/log_05_05_15_16_34.tar.gz...

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

OK so, for some reason, trying to create the user kaltura with the credentials you provided fails.
Does it work manually when you run:
# mysql -uroot -p$YOUR_PASSWD -h$DBHOST
mysql> CREATE USER kaltura;

I suspect it would fail, then you need to understand why that is.
Make sure this works manually before trying to reconfigure kaltura-db.
Please ensure you are connecting to MySQL EXACTLY the same way as the installer tries to [i.e, with the same host and passwd you provided it]. It is possible for a MySQL configuration to allow:
mysql -uroot -p$YOUR_PASSWD
and yet reject:
mysql -uroot -p$YOUR_PASSWD -h$DBHOST

which might explain the failure.

Hi, thank you again.
This is getting crazy
Here is outputs, all work

mysql -uroot -pxxxxxx

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 49
Server version: 5.5.43-0ubuntu0.14.04.1 (Ubuntu)

Copyright © 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

mysql>


 mysql -uroot -pxxxx -hlocalhost

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 50
Server version: 5.5.43-0ubuntu0.14.04.1 (Ubuntu)

Copyright © 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

mysql>

I have errors with installations ( centos 6.5 kaltura ver 10.10 cluster)

on front node after command

/opt/kaltura/bin/kaltura-db-config.sh server user password port

Checking MySQL version…
Ver 5.1.73 found compatible

CREATE USER kaltura;
CREATE USER etl;
CREATE DATABASE kaltura;
ERROR 1060 (42S21) at line 883: Duplicate column name ‘custom_data’

	Archving logs to /opt/kaltura/log/log_05_05_15_13_06.tar.gz... 

and does the create statement go through?
Also, when you add -x, you should be able to see the exact MySQL command that goes through, then we can try to run it ourselves from the shell.

@qdwhaty1, checking right now. Thanks,

Ahh sorry I missed to see that command at yours post.
No does not work

CREATE USER kaltura;

ERROR 1396 (HY000): Operation CREATE USER failed for ‘kaltura’@’%’

As for placing -x I gve you output, all i have is

/usr/sbin/dpkg-reconfigure: kaltura-db is broken or not fully installed

But this one works
CREATE USER kaltura@localhost;

Interesting… what MySQL ver is this?
We can get around it by editing:
/var/lib/dpkg/info/kaltura-db.postinst, line 128
echo “CREATE USER kaltura@$MYSQL_HOST IDENTIFIED BY ‘$DB1_PASS’ ;” | mysql -h$MYSQL_HOST -u$MYSQL_SUPER_USER -p$MYSQL_SUPER_USER_PASSWD -P$MYSQL_PORT

Then remove the current kaltura user you manually created with:
mysql> drop user kaltura;
And aptitude install -f again

I am just wondering why your version will not accept CREATE USER kaltura though…

Can you run:
mysql> select host,user from mysql.user;
as well?

Ok, thank you so much for help

Yes i can run this : select host,user from mysql.user;

host | user |
±----------±-----------------+
| 127.0.0.1 | root |
| ::1 | root |
| localhost | debian-sys-maint |
| localhost | kaltura |
| localhost | phpmyadmin |
| localhost | root |
±----------±-----------------+
6 rows in set (0.00 sec)

  • after changing that row, deleting user and aptitude install -f again
    I got same error*

    Archving logs to /opt/kaltura/log/log_05_05_15_19_43.tar.gz…
    dpkg: error processing package kaltura-db (–configure):
    subprocess installed post-installation script returned error exit status 11
    Errors were encountered while processing:
    kaltura-db

and to answer about mysql

dpkg -s mysql-server
Package: mysql-server
Status: install ok installed
Priority: optional
Section: database
Installed-Size: 121
Maintainer: Ubuntu Developers ubuntu-devel-discuss@lists.ubuntu.com
Architecture: all
Source: mysql-5.5
Version: 5.5.43-0ubuntu0.14.04.1
Depends: mysql-server-5.5
Description: MySQL database server (metapackage depending on the latest version)
This is an empty package that depends on the current “best” version of
mysql-server (currently mysql-server-5.5), as determined by the MySQL
maintainers. Install this package if in doubt about which MySQL
version you need. That will install the version recommended by the
package maintainers.
.
MySQL is a fast, stable and true multi-user, multi-threaded SQL database
server. SQL (Structured Query Language) is the most popular database query
language in the world. The main goals of MySQL are speed, robustness and
ease of use.
Homepage: http://dev.mysql.com/
Original-Maintainer: Debian MySQL Maintainers pkg-mysql-maint@lists.alioth.debian.org

Can you check exactly what mysql command run and failed? if you still have bash -x in the postinst script it should be outputted…

@qdwhaty1, you are most correct. There is a bug in 10.10.0.
The problem is in this file:
/opt/kaltura/app/deployment/base/sql/01.kaltura_ce_tables.sql
line 905 should be removed.
However, I spotted an additional issue which I am checking so for now, reverted latest stable to 10.8.0. Please run:
# /opt/kaltura/bin/kaltura-drop-db.sh
# yum remove “kaltura
# yum clean all
# rm -rf /opt/kaltura

and reinstall.
You will of course be able to upgrade later.

Thank you for reporting.

@qdwhaty1, I patched the code and released kaltura-base-10.10.0-3.noarch.rpm
If you have not done anything yet, please just run:
# /opt/kaltura/bin/kaltura-drop-db.sh
# yum clean all
# yum update "kaltura"
and rerun the config script

@Ger, when using mysql-server 5.5.43-0ubuntu0.14 I was able to reproduce your issue.
In my case, the fix to the postinst script did work and I pushed:
kaltura-db_10.10.0+b2_all.deb
to the repo.
If you do aptitude update && aptitude install kaltura-db, it should work.
Please let me know.

Hi, thank you again for helping me.

I removed all as described in guide and started all over again.

Sadly did not installed it.
Here is last rows from output

The following NEW packages will be installed:
kaltura-db
0 packages upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
Need to get 0 B/3,984 B of archives. After unpacking 8,192 B will be used.
Preconfiguring packages …
Selecting previously unselected package kaltura-db.
(Reading database … 57313 files and directories currently installed.)
Preparing to unpack …/kaltura-db_10.10.0+b3_all.deb …
Unpacking kaltura-db (10.10.0+b3) …
Setting up kaltura-db (10.10.0+b3) …
Checking MySQL version…

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:)
Cleaning cache…
Populating DB with data… please wait…
Output for /opt/kaltura/app/deployment/base/scripts/installPlugins.php being logged into /opt/kaltura/log/installPlugins.log
Output for /opt/kaltura/app/deployment/base/scripts/insertDefaults.php being logged into /opt/kaltura/log/insertDefaults.log
Output for /opt/kaltura/app/deployment/base/scripts/insertPermissions.php being logged into /opt/kaltura/log/insertPermissions.log
Output for /opt/kaltura/app/deployment/base/scripts/insertContent.php being logged into /opt/kaltura/log/insertContent.log

	Archving logs to /opt/kaltura/log/log_06_05_15_14_59.tar.gz...

dpkg: error processing package kaltura-db (–configure):
subprocess installed post-installation script returned error exit status 11
Errors were encountered while processing:
kaltura-db
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install. Trying to recover:
Setting up kaltura-db (10.10.0+b3) …
Checking MySQL version…

If it helps, database and user are installed.
From what I see user kaltura does not have any permissions?