Open shadow4040 opened 2 months ago
check if the user can upload videos
https://github.com/WWBN/AVideo/wiki/About-Video-Upload#who-can-upload
yes, the user and admin have the permissions to Upload.
please provide more from your log when you try to upload.
from browser developer console:
{videos_id: 0, video_id_hash: '', releaseDate: '2024-06-18 15:11:00', error: false, msg: 'Your file (test_YPTuniqid_6671879c4e0532.32612337) is queue'}
?justLogin=1&playlists_id=0&PHPSESSID=4d20c9df70c23202bb92d1cb833539fe:1219 {id: '3', name: 'MP4 Low SD HD', created: '2024-06-14 13:37:32', modified: '2024-06-14 13:37:32', extension: 'mp4', …}
====================
from avideo-streamer:
[Tue Jun 18 13:11:56.578821 2024] [php:notice] [pid 2096] [client **IP**:52594] AVideoLog::DEBUG: Password check Old not encoded pass SCRIPT_NAME: /objects/aVideoEncoder.json.php
[Tue Jun 18 13:11:56.582450 2024] [php:notice] [pid 2096] [client **IP**:52594] AVideoLog::DEBUG: Password check Old not found SCRIPT_NAME: /objects/aVideoEncoder.json.php
[Tue Jun 18 13:11:56.585660 2024] [php:notice] [pid 2096] [client **IP**:52594] AVideoLog::DEBUG: Password check Old encoded pass SCRIPT_NAME: /objects/aVideoEncoder.json.php
[Tue Jun 18 13:11:56.589211 2024] [php:notice] [pid 2096] [client **IP**:52594] AVideoLog::DEBUG: Password check Old not found SCRIPT_NAME: /objects/aVideoEncoder.json.php
[Tue Jun 18 13:11:56.589265 2024] [php:notice] [pid 2096] [client **IP**:52594] AVideoLog::DEBUG: loginFromRequest NOT FOUND **LOGIN-MAIL** SCRIPT_NAME: /objects/aVideoEncoder.json.php
[Tue Jun 18 13:11:56.596786 2024] [php:notice] [pid 2096] [client **IP**:52594] AVideoLog::DEBUG: aVideoEncoder.json: start SCRIPT_NAME: /objects/aVideoEncoder.json.php
[Tue Jun 18 13:11:56.596885 2024] [php:notice] [pid 2096] [client **IP**:52594] AVideoLog::DEBUG: aVideoEncoder.json: Permission denied to receive a file: {"duration":"EE:EE:EE","title":"test","first_request":"1","categories_id":0,"format":"mp4","resolution":"","videoDownloadedLink":"","description":"","downloadURL":"","chunkFile":"","encoderURL":"https:\\/\\/myencoder-URL.com\\/","keepEncoding":"0","streamers_id":3,"user":"**LOGIN-MAIL**","pass":"myPASS","return_vars":"{\\"videos_id\\":0,\\"video_id_hash\\":\\"\\",\\"releaseDate\\":\\"2024-06-18 15:11:00\\"}","releaseDate":"2024-06-18 15:11:00","releaseTime":"1718716260","timezone":"Europe\\/Berlin","do_not_login":1,"encodedPass":1} SCRIPT_NAME: /objects/aVideoEncoder.json.php
[Tue Jun 18 13:11:56.596922 2024] [php:notice] [pid 2096] [client **IP**:52594] AVideoLog::DEBUG: Permission denied to receive a file: {"duration":"EE:EE:EE","title":"test","first_request":"1","categories_id":0,"format":"mp4","resolution":"","videoDownloadedLink":"","description":"","downloadURL":"","chunkFile":"","encoderURL":"https:\\/\\/myencoder-URL.com\\/","keepEncoding":"0","streamers_id":3,"user":"**LOGIN-MAIL**","pass":"myPASS","return_vars":"{\\"videos_id\\":0,\\"video_id_hash\\":\\"\\",\\"releaseDate\\":\\"2024-06-18 15:11:00\\"}","releaseDate":"2024-06-18 15:11:00","releaseTime":"1718716260","timezone":"Europe\\/Berlin","do_not_login":1,"encodedPass":1} SCRIPT_NAME: /objects/aVideoEncoder.json.php
**IP** - - [18/Jun/2024:13:11:56 +0000] "POST /aVideoEncoder.json HTTP/1.1" 200 1536 "-" "-"
Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, false given in /var/www/html/plugin/Scheduler/run.php:19
Stack trace:
#0 {main}
thrown in /var/www/html/plugin/Scheduler/run.php on line 19
PHP Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, false given in /var/www/html/plugin/Scheduler/run.php:19
Stack trace:
#0 {main}
thrown in /var/www/html/plugin/Scheduler/run.php on line 19
[Tue Jun 18 13:12:01.982472 2024] [php:notice] [pid 1047] [client **IP**:40504] AVideoLog::DEBUG: Password check Old not encoded pass SCRIPT_NAME: /objects/aVideoEncoder.json.php
[Tue Jun 18 13:12:01.986229 2024] [php:notice] [pid 1047] [client **IP**:40504] AVideoLog::DEBUG: Password check Old not found SCRIPT_NAME: /objects/aVideoEncoder.json.php
[Tue Jun 18 13:12:01.989983 2024] [php:notice] [pid 1047] [client **IP**:40504] AVideoLog::DEBUG: Password check Old encoded pass SCRIPT_NAME: /objects/aVideoEncoder.json.php
[Tue Jun 18 13:12:01.993400 2024] [php:notice] [pid 1047] [client **IP**:40504] AVideoLog::DEBUG: Password check Old not found SCRIPT_NAME: /objects/aVideoEncoder.json.php
[Tue Jun 18 13:12:01.993445 2024] [php:notice] [pid 1047] [client **IP**:40504] AVideoLog::DEBUG: loginFromRequest NOT FOUND **LOGIN-MAIL** SCRIPT_NAME: /objects/aVideoEncoder.json.php
[Tue Jun 18 13:12:01.999814 2024] [php:notice] [pid 1047] [client **IP**:40504] AVideoLog::DEBUG: aVideoEncoder.json: start SCRIPT_NAME: /objects/aVideoEncoder.json.php
[Tue Jun 18 13:12:01.999880 2024] [php:notice] [pid 1047] [client **IP**:40504] AVideoLog::DEBUG: aVideoEncoder.json: Permission denied to receive a file: {"format":"mp4","title":"test","videoDownloadedLink":"","encoderURL":"https:\\/\\/myencoder-URL.com\\/","streamers_id":3,"user":"**LOGIN-MAIL**","pass":"myPASS","return_vars":"{\\"videos_id\\":0,\\"video_id_hash\\":\\"\\",\\"releaseDate\\":\\"2024-06-18 15:11:00\\"}","releaseDate":"2024-06-18 15:11:00","releaseTime":"1718723460","timezone":"UTC","do_not_login":1,"encodedPass":1} SCRIPT_NAME: /objects/aVideoEncoder.json.php
[Tue Jun 18 13:12:02.000233 2024] [php:notice] [pid 1047] [client **IP**:40504] AVideoLog::DEBUG: Permission denied to receive a file: {"format":"mp4","title":"test","videoDownloadedLink":"","encoderURL":"https:\\/\\/myencoder-URL.com\\/","streamers_id":3,"user":"**LOGIN-MAIL**","pass":"myPASS","return_vars":"{\\"videos_id\\":0,\\"video_id_hash\\":\\"\\",\\"releaseDate\\":\\"2024-06-18 15:11:00\\"}","releaseDate":"2024-06-18 15:11:00","releaseTime":"1718723460","timezone":"UTC","do_not_login":1,"encodedPass":1} SCRIPT_NAME: /objects/aVideoEncoder.json.php
**IP** - - [18/Jun/2024:13:12:01 +0000] "POST /aVideoEncoder.json HTTP/1.1" 200 1349 "-" "-"
First lets focus on resolve the "Fatal error"
from your logs I can see you have an outdated version.
first update your AVideo https://github.com/WWBN/AVideo/wiki/How-to-Update-your-AVideo-Platform
Why is File permissions changing? THis is not the first case
i updated the version.
So the fatal error is gone.
But i cant upload anyway:
[Tue Jul 16 14:07:31.303922 2024] [php:notice] [pid 102] [client **IP**:58816] AVideoLog::DEBUG: Password check Old not encoded pass SCRIPT_NAME: /objects/aVideoEncoder.json.php
[Tue Jul 16 14:07:31.316598 2024] [php:notice] [pid 102] [client **IP**:58816] AVideoLog::DEBUG: Password check Old not found SCRIPT_NAME: /objects/aVideoEncoder.json.php
[Tue Jul 16 14:07:31.331791 2024] [php:notice] [pid 102] [client **IP**:58816] AVideoLog::DEBUG: Password check Old encoded pass SCRIPT_NAME: /objects/aVideoEncoder.json.php
[Tue Jul 16 14:07:31.348382 2024] [php:notice] [pid 102] [client **IP**:58816] AVideoLog::DEBUG: Password check Old not found SCRIPT_NAME: /objects/aVideoEncoder.json.php
[Tue Jul 16 14:07:31.348488 2024] [php:notice] [pid 102] [client **IP**:58816] AVideoLog::DEBUG: loginFromRequest NOT FOUND user@user.com SCRIPT_NAME: /objects/aVideoEncoder.json.php
[Tue Jul 16 14:07:31.368090 2024] [php:notice] [pid 102] [client **IP**:58816] AVideoLog::DEBUG: aVideoEncoder.json: start SCRIPT_NAME: /objects/aVideoEncoder.json.php
[Tue Jul 16 14:07:31.368254 2024] [php:notice] [pid 102] [client **IP**:58816] AVideoLog::DEBUG: aVideoEncoder.json: Permission denied to receive a file: {"duration":"EE:EE:EE","title":"test55555","first_request":"1","categories_id":0,"format":"mp4","resolution":"","videoDownloadedLink":"","description":"","downloadURL":"","chunkFile":"","encoderURL":"https:\\/\\/encoder2.domain.com\\/","keepEncoding":"0","streamers_id":3,"user":"user@domain.com","pass":"1752cb32313123131d28322f66a43d2ab","return_vars":"{\\"videos_id\\":0,\\"video_id_hash\\":\\"\\",\\"releaseDate\\":\\"2024-07-16 16:06:00\\"}","releaseDate":"2024-07-16 16:06:00","releaseTime":"1721138760","timezone":"Europe\\/Berlin","do_not_login":1,"encodedPass":1} ["A plugin said users_id=[] cannot upload","The user is not logged"] SCRIPT_NAME: /objects/aVideoEncoder.json.php
[Tue Jul 16 14:07:31.368307 2024] [php:notice] [pid 102] [client **IP**:58816] AVideoLog::DEBUG: Permission denied to receive a file: {"duration":"EE:EE:EE","title":"test55555","first_request":"1","categories_id":0,"format":"mp4","resolution":"","videoDownloadedLink":"","description":"","downloadURL":"","chunkFile":"","encoderURL":"https:\\/\\/encoder2.domain.com\\/","keepEncoding":"0","streamers_id":3,"user":"user@domain.com","pass":"1752cb32313123131d28322f66a43d2ab","return_vars":"{\\"videos_id\\":0,\\"video_id_hash\\":\\"\\",\\"releaseDate\\":\\"2024-07-16 16:06:00\\"}","releaseDate":"2024-07-16 16:06:00","releaseTime":"1721138760","timezone":"Europe\\/Berlin","do_not_login":1,"encodedPass":1} SCRIPT_NAME: /objects/aVideoEncoder.json.php
check if the user har rights to upload files
https://github.com/WWBN/AVideo/wiki/About-Video-Upload#who-can-upload
Did this get resolved because I get exactly the same error. Direct upload works, embed works but encoder and api upload video mobile manager doesnt work.
Error i get is Permission denied to receive a file:
@millzee01 check your logs, encoder and streamer logs
i get
MOBILE SUCCESS UPLOAD: {"error":false,"videos_id":292,"msg":"We sent your video to the encoder","posterSent":false}
and the file comes into the video folder fine.
then i get:
getPasswordFromUserHashIfTheItIsValid: string not decrypted _user_hash_NndScnFFbEhUZUp1Yll5blNTakNxL09Ocn SCRIPT_NAME: /objects/aVideoEncoderLog.json.php [15-Aug-2024 18:13:03 Europe/London] AVideoLog::DEBUG: getPasswordFromUserHashIfTheItIsValid: string not decrypted _user_hash_NndScnFFbEhUZUp1Yll5blNTakNxL09Ocn SCRIPT_NAME: /objects/aVideoEncoderLog.json.php [15-Aug-2024 18:13:03 Europe/London] AVideoLog::DEBUG: loginFromRequest NOT FOUND carl.miller@site.com SCRIPT_NAME: /objects/aVideoEncoderLog.json.php [15-Aug-2024 13:13:03 America/Toronto] AVideoLog::DEBUG: aVideoEncoderLog.json: start SCRIPT_NAME: /objects/aVideoEncoderLog.json.php [15-Aug-2024 13:13:03 America/Toronto] AVideoLog::DEBUG: aVideoEncoderLog.json: Permission denied to receive a file: {"msg":"Status changed from queue to downloading","type":"StatusChanged","videos_id":292,"streamers_id":3,"user":"carl.miller@site.com","pass":"_user_hash_NndScnFFbEhUZUp1Yll5blNTakNxL09Ocn","return_vars":"{\"videos_id\":292}","timezone":"Europe\/London","do_not_login":1,"encodedPass":1} SCRIPT_NAME: /objects/aVideoEncoderLog.json.php
strange, seems to suggest it cant log me in yet I am logged in fine.
looks like those credential are no fine
"carl.miller@site.com","pass":"_user_hash_NndScnFFbEhUZUp1Yll5blNTakNxL09Ocn"
Something is missing here _user_hash_NndScnFFbEhUZUp1Yll5blNTakNxL09Ocn
where did you get it from?
not sure, this account was setup when the server was at version 12 i think
I use this: $user_email = "my user email"; $channelhash = "029f5370013c90d157208c1301d42c99"; $videoHubApiUrl = "https://site.com/plugin/MobileManager/upload.php?user=" . $user_email . "&pass=" . $channelhash;
so I dont understand where _user_hash_NndScnFFbEhUZUp1Yll5blNTakNxL09Ocn comes from
user account uploading file has canUpload set to 1 on the users table in the DB.
The 56_tmpFile.mp4 appears on the encoder/video folder as well
i have just done a test encoder upload with a 4mb webm file.
It gets copied over but goes no further with Permission denied to receive a file errors in the logs.
Very strange
@DanielnetoDotCom Added a log output in user.php - canNotUploadReason() _error_log("[CARL]USER.PHP function canNotUploadReason reason=" . print_r($reason,true) );
[16-Aug-2024 00:56:13 America/Toronto] AVideoLog::DEBUG: [CARL]USER.PHP function canNotUploadReason reason=Array ( [0] => A plugin said users_id=[] cannot upload [1] => The user is not logged )
whats more concerning is that I manually logged in as the admin and tried to upload with the encoder and got this: [16-Aug-2024 01:02:16 America/Toronto] AVideoLog::DEBUG: Permission denied to receive a file: {"format":"mp4","title":"test","videoDownloadedLink":"","encoderURL":"https:\/\/site.com\/encoder\/","streamers_id":2,"user":"admin@site.com","pass":"_user_hash_SmNiOTgzT3FXUDR2L25jYUZKS2ZQQkRBOE","return_vars":"{\"videos_id\":0,\"video_id_hash\":\"\",\"releaseDate\":\"2024-08-16 06:01:00\"}","releaseDate":"2024-08-16 06:01:00","releaseTime":"1723784460","timezone":"Europe\/London","do_not_login":1,"encodedPass":1} SCRIPT_NAME: /objects/aVideoEncoder.json.php
and the same reason: [16-Aug-2024 01:02:16 America/Toronto] AVideoLog::DEBUG: [CARL]USER.PHP function canNotUploadReason reason=Array ( [0] => A plugin said users_id=[] cannot upload [1] => The user is not logged )
so even admin cannot upload using the encoder yet direct upload works a charm and embed video works a charm.
Another thing in the log is that it says the password hash isnt right: [16-Aug-2024 06:02:16 Europe/London] AVideoLog::DEBUG: [CARL]USER.PHP - loginFromRequest() SCRIPT_NAME: /objects/aVideoEncoder.json.php [16-Aug-2024 06:02:16 Europe/London] AVideoLog::DEBUG: getPasswordFromUserHashIfTheItIsValid: string not decrypted _user_hash_SmNiOTgzT3FXUDR2L25jYUZKS2ZQQkRBOE SCRIPT_NAME: /objects/aVideoEncoder.json.php [16-Aug-2024 06:02:16 Europe/London] AVideoLog::DEBUG: getPasswordFromUserHashIfTheItIsValid: string not decrypted _user_hash_SmNiOTgzT3FXUDR2L25jYUZKS2ZQQkRBOE SCRIPT_NAME: /objects/aVideoEncoder.json.php [16-Aug-2024 06:02:16 Europe/London] AVideoLog::DEBUG: loginFromRequest NOT FOUND admin@site.com SCRIPT_NAME: /objects/aVideoEncoder.json.php
This was a manual login as admin.
I found that if change getUserPass() in USER.PHP to return $_SESSION['user']['password']; instead of passhash then everything works fine.
I suspect there is an issue with either encoding or decoding the password.
Describe the bug Uploading a video over the encoder results on queue with error: "Status: Error", hovering the info button shows no more content.
Error Logs
Tested with admin user who have upload permissions also with the settings: "authenticated users can upload videos = yes"