[ocDownloader] Internal Server Error

Hi,
I recently installed NextcloudPI on my Raspberry Pi, Nextcloud version is 24.0.5.1.
Also wanted to install OcDownloader, installed the necessary packages as a pi user:

sudo apt-get install aria2 curl php-curl

Created directories and ran aria2:

mkdir /var/log/aria2c /var/local/aria2c
touch /var/log/aria2c/aria2c.log
touch /var/local/aria2c/aria2c.sess
chown www-data.www-data -R /var/log/aria2c /var/local/aria2c
chmod 770 -R /var/log/aria2c /var/local/aria2c
sudo -u www-data aria2c --enable-rpc --rpc-allow-origin-all -c -D --log=/var/log/aria2c/aria2c.log --check-certificate=false --save-session=/var/local/aria2c/aria2c. sess --save-session-interval=2 --continue=true --input-file=/var/local/aria2c/aria2c.sess --rpc-save-upload-metadata=true --force-save=true --log-level=warn --rpc-secret=yoursecret

When you try to click on the OcDownloader application, a “Internal Server Error” error page appears. Aria2 seems to be working, judging by the logs.

Nextcloud logs show the following message when clicking on the OcDownloader application:

{"reqId":"Y09GfUVMhBA-tGhYJf6LlQAA1wg","level":3,"time":"2022-10-19T00:36:14+00:00","remoteAddr":"188.134.66. 6", "user": "ncp", "app": "index", "method": "GET", "url":"/apps/ocdownloader/add", "message": "OC\Files\\\\Utils\\Scanner::__construct(): Argument #4 ($logger) must be of type Psr\\Log\\\LoggerInterface, OC\\\Log given, called in /var/www/nextcloud/apps/ocdownloader/controller/index.php on line 249 in file '/var/www/nextcloud/lib/private/Files/Utils/Scanner.php' line 95", "userAgent": "Mozilla/5. 0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.124 YaBrowser/22.9.3.891 Yowser/2.5 Safari/537.36", "version": "24.0.5.1", "exception":{"Exception": "Exception", "Message": "OC\\Files\\\Utils\\Scanner::__construct(): Argument #4 ($logger) must be of type Psr\\Log\\\LoggerInterface, OC\\\Log given, called in /var/www/nextcloud/apps/ocdownloader/controller/index.php on line 249 in file '/var/www/nextcloud/lib/private/Files/Utils/Scanner. php' line 95", "Code":0, "Trace":[{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php", "line":172, "function": "dispatch", "class": "OC\AppFramework\\\Http\Dispatcher", "type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router. php", "line":298, "function": "main", "class": "OC\AppAppFramework\App", "type"::"},{"file":"/var/www/nextcloud/lib/base.php", "line":1030, "function": "match", "class": "OC\\Route\\Router", "type":"->"},{"file":"/var/www/nextcloud/index. php", "line":36, "function": "handleRequest", "class": "OC", "type"::"}], "File":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php", "Line":165, "Previous":{"Exception": "TypeError", "Message": "OC\\Files\\\Utils\\Scanner::__construct(): Argument #4 ($logger) must be of type Psr\\Log\\\LoggerInterface, OC\\\Log given, called in /var/www/nextcloud/apps/ocdownloader/controller/index.php on line 249", "Code":0, "Trace":[{"file":"/var/www/nextcloud/apps/ocdownloader/controller/index. php", "line":249, "function":"__construct", "class": "OC\\Files\\\Utils\\\Scanner", "type":"->"},{"file":"/var/www/nextcloud/apps/ocdownloader/controller/index. php", "line":91, "function": "syncDownloadsFolder", "class": "OCA\\\ocDownloader\\\Controller\\\Index", "type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher. php", "line":225, "function": "add", "class": "OCA\\\ocDownloader\\\Controller\\Index", "type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher. php", "line":133, "function": "executeController", "class": "OC\AppFramework\\\Http\\Dispatcher", "type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App. php", "line":172, "function": "dispatch", "class": "OC\AppFramework\\Http\\Dispatcher", "type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router. php", "line":298, "function": "main", "class": "OC\AppAppFramework\App", "type"::"},{"file":"/var/www/nextcloud/lib/base.php", "line":1030, "function": "match", "class": "OC\\Route\\Router", "type":"->"},{"file":"/var/www/nextcloud/index. php", "line":36, "function": "handleRequest", "class": "OC", "type"::"}], "File":"/var/www/nextcloud/lib/private/Files/Utils/Scanner.php", "Line":95}, "CustomMessage":"--"}}
{"reqId":"Y09GfgT1TlJK-Upv-wzpvQAAiwQ","level":2,"time":"2022-10-19T00:36:14+00:00","remoteAddr":"188.134.66.6","user":"--","app":"no app in context","method":"GET","url":"/apps/theming/manifest? v=0", "message": "Temporary directory /media/USBdrive/ncdata/tmp is not present or writable", "userAgent": "Mozilla/5.0 (Windows NT 10. 0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.124 YaBrowser/22.9.3.891 Yowser/2.5 Safari/537.36", "version": "24.0.5.1", "data":[]}

So, I have no idea what this error means, so please tell me what I might have done wrong or what the problem might be.
Thanks.

In NextCloud24, edit line 249 and line24 of file /apps/ocdownloader/controller/index.php
as shown in

1 Like

It’s working!
Thank you a lot!

@Dgtal1
Not important but maybe interesting for you and a few others reading here:
app Transfer

I use it for downloading directly MP3 in my Nextcloud.
Works fine for me.