NZBGet Queue gets removed.

Get help, report and discuss bugs.
Post Reply
dlrdlrdlr
Posts: 9
Joined: 08 Jan 2015, 05:10

NZBGet Queue gets removed.

Post by dlrdlrdlr » 03 Feb 2015, 21:30

I don't know if its an error on my side or just isn't possible but if my pi running NZBGet is restarted or loses power for what ever reason all files currently downloading or queued up to download get removed as well as the history. Is there anyway to get it to save and resume downloads on a system reboot.

Just to clarify the files themselves still exist but the history is cleared and queue is removed.

hugbug
Developer & Admin
Posts: 7645
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: NZBGet Queue gets removed.

Post by hugbug » 03 Feb 2015, 23:05

By default the queue is reloaded on start. Check the messages if there are any errors. Also make sure options SaveQueue and ReloadQueue are active.

dlrdlrdlr
Posts: 9
Joined: 08 Jan 2015, 05:10

Re: NZBGet Queue gets removed.

Post by dlrdlrdlr » 03 Feb 2015, 23:29

Both are active and the error log is wiped however I'll look into logs.

hugbug
Developer & Admin
Posts: 7645
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: NZBGet Queue gets removed.

Post by hugbug » 03 Feb 2015, 23:35

After reboot, before starting NZBGet, take a look at QueueDir, does it exist at all?
Don't you use some kind of temp-dir (to store queue), which gets wiped/recreated after restart?

dlrdlrdlr
Posts: 9
Joined: 08 Jan 2015, 05:10

Re: NZBGet Queue gets removed.

Post by dlrdlrdlr » 04 Feb 2015, 00:35

I have a /queue dir full of number files and a single file named feeds queue and stats I also have a /nzb folder full of files from my history with the extension .nzb.queued both have files from when I first installed NZBGet so I don't think its being deleted. There is an empty tmp directory

hugbug
Developer & Admin
Posts: 7645
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: NZBGet Queue gets removed.

Post by hugbug » 04 Feb 2015, 11:43

Now, when you see the folders are there, start NZBGet and check if queue was loaded.

dlrdlrdlr
Posts: 9
Joined: 08 Jan 2015, 05:10

Re: NZBGet Queue gets removed.

Post by dlrdlrdlr » 04 Feb 2015, 20:39

Yes when I manually stopped and then started NZBGet the queue, history both were still there, so it must only happen if I restart the raspberry pi I'm running it on. so should I just make sure NZBGet is stopped before shutting down the pi to save the queue or is there another option.

hugbug
Developer & Admin
Posts: 7645
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: NZBGet Queue gets removed.

Post by hugbug » 04 Feb 2015, 20:45

It's not necessary about stopping. The problem can be in starting. If the path where QueueDir is stored is not mounted at the time NZBGet starts. To test this - stop NZBGet, check that the queue exists on disk, then reboot (NZBGet must be configured to start on boot).

dlrdlrdlr
Posts: 9
Joined: 08 Jan 2015, 05:10

Re: NZBGet Queue gets removed.

Post by dlrdlrdlr » 04 Feb 2015, 21:11

I can't test right now however this is probably the issue as both files are on a network hard drive, would moving it to the local sd card be the best solution? I would prefer to leave it on hard drive due to space and read write limits of the SD card but since the folders don't seem to be that large it wouldn't be a huge deal to just move them.

erty
Posts: 4
Joined: 26 Mar 2014, 17:38

Re: NZBGet Queue gets removed.

Post by erty » 11 Feb 2015, 01:08

hugbug wrote:It's not necessary about stopping. The problem can be in starting. If the path where QueueDir is stored is not mounted at the time NZBGet starts. To test this - stop NZBGet, check that the queue exists on disk, then reboot (NZBGet must be configured to start on boot).
I can confirm this permanently clears the queue every time.

I worked around it using systemd by modifying the unit file:

Code: Select all

dl:~$ cat /etc/systemd/system/nzbgetd.service
[Unit]
Description=NZBGet binary newsgrabber
After=network.target local-fs.target remote-fs.target mnt-downloads\x2dnew.mount mnt-downloads.mount mnt-othertv.mount
Requires=mnt-downloads\x2dnew.mount mnt-downloads.mount mnt-othertv.mount
Wants=sickbeard.service

[Service]
ExecStart=/usr/local/bin/nzbget -D $OPTIONS
Restart=on-failure
User=sickbeard
Group=nzbget
Type=idle

[Install]
WantedBy=multi-user.target
Alias=nzbget.service
(Tested on Raspbian jessie).

The Requires= directive ensures that the filesystems are mounted when nzbget is started. The After= directive is required to ensure nzbgetd starts after the filesystems are mounted (otherwise, they're started in parallel, and a long fsck might cause nzbget to clear out the queue before the filesystem is mounted).

This works, but it requires modifying the unit file, and will be different on every machine. It would be a lot easier if nzbget was able to recover from a missing queuedir itself.

(Edit: the other option is to remove "nofail" from the fstab for those filesystems. That will ensure that the filesystems are mounted at boot. However, if the filesystem fails to mount, it'll drop you to an emergency shell, which will cause problems on a headless server).

Post Reply

Who is online

Users browsing this forum: No registered users and 55 guests