Exception KalturaAPIException with message Upload failed

Hello,

Lately I can no longer upload some videos on kaltura.
When I try videos smaller than 2MB it works. But when trying with big files it doesn’t work anymore.
Can someone help?

Here is the log “/opt/kaltura/log/kaltura_api_v3.log” when uploading a bigger file :

2023-04-12 17:41:03 [0.009191] [46.105.117.173] [1446373255] [1] [API] [global] DEBUG: >------------------------------------- api_v3 -------------------------------------

2023-04-12 17:41:03 [0.000061] [46.105.117.173] [1446373255] [2] [API] [global] INFO: API-start pid:18816

2023-04-12 17:41:03 [0.001796] [46.105.117.173] [1446373255] [3] [API] [KalturaFrontController->run] DEBUG: Params [Array
(
    [apiVersion] => 3.0
    [format] => 3
    [clientTag] => php5
    [partnerId] => 158
    [ks] => XXXX
    [kalsig] => 5fd1358835c8ec5e015972dab6be6856
    [fileData] => Array
        (
            [name] => phpCM4Mlv
            [type] =>
            [tmp_name] =>
            [error] => 1
            [size] => 0
        )

    [service] => media
    [action] => upload
)
]

2023-04-12 17:41:03 [0.006067] [46.105.117.173] [1446373255] [4] [API] [KalturaRequestDeserializer->validateFile] NOTICE: An error occured while uploading file. Array
(
    [name] => phpCM4Mlv
    [type] =>
    [tmp_name] =>
    [error] => 1
    [size] => 0
)


2023-04-12 17:41:03 [0.000863] [46.105.117.173] [1446373255] [5] [API] [KalturaFrontController->getExceptionObject] ERR: exception 'KalturaAPIException' with message 'Upload failed' in /opt/kaltura/app/api_v3/lib/KalturaRequestDeserializer.php:259
Stack trace:
#0 /opt/kaltura/app/api_v3/lib/KalturaRequestDeserializer.php(93): KalturaRequestDeserializer->validateFile(Array)
#1 /opt/kaltura/app/api_v3/lib/KalturaDispatcher.php(83): KalturaRequestDeserializer->buildActionArguments(Array)
#2 /opt/kaltura/app/api_v3/lib/KalturaFrontController.php(113): KalturaDispatcher->dispatch('media', 'upload', Array)
#3 /opt/kaltura/app/api_v3/web/index.php(31): KalturaFrontController->run()
#4 {main}

2023-04-12 17:41:03 [0.000098] [46.105.117.173] [1446373255] [6] [API] [KalturaFrontController->serializeResponse] DEBUG: Serialize start

2023-04-12 17:41:03 [0.000062] [46.105.117.173] [1446373255] [7] [API] [KalturaFrontController->serializeResponse] DEBUG: Serialize took - 6.1988830566406E-5

2023-04-12 17:41:03 [0.000049] [46.105.117.173] [1446373255] [8] [API] [global] INFO: API-end [0.018154144287109]

2023-04-12 17:41:03 [0.000040] [46.105.117.173] [1446373255] [9] [API] [global] DEBUG: <------------------------------------- api_v3 -------------------------------------






2023-04-12 17:41:03 [0.009003] [46.105.117.173] [1961845366] [1] [API] [global] DEBUG: >------------------------------------- api_v3 -------------------------------------

2023-04-12 17:41:03 [0.000061] [46.105.117.173] [1961845366] [2] [API] [global] INFO: API-start pid:18824

2023-04-12 17:41:03 [0.001731] [46.105.117.173] [1961845366] [3] [API] [KalturaFrontController->run] DEBUG: Params [Array
(
    [apiVersion] => 3.0
    [format] => 3
    [clientTag] => php5
    [mediaEntry:objectType] => KalturaMediaEntry
    [mediaEntry:mediaType] => 1
    [mediaEntry:name] => 1_minute_funny_videos.mp4
    [mediaEntry:description] => 1_minute_funny_videos.mp4
    [mediaEntry:tags] =>
    [uploadTokenId:code] => UPLOAD_ERROR
    [uploadTokenId:message] => Upload failed
    [uploadTokenId:objectType] => KalturaAPIException
    [partnerId] => 158
    [ks] => XXXX
    [kalsig] => 6fff235c0feb6cecd3cbf943c1aa6987
    [service] => media
    [action] => addFromUploadedFile
)
]

2023-04-12 17:41:03 [0.010965] [46.105.117.173] [1961845366] [4] [API] [KalturaFrontController->errorHandler] NOTICE: /opt/kaltura/app/api_v3/lib/KalturaRequestDeserializer.php line 402 - Array to string conversion

2023-04-12 17:41:03 [0.000132] [46.105.117.173] [1961845366] [5] [API] [KalturaDispatcher->dispatch] DEBUG: Dispatching service [media], action [addfromuploadedfile], reqIndex [1] with params Array
(
    [0] => KalturaMediaEntry Object
        (
            [mediaType] => 1
            [conversionQuality] =>
            [sourceType] =>
            [searchProviderType] =>
            [searchProviderId] =>
            [creditUserName] =>
            [creditUrl] =>
            [mediaDate] =>
            [dataUrl] =>
            [flavorParamsIds] =>
            [isTrimDisabled] =>
            [streams] =>
            [plays] =>
            [views] =>
            [lastPlayedAt] =>
            [width] =>
            [height] =>
            [duration] =>
            [msDuration] =>
            [durationType] =>
            [id] =>
            [name] => 1_minute_funny_videos.mp4
            [description] => 1_minute_funny_videos.mp4
            [partnerId] =>
            [userId] =>
            [creatorId] =>
            [tags] =>
            [adminTags] =>
            [categories] =>
            [categoriesIds] =>
            [status] =>
            [moderationStatus] =>
            [moderationCount] =>
            [type] => 1
            [createdAt] =>
            [updatedAt] =>
            [rank] =>
            [totalRank] =>
            [votes] =>
            [groupId] =>
            [partnerData] =>
            [downloadUrl] =>
            [searchText] =>
            [licenseType] =>
            [version] =>
            [thumbnailUrl] =>
            [accessControlId] =>
            [startDate] =>
            [endDate] =>
            [referenceId] =>
            [replacingEntryId] =>
            [replacedEntryId] =>
            [replacementStatus] =>
            [partnerSortValue] =>
            [conversionProfileId] =>
            [redirectEntryId] =>
            [rootEntryId] =>
            [parentEntryId] =>
            [operationAttributes] =>
            [entitledUsersEdit] =>
            [entitledUsersPublish] =>
            [capabilities] =>
            [templateEntryId] =>
            [displayInSearch] =>
            [relatedObjects] =>
        )

    [1] => Array
)


2023-04-12 17:41:03 [0.007714] [46.105.117.173] [1961845366] [6] [API] [KalturaPDO->__construct] DEBUG: conn took - 0.00034809112548828 seconds to mysql:host=127.0.0.1;port=3306;dbname=kaltura;

2023-04-12 17:41:03 [0.000243] [46.105.117.173] [1961845366] [7] [API] [Propel::initConnection] NOTICE: total conn took 0.00061511993408203 mysql:host=127.0.0.1;port=3306;dbname=kaltura;

2023-04-12 17:41:03 [0.000338] [46.105.117.173] [1961845366] [8] [API] [KalturaStatement->execute] DEBUG: /* a136e6a8f1f3[1961845366][propel] */ SELECT permission.ID, permission.TYPE, permission.NAME, permission.FRIENDLY_NAME, permission.DESCRIPTION, permission.PARTNER_ID, permission.STATUS, permission.DEPENDS_ON_PERMISSION_NAMES, permission.TAGS, permission.CREATED_AT, permission.UPDATED_AT, permission.CUSTOM_DATA FROM `permission` WHERE permission.PARTNER_ID IN ('158','0') AND permission.NAME IN ('FEATURE_END_USER_REPORTS','FEATURE_ENTITLEMENT') AND permission.STATUS='1' GROUP BY permission.NAME

2023-04-12 17:41:03 [0.000390] [46.105.117.173] [1961845366] [9] [API] [KalturaStatement->execute] DEBUG: Sql took - 0.00032496452331543 seconds

2023-04-12 17:41:03 [0.015425] [46.105.117.173] [1961845366] [10] [API] [KalturaStatement->execute] DEBUG: /* a136e6a8f1f3[1961845366][propel] */ SELECT kuser.ID, kuser.LOGIN_DATA_ID, kuser.IS_ADMIN, kuser.SCREEN_NAME, kuser.FULL_NAME, kuser.FIRST_NAME, kuser.LAST_NAME, kuser.EMAIL, kuser.SHA1_PASSWORD, kuser.SALT, kuser.DATE_OF_BIRTH, kuser.COUNTRY, kuser.STATE, kuser.CITY, kuser.ZIP, kuser.URL_LIST, kuser.PICTURE, kuser.ICON, kuser.ABOUT_ME, kuser.TAGS, kuser.TAGLINE, kuser.NETWORK_HIGHSCHOOL, kuser.NETWORK_COLLEGE, kuser.NETWORK_OTHER, kuser.MOBILE_NUM, kuser.MATURE_CONTENT, kuser.GENDER, kuser.REGISTRATION_IP, kuser.REGISTRATION_COOKIE, kuser.IM_LIST, kuser.VIEWS, kuser.FANS, kuser.ENTRIES, kuser.STORAGE_SIZE, kuser.PRODUCED_KSHOWS, kuser.STATUS, kuser.CREATED_AT, kuser.UPDATED_AT, kuser.PARTNER_ID, kuser.DISPLAY_IN_SEARCH, kuser.PARTNER_DATA, kuser.PUSER_ID, kuser.ADMIN_TAGS, kuser.INDEXED_PARTNER_DATA_INT, kuser.INDEXED_PARTNER_DATA_STRING, kuser.CUSTOM_DATA, kuser.TYPE FROM `kuser` WHERE kuser.PARTNER_ID='158' AND kuser.PUSER_ID='lynkoa' AND kuser.STATUS<>'2' ORDER BY kuser.UPDATED_AT DESC LIMIT 1

2023-04-12 17:41:03 [0.000353] [46.105.117.173] [1961845366] [11] [API] [KalturaStatement->execute] DEBUG: Sql took - 0.00027894973754883 seconds

2023-04-12 17:41:03 [0.009337] [46.105.117.173] [1961845366] [12] [API] [KalturaStatement->execute] DEBUG: /* a136e6a8f1f3[1961845366][propel] */ SELECT invalid_session.ID, invalid_session.KS, invalid_session.KS_VALID_UNTIL, invalid_session.CREATED_AT, invalid_session.ACTIONS_LIMIT, invalid_session.TYPE FROM `invalid_session` WHERE (invalid_session.TYPE='0' AND invalid_session.KS='a071d9cfe1d1eb0a0b0e2621ad3e44504241e5b9') LIMIT 1

2023-04-12 17:41:03 [0.000210] [46.105.117.173] [1961845366] [13] [API] [KalturaStatement->execute] DEBUG: Sql took - 0.00013113021850586 seconds

2023-04-12 17:41:03 [0.000328] [46.105.117.173] [1961845366] [14] [API] [kLockBase::safeLog] NOTICE: Grabbing lock [__LOCKuser_add_158lynkoa]

2023-04-12 17:41:03 [0.000075] [46.105.117.173] [1961845366] [15] [API] [kLockBase::safeLog] NOTICE: Lock grabbed [__LOCKuser_add_158lynkoa]

2023-04-12 17:41:03 [0.000304] [46.105.117.173] [1961845366] [16] [API] [KalturaStatement->execute] DEBUG: /* a136e6a8f1f3[1961845366][propel] */ SELECT kuser.ID, kuser.LOGIN_DATA_ID, kuser.IS_ADMIN, kuser.SCREEN_NAME, kuser.FULL_NAME, kuser.FIRST_NAME, kuser.LAST_NAME, kuser.EMAIL, kuser.SHA1_PASSWORD, kuser.SALT, kuser.DATE_OF_BIRTH, kuser.COUNTRY, kuser.STATE, kuser.CITY, kuser.ZIP, kuser.URL_LIST, kuser.PICTURE, kuser.ICON, kuser.ABOUT_ME, kuser.TAGS, kuser.TAGLINE, kuser.NETWORK_HIGHSCHOOL, kuser.NETWORK_COLLEGE, kuser.NETWORK_OTHER, kuser.MOBILE_NUM, kuser.MATURE_CONTENT, kuser.GENDER, kuser.REGISTRATION_IP, kuser.REGISTRATION_COOKIE, kuser.IM_LIST, kuser.VIEWS, kuser.FANS, kuser.ENTRIES, kuser.STORAGE_SIZE, kuser.PRODUCED_KSHOWS, kuser.STATUS, kuser.CREATED_AT, kuser.UPDATED_AT, kuser.PARTNER_ID, kuser.DISPLAY_IN_SEARCH, kuser.PARTNER_DATA, kuser.PUSER_ID, kuser.ADMIN_TAGS, kuser.INDEXED_PARTNER_DATA_INT, kuser.INDEXED_PARTNER_DATA_STRING, kuser.CUSTOM_DATA, kuser.TYPE FROM `kuser` WHERE kuser.PARTNER_ID='158' AND kuser.PUSER_ID='lynkoa' AND kuser.STATUS<>'2' LIMIT 1

2023-04-12 17:41:03 [0.000284] [46.105.117.173] [1961845366] [17] [API] [KalturaStatement->execute] DEBUG: Sql took - 0.00021100044250488 seconds

2023-04-12 17:41:03 [0.000098] [46.105.117.173] [1961845366] [18] [API] [kLockBase::safeLog] NOTICE: Releasing lock [__LOCKuser_add_158lynkoa]

2023-04-12 17:41:03 [0.000057] [46.105.117.173] [1961845366] [19] [API] [kLockBase::safeLog] NOTICE: Lock released [__LOCKuser_add_158lynkoa]

2023-04-12 17:41:03 [0.000335] [46.105.117.173] [1961845366] [20] [API] [KalturaStatement->execute] DEBUG: /* a136e6a8f1f3[1961845366][propel] */ SELECT partner.ID, partner.PARTNER_NAME, partner.PARTNER_ALIAS, partner.URL1, partner.URL2, partner.SECRET, partner.ADMIN_SECRET, partner.MAX_NUMBER_OF_HITS_PER_DAY, partner.APPEAR_IN_SEARCH, partner.DEBUG_LEVEL, partner.CREATED_AT, partner.UPDATED_AT, partner.ANONYMOUS_KUSER_ID, partner.KS_MAX_EXPIRY_IN_SECONDS, partner.CREATE_USER_ON_DEMAND, partner.PREFIX, partner.ADMIN_NAME, partner.ADMIN_EMAIL, partner.DESCRIPTION, partner.COMMERCIAL_USE, partner.MODERATE_CONTENT, partner.NOTIFY, partner.CUSTOM_DATA, partner.SERVICE_CONFIG_ID, partner.STATUS, partner.CONTENT_CATEGORIES, partner.TYPE, partner.PHONE, partner.DESCRIBE_YOURSELF, partner.ADULT_CONTENT, partner.PARTNER_PACKAGE, partner.USAGE_PERCENT, partner.STORAGE_USAGE, partner.EIGHTY_PERCENT_WARNING, partner.USAGE_LIMIT_WARNING, partner.MONITOR_USAGE, partner.PRIORITY_GROUP_ID, partner.PARTNER_GROUP_TYPE, partner.PARTNER_PARENT_ID, partner.KMC_VERSION FROM `partner` WHERE partner.ID='158'

2023-04-12 17:41:03 [0.000251] [46.105.117.173] [1961845366] [21] [API] [KalturaStatement->execute] DEBUG: Sql took - 0.00018692016601562 seconds

2023-04-12 17:41:03 [0.001779] [46.105.117.173] [1961845366] [22] [API] [KalturaStatement->execute] DEBUG: /* a136e6a8f1f3[1961845366][propel] */ SELECT kuser_to_user_role.ID, kuser_to_user_role.KUSER_ID, kuser_to_user_role.USER_ROLE_ID, kuser_to_user_role.CREATED_AT, kuser_to_user_role.UPDATED_AT FROM `kuser_to_user_role` WHERE kuser_to_user_role.KUSER_ID='308'

2023-04-12 17:41:03 [0.000172] [46.105.117.173] [1961845366] [23] [API] [KalturaStatement->execute] DEBUG: Sql took - 0.00010490417480469 seconds

2023-04-12 17:41:03 [0.001591] [46.105.117.173] [1961845366] [24] [API] [UserRolePeer::getIdByStrId] DEBUG: UserRole str_id [PARTNER_ADMIN_ROLE] mapped to id [2] - fetched from cache

2023-04-12 17:41:03 [0.000464] [46.105.117.173] [1961845366] [25] [API] [kPermissionManager::getFromCache] DEBUG: Found a cache value for key [role_2_partner_158_internal_1] map hash [9927de6e1da903923cc660b411181fbf] in layer [apcSerialized]

2023-04-12 17:41:03 [0.004456] [46.105.117.173] [1961845366] [26] [API] [KalturaDispatcher->dispatch] DEBUG: Invoke start

2023-04-12 17:41:03 [0.003573] [46.105.117.173] [1961845366] [27] [API] [KalturaStatement->execute] DEBUG: /* a136e6a8f1f3[1961845366][propel] */ SELECT upload_token.ID, upload_token.INT_ID, upload_token.PARTNER_ID, upload_token.KUSER_ID, upload_token.STATUS, upload_token.FILE_NAME, upload_token.FILE_SIZE, upload_token.UPLOADED_FILE_SIZE, upload_token.UPLOAD_TEMP_PATH, upload_token.USER_IP, upload_token.CREATED_AT, upload_token.UPDATED_AT, upload_token.DC, upload_token.OBJECT_TYPE, upload_token.OBJECT_ID FROM `upload_token` WHERE upload_token.ID='Array' AND upload_token.STATUS<>'5'

2023-04-12 17:41:03 [0.000200] [46.105.117.173] [1961845366] [28] [API] [KalturaStatement->execute] DEBUG: Sql took - 0.00012898445129395 seconds

2023-04-12 17:41:03 [0.002197] [46.105.117.173] [1961845366] [29] [API] [kDataCenterMgr::getRemoteDcExternalUrlByDcId] NOTICE: DC id [1]

2023-04-12 17:41:03 [0.000136] [46.105.117.173] [1961845366] [30] [API] [KalturaFrontController->getExceptionObject] CRIT: exception 'Exception' with message 'Cannot find DC with id [1]' in /opt/kaltura/app/alpha/apps/kaltura/lib/storage/kDataCenterMgr.class.php:72
Stack trace:
#0 /opt/kaltura/app/alpha/apps/kaltura/lib/storage/kDataCenterMgr.class.php(118): kDataCenterMgr::getDcById(1)
#1 /opt/kaltura/app/api_v3/services/MediaService.php(463): kDataCenterMgr::getRemoteDcExternalUrlByDcId(1)
#2 [internal function]: MediaService->addFromUploadedFileAction(Object(KalturaMediaEntry), 'Array')
#3 /opt/kaltura/app/api_v3/lib/reflection/KalturaActionReflector.php(233): call_user_func_array(Array, Array)
#4 /opt/kaltura/app/api_v3/lib/KalturaDispatcher.php(125): KalturaActionReflector->invoke(Array)
#5 /opt/kaltura/app/api_v3/lib/KalturaFrontController.php(113): KalturaDispatcher->dispatch('media', 'addFromUploaded...', Array)
#6 /opt/kaltura/app/api_v3/web/index.php(31): KalturaFrontController->run()
#7 {main}

2023-04-12 17:41:03 [0.000843] [46.105.117.173] [1961845366] [31] [API] [KalturaFrontController->serializeResponse] DEBUG: Serialize start

2023-04-12 17:41:03 [0.000072] [46.105.117.173] [1961845366] [32] [API] [KalturaFrontController->serializeResponse] DEBUG: Serialize took - 7.4863433837891E-5

2023-04-12 17:41:03 [0.000054] [46.105.117.173] [1961845366] [33] [API] [global] INFO: API-end [0.073137044906616]

2023-04-12 17:41:03 [0.000041] [46.105.117.173] [1961845366] [34] [API] [global] DEBUG: <------------------------------------- api_v3 -------------------------------------

Hi there!

I noticed that my post hasn’t received a response yet. I was hoping someone could help me out with this. Any insights or information would be greatly appreciated.

Thank you in advance for your time and help!

After searching for weeks, I finally found the following line in the log /var/log/httpd/ssl_error_log :

[Thu May 04 xx:xx:xx 2023] [error] [client xx.xxx.xx.xx] PHP Warning: POST Content-Length of 9169926 bytes exceeds the limit of 8388608 bytes in Unknown on line 0

To resolve the issue, I had to update the value of the post_max_size directive from 8M to 2024M in the /etc/php.ini file.