e-alfred / ocdownloader

ocDownloader - AGPL-licensed multi-protocol download manager for Nextcloud using ARIA2, youtube-dl and Curl (supports Youtube, BitTorrent, HTTP, FTP)
https://github.com/e-alfred/ocdownloader
GNU Affero General Public License v3.0
375 stars 85 forks source link

"Returned GID is null! Is Aria2c running as a daemon" error after reboot #198

Open RussianNeuroMancer opened 3 years ago

RussianNeuroMancer commented 3 years ago
### Steps to reproduce 1. Configure aria2c as suggested on [Aria2c Daemon Setup](https://github.com/e-alfred/ocdownloader/wiki/Aria2c-Daemon-Setup) page on Ubuntu 20.04. 2. Reboot 3. /var/run was re-created during boot, because it's tmpfs, so there is no /var/run/aria2c anymore, so deamon does not start and session file is lost. ### Expected behaviour I guess instruction in wiki shouldn't suggest using tmpfs for storing session file? #### Aria2c configuration (remove if not used): **Which command line/configuration options are you using:** --console-log-level=warn --conf-path=/etc/aria2c.daemon ##### Aria2c error log
Aria2c log file (set the log level to debug by using --log-level=debug) ``` Exception: [download_helper.cc:563] errorCode=1 Ошибка открытия файл /var/run/aria2c/aria2c.sess: File not found or it is a directory ```
xkill commented 3 years ago

Hi,

I just fixed the wiki: the systemd service to automatically create the /var/run/folder. Basically adding the following to the service section:

RuntimeDirectory=aria2c
RuntimeDirectoryMode=0755
ExecStartPre=-/bin/touch /var/run/aria2c/aria2c.sess

Now Aria starts fine. But I'm still having the GID error.

Seems a problem with ocdownloader, I'm also debugging why youtube-dl does not work.

xkill commented 3 years ago

OK, seems an update removed the rpc-secret from ocDownloader configuration. So go to NextCloud settings -> Additional settings And change the secret.

There is a issue on the admin panel and the aria2c settings does not appear, so change to curl and change it back to aria2c to see the settings.

RussianNeuroMancer commented 3 years ago

Basically adding the following to the service section

Could you please explain how this supposed to fix the issue? /var/run content is lost upon reboot (because it's tmpfs) so session file with all downloads will be lost (and dht peers will be lost too).

Did you actually tried to perform "Steps to reproduce" from bugreport description?

seems an update removed the rpc-secret from ocDownloader configuration.

Unrelated in my case, I never set rpc-secret in first place.

xkill commented 3 years ago

Basically adding the following to the service section

Could you please explain how this supposed to fix the issue? /var/run content is lost upon reboot (because it's tmpfs) so session file with all downloads will be lost (and dht peers will be lost too).

RuntimeDirectory automatically creates the run folder.

Tested and works fine.

I updated the wiki page too to match the changes.

RussianNeuroMancer commented 3 years ago

RuntimeDirectory automatically creates the run folder.

Yes, it does, but /var/run/aria2c/aria2c.sess content is lost upon reboot, so it's empty. Therefore ocDownloader can not find downloads that was there before reboot, which lead to "Error, GID not found!" error as I just tested:

Снимок экрана от 2021-02-15 17-38-48

Tested and works fine.

Did you have running torrent downloads before reboot when you tested it? How /var/run/aria2c/aria2c.sess content is supposed to be restored after reboot? How DHT peers is supposed to be restored after reboot?

aledr commented 3 years ago

There is no option to set secret at "Additional settings -> ocDownloader".

aledr commented 3 years ago

There is no option to set secret at "Additional settings -> ocDownloader".

Fixed switching "Which downloader do you want to use?" to cURL and back to ARIA2. Options for ARIA2 are visible now.

e-alfred commented 3 years ago

@RussianNeuroMancer I am not sure where the Readme suggests that the session file should be stored on a temporary filesystem. Maybe we should add a warning that the session file shouldn't be stored on any kind of temporary filesystem?

I will update the wiki page as necessary.

RussianNeuroMancer commented 3 years ago

@e-alfred

Maybe we should add a warning that the session file shouldn't be stored on any kind of temporary filesystem?

This, and also provide working configuration instead of this current one.