kCoreException in KMC

Hello everyone,

Met with server internal error dialog when logging into KMC and click Analytics Tab, and extracted detailed log, any hints what is wrong? And what to check next step? Thanks.

2015-06-24 15:45:35 [0.001585] [::1] [991771667] [API] [KalturaFrontController->errorHandler] WARN: /opt/kaltura/app/alpha/apps/kaltura/lib/reports/myReportsMgr.class.php line 1309 - mysqli_error() expects parameter 1 to be mysqli, boolean given
2015-06-24 15:45:35 [0.000160] [::1] [991771667] [API] [kCoreException->__construct] ERR: exception ‘kCoreException’ with message ‘Can’t use foo : ’ in /opt/kaltura/app/alpha/apps/kaltura/lib/reports/myReportsMgr.class.php:1309
Stack trace:
#0 /opt/kaltura/app/alpha/apps/kaltura/lib/reports/myReportsMgr.class.php(869): myReportsMgr::executeQuery(’/* Plays | Uni…’)

thanks in advance,
Lin

"Can’t use foo"
what is foo? Does is it appear in config files? code?

Are you using an alt port to connect to the DB?
Try adding:
error_log(print_r($db_config,true),3,’/tmp/db_conn.log’);
to /opt/kaltura/app/alpha/apps/kaltura/lib/reports/myReportsMgr.class.php
right after:
$link = $connect_function( $host , $db_config[“user”] , $db_config[“password”] , null, $db_config[“port”] );
which should be line 1306.
Then make the request and look at /tmp/db_conn.log
and make sure this connection works from the shell first, if not, need to see why not.

Thanks Jess,

Do not exactly remember if I change the MySQL port, where to see port configuration in Kaltura?

regards,
Lin

Put in the debug line as I advised and then we can understand what is being attempted.

Sure Jess, will do, a quick question, will Kaltura create any user/schema or other entity named foo? Thanks. :smile:

regards,
Lin

Hi Jess,

Here is the output from /tmp/db_conn.log after adding your lines, any further thoughts how to test further for the issue are appreciated.

Array
(
    [host] => (IP address)
    [user] => etl
    [port] => 3306
    [password] => (password hash)
    [db_name] => kalturadw
)

regards,
Lin

Hi Jess,

Here are some additional errors, any thoughts are appreciated.

==> /opt/kaltura/log/kaltura_apache_errors.log <==
[Sat Jun 27 05:08:30 2015] [error] [client 10.10.10.122] File does not exist: /opt/kaltura/app/alpha/web/manager
[Sat Jun 27 05:16:15 2015] [error] [client 10.10.10.122] File does not exist: /opt/kaltura/app/alpha/web/phpmyadmin
[Sat Jun 27 10:45:41 2015] [error] [client 10.10.10.121] PHP Notice:  Undefined index: HTTP_HOST in /opt/kaltura/app/alpha/web/index.php on line 33
[Sat Jun 27 12:29:37 2015] [error] [client 10.10.10.121] File does not exist: /opt/kaltura/app/alpha/web/manager
[Sat Jun 27 17:38:07 2015] [error] [client 10.10.10.122] File does not exist: /opt/kaltura/app/alpha/web/manager

--
2015-06-27 18:16:30 [0.007100] [10.10.10.123] [74723993] [API] [myReportsMgr::executeQuery] NOTICE: Reports query using database host: [61.49.8.161] user [etl]
2015-06-27 18:16:30 [0.001357] [10.10.10.123] [74723993] [API] [myReportsMgr::executeQuery] ERR: exception 'Exception' with message 'Invalid query: Table 'kalturadw.dwh_hourly_events_entry' doesn't exist' in /opt/kaltura/app/infra/log/KalturaLog.php:82
Stack trace:
#0 /opt/kaltura/app/alpha/apps/kaltura/lib/reports/myReportsMgr.class.php(1321): KalturaLog::err('Invalid query: ...')
--
#10 {main}
2015-06-27 18:16:30 [0.000749] [10.10.10.123] [74723993] [API] [kCoreException->__construct] ERR: exception 'kCoreException' with message 'Invalid query' in /opt/kaltura/app/alpha/apps/kaltura/lib/reports/myReportsMgr.class.php:1323
Stack trace:
#0 /opt/kaltura/app/alpha/apps/kaltura/lib/reports/myReportsMgr.class.php(869): myReportsMgr::executeQuery('SELECT COUNT(DI...')
--
2015-06-27 18:16:30 [0.005127] [10.10.10.123] [1908823563] [API] [myReportsMgr::executeQuery] NOTICE: Reports query using database host: [61.49.8.161] user [etl]
2015-06-27 18:16:30 [0.000945] [10.10.10.123] [74723993] [API] [KalturaFrontController->getExceptionObject] CRIT: exception 'kCoreException' with message 'Invalid query' in /opt/kaltura/app/alpha/apps/kaltura/lib/reports/myReportsMgr.class.php:1323
Stack trace:
#0 /opt/kaltura/app/alpha/apps/kaltura/lib/reports/myReportsMgr.class.php(869): myReportsMgr::executeQuery('SELECT COUNT(DI...')
--
2015-06-27 18:16:30 [0.000435] [10.10.10.123] [74723993] [API] [KalturaFrontController->serializeResponse] DEBUG: Serialize took - 0.00045013427734375
2015-06-27 18:16:30 [0.002400] [10.10.10.123] [1908823563] [API] [myReportsMgr::executeQuery] ERR: exception 'Exception' with message 'Invalid query: Table 'kalturadw.dwh_hourly_partner' doesn't exist' in /opt/kaltura/app/infra/log/KalturaLog.php:82
Stack trace:
#0 /opt/kaltura/app/alpha/apps/kaltura/lib/reports/myReportsMgr.class.php(1321): KalturaLog::err('Invalid query: ...')
--
2015-06-27 18:16:30 [0.000272] [10.10.10.123] [74723993] [API] [global] DEBUG: <------------------------------------- api_v3 -------------------------------------
2015-06-27 18:16:30 [0.000720] [10.10.10.123] [1908823563] [API] [kCoreException->__construct] ERR: exception 'kCoreException' with message 'Invalid query' in /opt/kaltura/app/alpha/apps/kaltura/lib/reports/myReportsMgr.class.php:1323
Stack trace:
#0 /opt/kaltura/app/alpha/apps/kaltura/lib/reports/myReportsMgr.class.php(869): myReportsMgr::executeQuery('?SELECT??DATE(D...')
--
2015-06-27 18:16:30 [0.000862] [10.10.10.123] [1908823563] [API] [myReportsMgr::executeQueryByType] NOTICE: Invalid query
2015-06-27 18:16:30 [0.001450] [10.10.10.123] [1010219759] [API] [myReportsMgr::executeQuery] ERR: exception 'Exception' with message 'Invalid query: Table 'kalturadw.dwh_hourly_partner' doesn't exist' in /opt/kaltura/app/infra/log/KalturaLog.php:82
Stack trace:
#0 /opt/kaltura/app/alpha/apps/kaltura/lib/reports/myReportsMgr.class.php(1321): KalturaLog::err('Invalid query: ...')
--
#9 {main}
2015-06-27 18:16:30 [0.000828] [10.10.10.123] [1010219759] [API] [kCoreException->__construct] ERR: exception 'kCoreException' with message 'Invalid query' in /opt/kaltura/app/alpha/apps/kaltura/lib/reports/myReportsMgr.class.php:1323
Stack trace:
#0 /opt/kaltura/app/alpha/apps/kaltura/lib/reports/myReportsMgr.class.php(869): myReportsMgr::executeQuery('/* Plays |  Uni...')
--
2015-06-27 18:16:30 [0.000520] [10.10.10.123] [1010219759] [API] [myReportsMgr::executeQueryByType] NOTICE: Invalid query
2015-06-27 18:16:30 [0.001802] [10.10.10.123] [1908823563] [API] [KalturaFrontController->getExceptionObject] CRIT: exception 'kCoreException' with message 'Invalid query' in /opt/kaltura/app/alpha/apps/kaltura/lib/reports/myReportsMgr.class.php:1323
Stack trace:
#0 /opt/kaltura/app/alpha/apps/kaltura/lib/reports/myReportsMgr.class.php(869): myReportsMgr::executeQuery('?SELECT??DATE(D...')
--

2015-06-27 18:16:30 [0.001395] [10.10.10.123] [1010219759] [API] [KalturaFrontController->getExceptionObject] CRIT: exception 'kCoreException' with message 'Invalid query' in /opt/kaltura/app/alpha/apps/kaltura/lib/reports/myReportsMgr.class.php:1323
Stack trace:
#0 /opt/kaltura/app/alpha/apps/kaltura/lib/reports/myReportsMgr.class.php(869): myReportsMgr::executeQuery('/* Plays |  Uni...')
--
2015-06-27 18:16:30 [0.005568] [10.10.10.123] [1275233926] [API] [myReportsMgr::executeQuery] NOTICE: Reports query using database host: [61.49.8.161] user [etl]
2015-06-27 18:16:30 [0.001239] [10.10.10.123] [1275233926] [API] [myReportsMgr::executeQuery] ERR: exception 'Exception' with message 'Invalid query: Table 'kalturadw.dwh_dim_applications' doesn't exist' in /opt/kaltura/app/infra/log/KalturaLog.php:82
Stack trace:
#0 /opt/kaltura/app/alpha/apps/kaltura/lib/reports/myReportsMgr.class.php(1321): KalturaLog::err('Invalid query: ...')
--
#10 {main}
2015-06-27 18:16:30 [0.000696] [10.10.10.123] [1275233926] [API] [kCoreException->__construct] ERR: exception 'kCoreException' with message 'Invalid query' in /opt/kaltura/app/alpha/apps/kaltura/lib/reports/myReportsMgr.class.php:1323
Stack trace:
#0 /opt/kaltura/app/alpha/apps/kaltura/lib/reports/myReportsMgr.class.php(869): myReportsMgr::executeQuery('SELECT count(*)...')
--
2015-06-27 18:16:30 [0.000434] [10.10.10.123] [1275233926] [API] [myReportsMgr::executeQueryByType] NOTICE: Invalid query
2015-06-27 18:16:30 [0.000883] [10.10.10.123] [1275233926] [API] [KalturaFrontController->getExceptionObject] CRIT: exception 'kCoreException' with message 'Invalid query' in /opt/kaltura/app/alpha/apps/kaltura/lib/reports/myReportsMgr.class.php:1323
Stack trace:
#0 /opt/kaltura/app/alpha/apps/kaltura/lib/reports/myReportsMgr.class.php(869): myReportsMgr::executeQuery('SELECT count(*)...')

regards,
Lin

Hello,

It looks like your DWH databases are corrupted.
I suggest you look at:

Hello,
I also experienced same problem. In my case, the problem is in Kaltura DB config, in these files:

  • /opt/kaltura/app/configurations/db.ini
  • /opt/kaltura/app/configurations/system.ini
  • /opt/kaltura/app/configurations/local.ini

Make sure all database name, user, and passwd correct on those three files. Because each time you launch kaltura-***-config.sh, these configuration files might be changed by the bash script.

Thanks juraganet,

Good catch! You mentioned “database name, user, and passwd correct on those three files”, would mind to tell more what means correct? Any way to test settings on each of the 3 individual files to see if they are correct?

regards,
Lin

Hi Jess,

Thanks for referring the similar problem to me. Is the problem you referred to me fully resolved by editing kettle.properties?

It seems there are still open issues like,

Caused by: org.pentaho.di.core.exception.KettleXMLException:
Unable to read file [file:///root/${EtlBasePath}/common/seize_lock_by_name.ktr]
Could not read from "file:///root/${EtlBasePath}/common/seize_lock_by_name.ktr" because it is a not a file.

regards,
Lin

It depends on your database setup. In my install, I use same user and password for all kaltura database to make it easier. Using root user I add “grant all” credentials to all Kaltura DB with same username and pass.
Here are kaltura db name in my server, I think there should be same db name on yours:
| kaltura |
| kaltura_sphinx_log |
| kalturadw |
| kalturadw_bisources |
| kalturadw_ds |
| kalturalog |

And here’s some part of db.ini:

[datasources]
default = propel
propel.adapter = mysql
propel.connection.classname = KalturaPDO
propel.connection.phptype = mysql
propel.connection.database = kaltura
propel.connection.hostspec = 127.0.0.1
propel.connection.user = kaltura
propel.connection.password = qGhDwiurlcaF3iwnI
propel.connection.dsn = "mysql:host=127.0.0.1;port=3306;dbname=kaltura;"
propel.connection.options.kaltura.noTransaction = true

Make sure the db entries are matched with your mysql database setup. If not, then you will likely get the “can not use foo” error.
There are also db setting in other files: system.ini and local.ini.

Thanks juraganet,

Very insightful. Do you know if Kaltura is using foo as default user name/db name? :smile:

regards,
Lin

haha no, but that’s what error message I got on kaltlog when my db setting is incorrect.

ERR: exception ‘kCoreException’ with message 'Can’t use foo :

Cool, thanks juraganet!

Have a good night. :stuck_out_tongue:

regards,
Lin

Hi Ofer,

From the log I posted, for “can not use foo”, do you know what is foo? DB admin user name?

thanks in advance,
Lin

Hi Jess,

Any comments to my question here (kCoreException in KMC), is highly appreciated. Thanks.

regards,
Lin

Hi juraganet,

Do you mean when DB setup is correct, Kaltura will always log the specific name “foo” in its log? Thanks.

regards,
Lin

The foo error just indicates there was a problem connecting to the DB.
I have a pull request to make the error far clearer here:

Regardless, you need to make sure the DB settings are correct in all files, including /opt/kaltura/dwh/.kettle/kettle.properties which is where analytics takes it from.

Make sure you can do this from the shell as well:
mysql -uetl -p$DWH_PASS kalturadw

Where DWH_PASS is what you have set as password in /opt/kaltura/app/configurations/db.ini and /opt/kaltura/dwh/.kettle/kettle.properties

You should also be seeing ALL these DBS:
| kaltura |
| kalturadw |
| kalturadw_bisources |
| kalturadw_ds |
| kalturalog |

Where ‘kaltura’ is the operational one and the rest are for analytics.