Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload Problem: "Permission denied to receive a file" #9132

Open
shadow4040 opened this issue Jun 14, 2024 · 18 comments
Open

Upload Problem: "Permission denied to receive a file" #9132

shadow4040 opened this issue Jun 14, 2024 · 18 comments
Labels

Comments

@shadow4040
Copy link

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

AVideoLog::DEBUG: Permission denied to receive a file:
AVideoLog::DEBUG: aVideoEncoder.json: Permission denied to receive a file: {"format":"mp4","title":"test","videoDownloadedLink":"","encoderURL":"https:\\/\\/encoder.****\\/","streamers_id":3,"user":"user","pass":"XXXXXXX","return_vars":"{\\"videos_id\\":0,\\"video_id_hash\\":\\"\\",\\"releaseDate\\":\\"2024-06-14 15:37:00\\"}","releaseDate":"2024-06-14 15:37:00","releaseTime":"1718379420","timezone":"UTC","do_not_login":1,"encodedPass":1} SCRIPT_NAME: /objects/aVideoEncoder.json.php

Tested with admin user who have upload permissions also with the settings:
"authenticated users can upload videos = yes"

@shadow4040 shadow4040 added the bug label Jun 14, 2024
@shadow4040 shadow4040 changed the title Upload Problem: P"ermission denied to receive a file" Upload Problem: "Permission denied to receive a file" Jun 14, 2024
@DanielnetoDotCom
Copy link
Member

check if the user can upload videos

https://github.com/WWBN/AVideo/wiki/About-Video-Upload#who-can-upload

@shadow4040
Copy link
Author

yes, the user and admin have the permissions to Upload.

@DanielnetoDotCom
Copy link
Member

please provide more from your log when you try to upload.

@shadow4040
Copy link
Author

shadow4040 commented Jun 18, 2024

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 "-" "-"

@DanielnetoDotCom
Copy link
Member

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

@JoshWho
Copy link
Contributor

JoshWho commented Jul 11, 2024

Why is File permissions changing? THis is not the first case

@shadow4040
Copy link
Author

shadow4040 commented Jul 16, 2024

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

@DanielnetoDotCom
Copy link
Member

check if the user har rights to upload files

https://github.com/WWBN/AVideo/wiki/About-Video-Upload#who-can-upload

@millzee01
Copy link

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:

@DanielnetoDotCom
Copy link
Member

@millzee01 check your logs, encoder and streamer logs

@millzee01
Copy link

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.

@DanielnetoDotCom
Copy link
Member

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?

@millzee01
Copy link

not sure, this account was setup when the server was at version 12 i think

@millzee01
Copy link

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

@millzee01
Copy link

user account uploading file has canUpload set to 1 on the users table in the DB.

@millzee01
Copy link

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

@millzee01
Copy link

millzee01 commented Aug 16, 2024

@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.

@DanielnetoDotCom
Copy link
Member

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants