10.6.0 cannot create playlist

Hi.

Whenever i try to create a playlist i get “Internal Server Error” I have this error for a few version now. Kaltlog says:

>     2015-03-18 14:32:22 [0.000963] [151.252.43.235] [475264545] [API] [kFileSyncUtils::getContentsByFileSync] INFO: file was not found locally []
>     2015-03-18 14:32:22 [0.000413] [151.252.43.235] [475264545] [API] [kCoreException->__construct] ERR: exception 'kFileSyncException' with message 'Cannot find file on local disk [] for file sync [672]' in /opt/kaltura/app/alpha/apps/kaltura/lib/storage/kFileSyncUtils.class.php:76
>     Stack trace:
>     <code>
>     #0 /opt/kaltura/app/alpha/apps/kaltura/lib/storage/kFileSyncUtils.class.php(176): kFileSyncUtils::getContentsByFileSync(Object(FileSync), true, true, false)
>     #13 {main}
>     2015-03-18 14:32:22 [0.000510] [151.252.43.235] [475264545] [API] [KalturaFrontController->getExceptionObject] CRIT: exception 'kFileSyncException' with message 'Cannot find file on local disk [] for file sync [672]' in /opt/kaltura/app/alpha/apps/kaltura/lib/storage/kFileSyncUtils.class.php:76
>     Stack trace:
>     #0 /opt/kaltura/app/alpha/apps/kaltura/lib/storage/kFileSyncUtils.class.php(176): kFileSyncUtils::getContentsByFileSync(Object(FileSync), true, true, false)

Hello,

This would usually be cause due to a missing file_sync as the message implies.
Can you please check the log around the error? it should have the query to the file_sync table where the file is set and is expected to be found on the file system.

Thanks,

Hello.

Can you please check the log around the error?

Don’t know what exactly to look for. Kaltlog is not telling me anymore then i already posted. kaltura_api_v3.log has no errors. Also the other logs are not helpfull as far as i can tell.

thanks and best regards

Hello,

Lets try
# grep “find file on local disk [] for file sync” /opt/kaltura/log/*log

Hello.

Well, that gives only:

/opt/kaltura/log/kaltura_api_v3.log:2015-03-18 17:27:59 [0.001994] [151.252.43.235] [1680921325] [API] [kCoreException->__construct] ERR: exception ‘kFileSyncException’ with message ‘Cannot find file on local disk [] for file sync [672]’ in /opt/kaltura/app/alpha/apps/kaltura/lib/storage/kFileSyncUtils.class.php:76
/opt/kaltura/log/kaltura_api_v3.log:2015-03-18 17:27:59 [0.000710] [151.252.43.235] [1680921325] [API] [KalturaFrontController->getExceptionObject] CRIT: exception ‘kFileSyncException’ with message ‘Cannot find file on local disk [] for file sync [672]’ in /opt/kaltura/app/alpha/apps/kaltura/lib/storage/kFileSyncUtils.class.php:76

I guess that’s not very helpfull?

cheers

This is what the kaltlog alias outputs because it is looking for error patterns, this is meant to help you understand where in the log to look:)
Please open kaltura_api_v3.log and check the SQL query made to the file_sync table.

Hello Jess.

Thanks for not giving up on me. :slight_smile: Here the corresponding snippet from kaltura log.

2015-03-19 08:46:02 [0.000184] [ip] [128196098] [API] [DbManager::connectFallbackLogic] DEBUG: connected to propel3
2015-03-19 08:46:02 [0.000302] [ip] [128196098] [API] [KalturaStatement->execute] DEBUG: /* hostname[128196098][propel3] */ SELECT file_sync.ID, file_sync.PARTNER_ID, file_sync.OBJECT_TYPE, file_sync.OBJECT_ID, file_sync.VERSION, file_sync.OBJECT_SUB_TYPE, file_sync.DC, file_sync.ORIGINAL, file_sync.CREATED_AT, file_sync.UPDATED_AT, file_sync.READY_AT, file_sync.SYNC_TIME, file_sync.STATUS, file_sync.FILE_TYPE, file_sync.LINKED_ID, file_sync.LINK_COUNT, file_sync.FILE_ROOT, file_sync.FILE_PATH, file_sync.FILE_SIZE, file_sync.DELETED_ID FROM `file_sync` WHERE file_sync.OBJECT_ID='0_7skxlfau' AND file_sync.OBJECT_TYPE='1' AND file_sync.OBJECT_SUB_TYPE='1' AND file_sync.VERSION='100002' AND (file_sync.STATUS='2' AND file_sync.STATUS NOT IN ('3','4')) ORDER BY file_sync.DC ASC
2015-03-19 08:46:02 [0.000350] [ip] [128196098] [API] [KalturaStatement->execute] DEBUG: Sql took - 0.00025105476379395 seconds
2015-03-19 08:46:02 [0.000142] [ip] [128196098] [API] [kFileSyncUtils::getReadyFileSyncForKey] INFO: FileSync was found locally
2015-03-19 08:46:02 [0.000099] [ip] [128196098] [API] [kFileSyncUtils::getContentsByFileSync] INFO: file was not found locally []
2015-03-19 08:46:02 [0.000357] [ip] [128196098] [API] [kCoreException->__construct] ERR: exception 'kFileSyncException' with message 'Cannot find file on local disk [] for file sync [672]' in /opt/kaltura/app/alpha/apps/kaltura/lib/storage/kFileSyncUtils.class.php:76
Stack trace:

It seems 0_7skxlfau is not found. Am i right? How can i solve this?

cheers

Hello @himbeere,

Good, so we are making progress.
Take this query and log into MySQL:
# mysql -h$DB1_HOST -u$DB1_USER -p$DB1_PASS $DB1_NAME

Lets see where that file is, then, we can either remove the record from DB or, just touch an empty file on that location which should be enough to make it stop failing.

Hello Jess.

Here we go:

MariaDB [kaltura]> SELECT file_sync.ID, file_sync.PARTNER_ID, file_sync.OBJECT_TYPE, file_sync.OBJECT_ID, file_sync.VERSION, file_sync.OBJECT_SUB_TYPE, file_sync.DC, file_sync.ORIGINAL, file_sync.CREATED_AT, file_sync.UPDATED_AT, file_sync.READY_AT, file_sync.SYNC_TIME, file_sync.STATUS, file_sync.FILE_TYPE, file_sync.LINKED_ID, file_sync.LINK_COUNT, file_sync.FILE_ROOT, file_sync.FILE_PATH, file_sync.FILE_SIZE, file_sync.DELETED_ID FROM `file_sync` WHERE file_sync.OBJECT_ID='0_7skxlfau' AND file_sync.OBJECT_TYPE='1' AND file_sync.OBJECT_SUB_TYPE='1' AND file_sync.VERSION='100002' AND (file_sync.STATUS='2' AND file_sync.STATUS NOT IN ('3','4')) ORDER BY file_sync.DC ASC;
+-----+------------+-------------+------------+---------+-----------------+------+----------+---------------------+---------------------+---------------------+-----------+--------+-----------+-----------+------------+-------------------+-----------------------------------------------+-----------+------------+
| ID  | PARTNER_ID | OBJECT_TYPE | OBJECT_ID  | VERSION | OBJECT_SUB_TYPE | DC   | ORIGINAL | CREATED_AT          | UPDATED_AT          | READY_AT            | SYNC_TIME | STATUS | FILE_TYPE | LINKED_ID | LINK_COUNT | FILE_ROOT         | FILE_PATH                                     | FILE_SIZE | DELETED_ID |
+-----+------------+-------------+------------+---------+-----------------+------+----------+---------------------+---------------------+---------------------+-----------+--------+-----------+-----------+------------+-------------------+-----------------------------------------------+-----------+------------+
| 672 |        100 |           1 | 0_7skxlfau | 100002  |               1 |    0 |        1 | 2015-01-15 21:41:34 | 2015-01-15 21:41:34 | 2015-01-15 21:41:34 |      NULL |      2 |         1 |      NULL |       NULL | /opt/kaltura/web/ | /content/entry/data/0/0/0_7skxlfau_100002.xml |       220 |       NULL |
+-----+------------+-------------+------------+---------+-----------------+------+----------+---------------------+---------------------+---------------------+-----------+--------+-----------+-----------+------------+-------------------+-----------------------------------------------+-----------+------------+
1 row in set (0.00 sec)

MariaDB [kaltura]>

Should i touch /opt/kaltura/web/content/entry/data/0/0/0_7skxlfau_100002.xml?

Correct. That should solve it.

Uahh. Issue solved. I had a few more missing files but after touching them it works now. I think i deleted this files because i thought this where leftovers from deleted videos. How am i supposed to delete videos correctly? I mean if i delete videos in the webinterface the files still remain in /opt/kaltura/web/content/entry/data/0/0. But i need the place someday.

big thanks again for debugging this.
t.

Hello,

Happy to help:)
As to your question, look at:
/opt/kaltura/app/configurations/cron/cleanup
This runs a script that can do that for you and you can symlink it to /etc/cron.d/ but please be sure to use it carefully and I suggest, as first, you drop the --real-run flag from /opt/kaltura/app/configurations/cron/cleanup and review the /opt/kaltura/log/kaltura_cleanup.log for a few days to ensure it behaves correctly.

Hello.

Thanks for the hint. This might come in handy.

cheers
t.