ocDownloader asking for aria2c?

Hi,

Its my first time using nextcloud. just installed it and everything works fine so far. But after installing ocDownloader. Its giving this error for both http and torrent download.

Returned GID is null ! Is Aria2c running as a daemon ?

While ocdownloader author says in requirements.

- ARIA2 (Not a requirement anymore since v1.2)
https://apps.owncloud.com/content/show.php/?content=169974

I tried to install aria2 as well with following command.

sudo apt-get install aria2

but it still wouldn’t work. Any suggestion what to do? ocdownloader wiki is also down. The major reason of installing Nextcloud is to get remote upload and view files in browsers before getting them down on my PC. Is there any other similar app for nextcloud, which can solve the issue? Would appreciate help.

1 Like

Well, i manage to find curl option but torrent is disabled by default. http and youtube both are not workiing. i get this error for direct link upload.
Error, GID not found !

And this error for youtube.
Unable to retrieve true YouTube video URL

So far this downloader is not working. Any suggestion to fix this / use this with aria2 or any alternative?

1 Like

Well, what operating system do you use? Did you follow the steps in this this Gibhub issue?

Also, for Youtube download to work, you need a recent version of youtube-dl. If you use Ubuntu/Debian, you could use the Webupd8 repository:

This may be a bug or it might just be the way it is supposed to work. If you have server side encryption enable then the .torrent file you upload will be sent to aria2c encrypted and fail decoding. It seems like you have to choose between server side encryption or downloading torrents :frowning:

@notjoe It is a known problem that ocDownloader doesn’t work with server side encryption at the moment.

Hey I got the same problem !
I use Debian9 (a brand new system)with Nextcloud 12.0.4 installed by snap with ocDownloader version 1.5.5.with Aria2
At the begining ,the ocdownloader working property with Aria2 ,which ever using Http or BT.
Then I try to add 1 more BT torrent from the cloud files,but it start to return the message "cant find the GID "to me !
I dont know why.Anyone have the solution?

Hey, i had the same problem on docker linuxserver/nextcloud:latest container based on alpine linux.
My solution was installing aria2c on base os.
Steps for install aria
$ apk add aria2 curl
$ mkdir /var/log/aria2c /var/local/aria2c
$ touch /var/log/aria2c/aria2c.log
$ touch /var/local/aria2c/aria2c.sess
$ chmod 770 -R /var/log/aria2c /var/local/aria2c
$ 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

It Worked. Got a problem. Files are written to the disk under the root user. Nextcloud prohibits them to move and gives only download. Re-running aria2c with the settings from the other user gives no results. How do I change the user of downloaded files? Not root user

Please run it with sudo -u www-data aria2c ... to fix this problem.

Run it using “sudo-u www-data aria2c” in the ROOT user session then nothing changes. Files also after copying recorded with the rights ROOT.
I need ADMIN rights on the files. An error occurs when starting from the ADMIN user. How to disable ROOT and enable in the ADMIN do not understand. Here’s the log file:

2019-04-08 23:41: 59.490833 [warning] [DownloadEngineFactory.cc: 201] neither --RPC-secret nor combination --rpc-user and --RPC-passwd are installed. It’s unsafe. It is highly recommended that you specify --rpc-secret with sufficient secrecy or it is now obsolete --RPC-user and --RPC-passwd.

2019-04-08 23:41: 59.491942 [error] [HttpListenCommand.cc:112] IPv4 RPC: could not bind TCP port 6800
Exception: [SocketCore.cc:312] errorCode=1 socket initialization Error, cause: address is already in use

2019-04-08 23:41: 59.492248 [error] [HttpListenCommand.cc:112] IPv6 RPC: could not bind TCP port 6800
Exception: [SocketCore.cc:312] errorCode=1 socket initialization Error, cause: address is already in use

2019-04-08 23:41: 59.492392 [error] [MultiUrlRequestInfo.cc: 297] exception Detected
Exception: [DownloadEngineFactory.cc:219] errorCode=1 failed to configure the RPC server.

P.S. Please forgive my English

Seems like something is already running on port 6800 (needed by Aria2c), can you check what it is?

I’m facing the same kind of problem, I’m using nextcloud 16 with last version of ocDownloader, on debian 9.

I installed aria2 sudo apt install aria2 and I can download torrent in command line with no problem.

But in ocDownloader:

Returned GID is null ! Is Aria2c running as a daemon ?

I made this:

sudo -u www-data aria2c 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

That’s it, the thing is I don’t see any daemon of aria2 on the system, and the port 6800 is not listening as peoples said, but aria2c work in standalone …
Also I don’t find any log files for aria2c … nothing in cat /var/log/aria2.log while I used it before

Is there a way to start the daemon listening ?

Anyone had any luck here with this GUID issue under Docker ?

used sudo -u www-data aria2c --enable rpc -D, and it worked!

1 Like

It’s right. But there is a little modification:

sudo -u www-data aria2c --enable-rpc -D

1 Like

Oder so https://dasnetzundich.de/aria2c-einrichten-per-docker/

I would like to share for

Nextcloud 14.0.7
ocDownloader 1.7.5
Ubuntu 16.04.6 LTS
PHP 7.0.33-0ubuntu0.16.04.9
mysql Ver 15.1 Distrib 10.0.38-MariaDB

for the OCDownloader to work I run the following after creating the directory /etc/aria2

For Nextcloud copy this

sudo -u www-data aria2c --enable-rpc --rpc-allow-origin-all -c -D --check-certificate=false --log=/etc/aria2/aria2c.log --log-level=warn --dht-file-path=/etc/aria2/dht.dat --save-session=/etc/aria2/aria2.session --save-session-interval=2 --input-file=/etc/aria2/aria2.session --rpc-save-upload-metadata=true --force-save=true

I am not very skilled but to make myself simple I made a bash script for testing.

#!/bin/bash

filesource: /etc/aria2/aria-daemon.sh

Run Aria2c as WebGUI or as Nextcloud Daemon.

Aria2c WebGUI requires port 6800 to be open for WorldWideAccess

Aria2c Nextcloud only runs localy no password applied

safe=“P@5Zw0rd”
password=$1

function l {
if [[ -n $1 ]]
then
if [[ $1 == “-h” ]]
then
h
quit
fi
a $password
else
o
fi
}
function o {
echo
echo “Run Aria2c as WebGUI or OCDownloader”
echo “1: WebGUI”
echo “2: OCDownloader”
echo “3: Stop Aria2c”
read -p "Choose 1,2 or 3: " ans
if [[ $ans == “1” ]]
then
a $password
elif [[ $ans == “2” ]]
then
ocd
else
k
quit
fi
}
function a {
if [[ -z $1 ]]
then
echo
echo “Enter a password or use the provided one”
read -sp "Press enter to use " $safe " or enter a new value: " ans
if [[ -n “$ans” ]]
then
password=$ans
else
password=$safe
fi
fi
show
}
function show {
echo
echo " Variables: "
echo "password will be: " $password
web
}
function web {
echo
echo “Running Aria2c as deamon for Aria webGui port 6800”
sudo -u www-data aria2c --enable-rpc --rpc-allow-origin-all --rpc-listen-all -c -D --check-certificate=false --log=/cloud/aria2c.log --log-level=warn --dht-file-path=/etc/aria2/dht.dat --save-session=/etc/aria2/aria2.session --save-session-interval=2 --input-file=/etc/aria2/aria2.session --rpc-save-upload-metadata=true --force-save=true --rpc-secret=$password
}
function ocd {
echo
echo “Running Aria2c as a deamon for Nextcloud OCdownloader”
sudo -u www-data aria2c --enable-rpc --rpc-allow-origin-all -c -D --check-certificate=false --log=/cloud/aria2c.log --log-level=warn --dht-file-path=/etc/aria2/dht.dat --save-session=/etc/aria2/aria2.session --save-session-interval=2 --input-file=/etc/aria2/aria2.session --rpc-save-upload-metadata=true --force-save=true
}
function h {
echo
echo “to run aria2c as daemon supply a password run like: $ sudo $0 password”
echo “to run aria2c as OCDownloader daemon just run: $ sudo $0 then select option 2”
echo “to exit a running instance select option 3”
quit
}
function k {
#Find the Process ID for aria2c running instance
PID=ps -eaf | grep aria2c | grep -v grep | awk '{print $2}'
echo
echo “PID =” $PID
if [[ -n “$PID” ]]
then
echo "kill: "$PID
kill -9 $PID
fi
}
function quit {
echo
echo “The End.”
exit
}
l $1
quit
echo “foo”

the script is saved in /etc/aria2/ owner/group = root:www-data permission 770
inside the directory /etc/aria2/ the script is aria-daemon.sh owner/group = root:www-data with permission 750
files will be created there dht.dat owner/group www-data:www-data permission 640
also aria2.session owner/group www-data:www-data permission 640

Inside the script adjust your LOG file location

Good luck

EDIT:

After re-reading the post I will add some more LOOKOUTS

do not run aria2c as ROOT user if you ever do remove any file made by aria2c or it cannot write to the necessary files when you try to run is as USER or www-data in my case.

make sure the WWW-DATA has write permission where aria2c is writing log and session files.

@kyungjun2 @Y_Chaos how did you manage to get it running? I’m still ending up in

2020-02-20 02:00:01.204961 [WARN] [DownloadEngineFactory.cc:201] Neither --rpc-secret nor a combination of --rpc-user and --rpc-passwd is set. This is insecure. It is extremely recommended to specify --rpc-secret with the adequate secrecy or now deprecated --rpc-user and --rpc-passwd.
2020-02-20 02:00:01.205429 [ERROR] [HttpListenCommand.cc:112] IPv6 RPC: failed to bind TCP port 6800
Exception: [SocketCore.cc:312] errorCode=1 Failed to bind a socket, cause: Name or service not known

What I’ve tried is to create a Dockerfile which includes aria2c but that does not work.

It looks like this

FROM ownyourbits/nextcloudpi-armhf:latest
RUN apt-get update
RUN apt-get install -y aria2 curl php-curl python-pip
RUN pip install youtube-dl
RUN mkdir /var/log/aria2c
RUN mkdir /var/local/aria2c
RUN touch /var/log/aria2c/aria2c.log
RUN touch /var/local/aria2c/aria2c.sess
RUN chown www-data.www-data -R /var/log/aria2c /var/local/aria2c
RUN chmod 770 -R /var/log/aria2c /var/local/aria2c
RUN sudo -u www-data aria2c --enable-rpc --rpc-allow-origin-all -c -D --check-certificate=false --log=/var/log/aria2c/aria2c.log --log-level=warn

I mean right after the docker-compose up -d command aria2c does not run anyway… thats a problem. When I type in sudo -u www-data aria2c --enable-rpc --rpc-allow-origin-all -c -D --check-certificate=false --log=/var/log/aria2c/aria2c.log --log-level=warn again I end up in this common error.

I’ve tried to give the nextcloudpi container the port 6800 and it does not work either. I can see then that docker-proxy is using the port but it still not works. Without adding the port in the compose file the port is not listening.

apt install daemon
apt install rpcbind
apt install aria2
aria2c --daemon --enable-rpc=true
reboot

2 Likes

These four commands worked for me, thx a lot, jkarban!