Kaltura CE Moodle Integration

Over the past couple of weeks I have been trialing Kaltura CE with Moodle integration. When I completed the original install everything was mostly working including the link with Moodle. Prior to installing for mainstream use I did a complete reinstall from scratch to check my install procedure but this time the link to Moodle will not work. The Kaltura Repository settings page lists the following:

Connection Status: Connection to Kaltura failed
Error: In order to use the Kaltura repository plug-in your account must have custom metadata enabled. Please consult with your Kaltura rep.

The server/login details entered in the Kaltura package libraries settings are correct (I can copy and paste the details from Moodle and access the KMC webpage with no issues).

The Kaltura server install completed with no errors and I can access the KAC and KMC with no problem and can manually upload a video directly in to KMC.

The only difference I can see is that the original install used Katlura CE 12.10, while the new install uses v12.11, has anything changed in the newer version that would stop the Moodle integration working?

Looking at Kaltlog there is only the one error:

[1996409404] [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
Stack trace:
0 /opt/kaltura/app/alpha/scripts/utils/permissions/addPermissionsAndItems.php(284): KalturaLog::alert('ERROR - Permiss...')

Any ideas on how to get the Moodle integration back up and running?

Thanks

Hi @HilcrRWise,

What Moodle package are you using for the integration? https://github.com/kaltura/moodle_plugin requires the Kaltura Application Framework [KAF] which is not FOSS so I imagine you’re using something else? please provide the exact download URL and version being used.

I am worried about the error you posted from the API v3 log. This is nothing specific to Moodle, however.
I suggest you run:
# /opt/kaltura/bin/kaltura-sanity.sh
and see whether all tests pass. Based on what’s failing, I can provide more instructions for debugging and solving the issues.
The 2 lines of errors you’ve posted are not enough to understand the root cause.
In general, the debugging process is like this:

  • Perform the action while running kaltlog from the root shell
  • Look at the errors being outputted
  • Go to the relevant log file and trace back from the final erroneous line to understand what led to it

One thing that could cause errors like the one you posted is a half baked DB. This can happen if during your first deployment attempt you used a service URL that could not be reached, in which case, the DB and tables would be created but the data population could not be completed. If, after fixing that issue, you tried to run the deployment scripts again, without first dropping the kaltura DB, the /opt/kaltura/bin/kaltura-db-config.sh script will detect a DB already exists and that phase would be skipped, leaving us with a half backed, dysfunctional DB.
Assuming this is what happened, you should first drop the incomplete DB with:
# /opt/kaltura/bin/kaltura-drop-db.sh
and then re-run the configure script.

Hi Jess

The Moodle plugin I am using is the modified non KAF version created by ACheckley (https://github.com/acheckley/kaltura-moodle_plugin-v3/tree/master) which worked before (I have tried all 3 versions listed, MOODLE_26, MOODLE_31 and MOODLE_31_v2).

I do not have access to the Kaltura server at the moment but will try the Sanity test a bit later. A half baked database seems the most likely reason, is there a mysql command I can run to check to see if the DB installed correctly? Should I need to add the DB port (3306) to the server firewall exception before running the config or is this not required as the DB is on the localhost?

Thanks

Hi @HilcrRWise,

That plugin is fine to use, I just wanted to make sure you’re not trying to use our official KAF based Moodle plugin since it will not work.

As for the DB, the Moodle plugin does not need to communicate with the DB directly, in fact, nothing that integrates with Kaltura should ever do that, that’s what the API is for.

If you only have a standalone, all in one Kaltura instance [as opposed to a cluster] you can use localhost/127.0.0.1 to communicate with the DB and in fact, if that is the case, it is recommended that you only bind MySQL to 127.0.0.1. If you have a cluster, then all front and batch nodes need to be able to communicate with the MySQL server.
The important part is for the service URL used to be accessible from both the server itself [it makes API requests to itself if working in standalone mode] and all machines you intend to use the web interfaces from, as well as all machines/devices you intend to play content from.

Checking the DB integrity will be hard because as I said, it’s not about one table or another that is missing but rather records that are created by making API requests during the DB population phase of the configuration scripts. If you have the logs from the original run:
$LOG_DIR/insertPermissions.log
$LOG_DIR/insertContent.log
you should be able to quickly determine whether or not something failed. The script also exits in the event any of the sub population scripts failed and outputs a clear error as to the failing step.
However, if you arrived at that stage and then re-ran the configure script without dropping the DB, it will be incomplete and cause issues.
Assuming you have no critical data in it, the fastest way to resolve matters is to drop and recreate it.

I have found the cause of the Moodle connection issue. I am testing this install on my home computer and it seems my ISP decided to block port 80 on their end without letting me know. I reinstalled Kaltura (using Kaltura CE 12.12 this time) using port 8080 instead (after adding it to the firewall exception and setting up port forwarding on my router), however initially the install failed when it reached the checking api section, using curl to the api location listed I got a connection refused error. To get around this I changed the httpd.conf file so the listen line used port 8080 instead of 80 and the install then completed successfully and I was able to connect Moodle again successfully.

The issue I have now though is that when I click on the ‘Upload media or record from webcam’ button on the My Media moodle page the pop up that opens is all black with a tiny image icon in the middle, indicating it isn’t loading correctly. Is there any other configuration that needs to be done when using a non standard port that i may have missed?

When looking at Kaltlog the original ‘addPermissionsAndItems’ error is still showing but there are also some additional ‘Trying to get property of non-object’ errors listed as well. The full Kaltlog is:

[1996409404] [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
Stack trace:
0 /opt/kaltura/app/alpha/scripts/utils/permissions/addPermissionsAndItems.php(284): KalturaLog::alert('ERROR - Permiss...')
==> /opt/kaltura/log/batch/extractmedia-0-2017-03-10.err.log <==
PHP Notice:  Trying to get property of non-object in /opt/kaltura/app/infra/media/mediaInfoParser/KMediaFileComplexity.php on line 271
PHP Notice:  Trying to get property of non-object in /opt/kaltura/app/infra/media/mediaInfoParser/KMediaFileComplexity.php on line 271
PHP Notice:  Trying to get property of non-object in /opt/kaltura/app/infra/media/mediaInfoParser/KMediaFileComplexity.php on line 271
PHP Notice:  Trying to get property of non-object in /opt/kaltura/app/infra/media/mediaInfoParser/KMediaFileComplexity.php on line 271
PHP Notice:  Trying to get property of non-object in /opt/kaltura/app/infra/media/mediaInfoParser/KMediaFileComplexity.php on line 271
PHP Notice:  Trying to get property of non-object in /opt/kaltura/app/infra/media/mediaInfoParser/KMediaFileComplexity.php on line 271
PHP Notice:  Trying to get property of non-object in /opt/kaltura/app/infra/media/mediaInfoParser/KMediaFileComplexity.php on line 271
PHP Notice:  Trying to get property of non-object in /opt/kaltura/app/infra/media/mediaInfoParser/KMediaFileComplexity.php on line 271
PHP Warning:  Division by zero in /opt/kaltura/app/infra/media/mediaInfoParser/KMediaFileComplexity.php on line 271
PHP Warning:  Creating default object from empty value in /opt/kaltura/app/infra/media/mediaInfoParser/KMediaFileComplexity.php on line 235

Could these errors be a result of the same issue?

I can still upload and view videos with no issue directly from the KMC webpage.

After further investigation using the network tab of the development tools in Google Chrome and when I click on the ‘Upload media or record from webcam’ button there are a couple of items accessing KMC content that fail as they are tryng to use the url [ip address]:0, content listed below:

http://[ipaddress]:0/content/uiconf/kaltura/kmc/kcw/v2.1.5/style.swf?R=14344.210541428221
http://[ipaddress]:0/content/uiconf/kaltura/kmc/kcw/v2.1.5/en_US_ContributionWizard_kaltura.swf?R=14344.210541428221

Below is an anonomised copy of the answerfile I used to install Kaltura:

TIME_ZONE="Europe/London"
KALTURA_FULL_VIRTUAL_HOST_NAME="[ip address]:8080"
KALTURA_VIRTUAL_HOST_NAME="[ip address]"
DB1_HOST="127.0.0.1"
DB1_PORT="3306"
DB1_PASS="[password]"
DB1_NAME="kaltura"
DB1_USER="kaltura"
SERVICE_URL="http://[ip address]:8080"
SPHINX_SERVER1="127.0.0.1"
SPHINX_SERVER2="127.0.0.1"
DWH_HOST="127.0.0.1"
DWH_PORT="3306"
ADMIN_CONSOLE_ADMIN_MAIL="[email address]"
ADMIN_CONSOLE_PASSWORD="[password]"
CDN_HOST="[ip address]:8080"
KALTURA_VIRTUAL_HOST_PORT="8080"
SUPER_USER="root"
SUPER_USER_PASSWD="[password]"
ENVIRONMENT_NAME="Kaltura Video Platform"
DWH_PASS="[password]"
PROTOCOL="http"
PRIMARY_MEDIA_SERVER_HOST="[ip address]:8080"
USER_CONSENT="0"
CONTACT_MAIL="NO"
VOD_PACKAGER_HOST="[ip address]"
VOD_PACKAGER_PORT="88"
IP_RANGE="0.0.0.0-255.255.255.255"
WWW_HOST="[ip address]:8080"
CONFIG_CHOICE="0"
IS_SSL="N"
IS_NGINX_SSL="N"

I tried adding the port numbers to the end of the ‘KALTURA_VIRTUAL_HOST_NAME’ and ‘VOD_PACKAGER_HOST’ options but the install failed. Are there any other options that will also need changing in this situation?

Thanks

Hi @HilcrRWise,

Do these files exist on the disk?
/opt/kaltura/web/flash/kmc/uiconf/kaltura/kmc/kcw/v2.1.5/style.swf
/opt/kaltura/web/flash/kmc/uiconf/kaltura/kmc/kcw/v2.1.5/en_US_ContributionWizard_kaltura.swf

I am assuming “[ipaddress]:0” is just you masking the actual IP/hostname and port, correct? is the hostname/IP used for loading these swfs accessible from the machine where you’re trying to load KMC?

You shouldn’t add port numbers to KALTURA_VIRTUAL_HOST_NAME and VOD_PACKAGER_HOST, that’s what KALTURA_VIRTUAL_HOST_PORT and VOD_PACKAGER_PORT are for.

The two files exist but in a slightly different location:

/opt/kaltura/web/flash/kmc/v5.41.2/uiconf/kaltura/kmc/kcw/v2.1.5/
instead of
/opt/kaltura/web/flash/kmc/uiconf/kaltura/kmc/kcw/v2.1.5/

The ip address is masked but the port number listed in the url’s is what is actually shown (ie: 1.1.1.1:0).

Need to understand where the 0 as port is coming from then.
Can you run:
# grep “:0” /opt/kaltura/app/configurations/* -r

No results are found when that command is run.