NZBGet Plugin for UnRaid v5b11+


Recommended Posts

FYI - the plugin seems to work fine for me in general, but never shows up in the unraid web interface as "installed." I just get "Status: Not Installed." Clicking "install" appears to work, but the status never changes. Can login to the webgui manually by entering the appropriate URL and port.

 

The plugin webgui determines it's status thus;

1) INSTALLED if it can detect the installation directory (default /mnt/disk1/nzbget).  This is the location you enter in the webgui.  If there's a problem here then it's going to have a problem also.

2) RUNNING if there is a valid process id (PID) file.

 

I'm guessing if it never shows as installed then indeed you have a problem with either the syntax of the install dir or the permissions / ownership of that location.  As it's likely the test is failing and returning to the plugin that it is not "installed".

 

 

I'm a little unclear on what purpose the install button serves anyway since the plugin is really installed at boot or manually via command line.

 

Whilst 90% of the application is "installed" at boot time, there remains installation dependent config.  Hence the "install" button. 

 

It does the following;

#copy template nzbget.conf file to installation directory
#copy template post-processing script to installation directory
#update nzbget.conf with installation specific values.  eg MainDir, post-processing script location, default password
#set default umask
#fix: remove extra slash in webui path due to way binary is built/packaged.
#update ownership and permissions on installation directory & files

 

Perhaps install is not the best wording, but it was done to maintain a look and feel with other plugins using the same methodology.  eg. sab, sick, couch.

 

I ran newperms to try to reset permissions in case it was related to that but didn't seem to help.

Still guessing you have permission problems.

 

Drop to command line and issue these commands;

chown -R nobody:users /mnt/user/download/nzbget
chmod -R 770 /mnt/user/download/nzbget

 

Thanks for the suggestions and the description of how things work. Unfortunately, those permissions commands did not resolve the issue. The plugin was able to create the nzbget folder FWIW. The actual app fails to create the necessary subdirs as well, which is what tipped me off to a permissions issue. I tried manually creating them and rerunning the permissions commands you suggested, but that didn't help.

Link to comment
  • Replies 311
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

I am able to add a .nzb to the queue using the +Add button and everything downloads okay.  If I place the same nzb in the NzbDir to auto-scan, the app crashes and I have to restart it from the plugin screen.  The same crash happens if there are no nzb files in the NzbDir and I hit the Scan button in the +Add dialog box.  I have the directory set to 777.  There are no ERROR messages in nzbget.log.  Any ideas?  I do like the dramatic speed increase I get over SAB and would like to fully migrate.

 

Mike, if you haven't already, please grab the copy of the plugin from post #43.  What version of v5 Unraid are you running?  I ask as dikkiedirk saw issues in the syslog which is what prompted a fresh build.  He saw segfaults which - whilst I'm not totally sure - may have been due to kernel / package versions I had installed at the time of compiling.  Check your syslog for same.

 

I just tried to install the 0.7 version of the plugin and got the following error:

 

file /boot/config/plugins/nzbget/libpar2-0.2-2rj.tgz: downloading from http://dl.dropbox.com/u/572553/UnRAID/nzbget/libpar2-0.2-2rj.tgz ... wget: error while loading shared libraries: libssl.so.0: cannot open shared object file: No such file or directory
bad download, deleting

Warning: unlink(/boot/config/plugins/nzbget/libpar2-0.2-2rj.tgz): No such file or directory in /usr/local/sbin/installplg on line 70

 

I'm running Unraid 5.0-rc8a.  There are no errors in the syslog.

 

I was about to move to the latest RC but the unraid download site is down.  :(

Link to comment

Mike,

 

NZBget is proving a real PITA to build from source.  There are some shared library dependencies which are causing the error your seeing.  I'm getting the same here on both v5.0b12a and rc11 test installs.

 

Not yet got to the bottom of it but I'm actively working on it.

 

For the moment all I can ask is that you bare with me until I can fix it.

 

 

 

Regards,

overbyrn

Link to comment

There are some shared library dependencies which are causing the error your seeing.

 

Instead of creating new dependencies I recommend you to statically link libpar2 and libsigc++ as explained here - GCC build w/ static Ilibpar2-0 and libsigc++ functions.

 

Funny you should say that.  I did had a go doing that last night.  The resultant static version no longer causes segfaults in libc-2.11.1.so.  Unfortunately, it also resulted in never completing a download.  It successfully imported an nzb from the nzb watch folder - something that until now it segfaulted on - and the download ran ok.  The nzb comprised of a multiple rars, which all came down ok, but for the last one where it never fully completed and thus never par checked or unrared.  I'm guessing something in my first attempt at a static build wasn't quite right!

 

I'll check the link you've provided.

 

Many thanks,

overbyrn

 

Link to comment

My idea was to statically link ONLY libpar2 and libsigc++. All other libs remain dynamically linked.

I though you had problems with those two libs only.

hugbug I assume?  ;)   

 

Ah, ok... so only libpar and libsig.  Yes, that makes sense now that I think about it.  The main problems I have / had (and I don't know if they're linked)...

 

First, I see segfaults as mentioned already.  That only seems to happen when nzbget picks up an nzb from the watch dir.  If I feed it a single nzb, it works perfectly.  The second issue is more about what build environment I'm compiling on.  I was getting missing symbol errors, regarding libstdc++ where it required GLIBCXX_3.4.15 but my build env. only had 3.4.13.  So now I'm guessing that those issues probably are to do with libpar and libsigc++, hence the need to only statically build those. 

 

hugbug, thank you.  I'm just a novice when it comes to this level of Linux and I'm learning as I go.  All help gratefully received!

 

 

 

Regards,

overbyrn

Link to comment

I was getting missing symbol errors, regarding libstdc++ where it required GLIBCXX_3.4.15 but my build env. only had 3.4.13.

 

Your build environment seems to be a problem. Sometimes building directly on the target platform avoids such kind of problems. Are there any way to install the build tools on unRAID and build there?

 

Since libpar2 and libsigc++ depend on libstdc++ you may still have problems if you link them statically.

As a test you could try to build NZBGet without par-check (./configure --disable-parcheck). This eliminates dependencies from libpar2 and libsigc++. Then you could test if the download works correctly.

Link to comment

I was getting missing symbol errors, regarding libstdc++ where it required GLIBCXX_3.4.15 but my build env. only had 3.4.13.

 

Your build environment seems to be a problem. Sometimes building directly on the target platform avoids such kind of problems. Are there any way to install the build tools on unRAID and build there?

 

Since libpar2 and libsigc++ depend on libstdc++ you may still have problems if you link them statically.

As a test you could try to build NZBGet without par-check (./configure --disable-parcheck). This eliminates dependencies from libpar2 and libsigc++. Then you could test if the download works correctly.

I've been building on UnRAID, but the issue there is that it needs all the build tools.  Sometimes that can also complicate matters unless all the correct versions and dependencies are met. 

 

I have started fresh with a new build environment and recompiled from source.  So far on two versions of UnRAID (5.0b12a and rc11), both are working.  I am able to put nzb files into NzbDir and whereas before this would cause a segfault to be seen in syslog, both systems are importing the nzb files and downloads are taking place.  They also look to be post-processing correctly too.  I have updated my plugin and requested neilt0 try it also. 

 

NB: this is not yet a static version and I have had to include libsigc++ as a package that is installed as a dependency.  However, so far things seem to be working.  I think this is mostly due to my environment now also using the same level of packages.  Something before was not quite right.

 

I'd very much like to do a static build as that would help a lot.  I took a look at the link you provided.  I think I understand what is needed and will continue to experiment where time permits.  Many thanks hugbug.

 

 

Regards,

overbyrn

Link to comment

Updated first post with v0.8 of plugin. 

 

Now using sane build environment to compile nzbget from source.  Seems to have squashed lot of the problems seen in recent versions.  Tested on unraid versions 5.0b12a, rc10, rc11.  Would be good if others can give it a try to ensure it plays nice on varous systems with/without other plugins.

 

Regards,

overbyrn

 

 

Link to comment

I went ahead and installed nzbget today from the plg in the OP. Just did a quick and dity test setup first. NZBGet is installed in mnt/cache/.nzbget this is also my Maindir.  All other directories are also default. I dropped a nzb in the nzb folder and yes! download started. I let it finish and the file was unpacked to the dst folder. So far this try out went well. It wont create any folders on user shares though. I tried to set the Maindir to /mnt/user/Media so all other folders should get created there but that doesn't work: I get messages like:

 

error Wed Mar 13 2013 11:18:19 nzbget.conf(56): Invalid value for option "NzbDir": could not create directory "/mnt/user/Media/nzb_get/"

error Wed Mar 13 2013 11:18:19 nzbget.conf(59): Invalid value for option "QueueDir": could not create directory "/mnt/user/Media/queue/"

error Wed Mar 13 2013 11:18:19 nzbget.conf(62): Invalid value for option "TempDir": could not create directory "/mnt/user/Media/tmp/"

error Wed Mar 13 2013 11:18:19 nzbget.conf(32): Invalid value for option "DestDir": could not create directory "/mnt/user/Media/nzbgetdownloads/"

 

Could be a permissions thing I guess.

 

In the end I want my downloads stored in the "protected" array folders like: mnt/user/Media/mkv. Will I need to set up categories for that?

 

 

Link to comment

I hit the same issue on testing but I don't know for sure that it's NZBGet which is the problem. 

 

I saw it when I tried to setup nzbget at location /mnt/user/nzbget.  It refused to create directories, regardless if they existed or not. 

 

The fix was to specify the true location, eg. /mnt/disk1/nzbget.  Then it worked.  Of course, this does not work well if the directory your are wanting to refer to is spread over multiple disks on the array as then you'd need to provide it as /mnt/user.

 

 

 

Link to comment

@overbyrn:

There is a function "ForceDirectories" in Util.cpp, which creates directory path. It looks like it fails.

 

You could try to add log-messages there to see what place it fails at.

 

First add #include "Log.h" at the beginning of file.

 

Then for example replace the code

	struct stat buffer;
bool bOK = !stat(szNormPath, &buffer) && S_ISDIR(buffer.st_mode);

with

	bool bStatOK = stat(szNormPath, &buffer) == 0;
bool bOK = bStatOK && S_ISDIR(buffer.st_mode);
info("ForceDirectories(%s)", szPath);
info("stat: %i", (int)bStatOK);
info("dir exists: %i", (int)bOK);
info("st_mode: %i", (int)buffer.st_mode);

 

Please post the output here.

Add more log-messages if necessary.

Link to comment

Hugbug, I'll try your changes and post a result.

 

It is worth highlighting that I have just tried the same with an earlier release of unraid and the problem does not happen.  On version v5.0-beta12a, there is no problem when attempting to create or reference directory paths at location /mnt/user.  I do not know for sure but from the changelog;

 

Changes from 5.0-rc8a to 5.0-rc9
--------------------------------
- emhttp: permissions now set up to operate on (ugo) instead of just (ug)

 

Could be a point in later versions where some underlying permissions changed.  The nzbget binary is running as user "nobody".  I will try the same when running as root, as I suspect this might also cure the issue.

 

 

Link to comment

I hit the same issue on testing but I don't know for sure that it's NZBGet which is the problem. 

 

I saw it when I tried to setup nzbget at location /mnt/user/nzbget.  It refused to create directories, regardless if they existed or not. 

 

The fix was to specify the true location, eg. /mnt/disk1/nzbget.  Then it worked.  Of course, this does not work well if the directory your are wanting to refer to is spread over multiple disks on the array as then you'd need to provide it as /mnt/user.

 

At least I got rid of the libc errors. I for sure won't go the disk1-disk15 route (having 15 disks in the array) so I hope this issue gets solved soon.

Link to comment

Hugbug, I'll try your changes and post a result.

 

It is worth highlighting that I have just tried the same with an earlier release of unraid and the problem does not happen.  On version v5.0-beta12a, there is no problem when attempting to create or reference directory paths at location /mnt/user.  I do not know for sure but from the changelog;

 

Changes from 5.0-rc8a to 5.0-rc9
--------------------------------
- emhttp: permissions now set up to operate on (ugo) instead of just (ug)

 

Could be a point in later versions where some underlying permissions changed.  The nzbget binary is running as user "nobody".  I will try the same when running as root, as I suspect this might also cure the issue.

 

I think you have a valid point there but I also have SABNZBD running as user NOBODY and that works with user shares just fine: ie folders at mnt/user or mnt/user0.

 

Link to comment

@ dikkiedirk,

 

Try this and tell me if you still get a problem.  In NZBGet Permission settings, change UMask to 0000 as per my screen-shot.  Restart NZBGet and try to create a directory under /mnt/user

 

Wjgfp8y.png

 

Still the same

 

The error shows on the restart screen immediately

 

Link to comment

@ hugbug, I did as you requested... amended Util.cpp, recompiled and tested on dev system. 

 

Steps taken & results are as follows:

 

1. install to /mnt/disk1/nzbget & start in daemon mode.  process starts ok, all dirs created under /mnt/disk1/nzbget

2. stop nzbget

3. change logfile to /mnt/disk1/nzbget.log

4. start

5. result of log:

Wed Mar 13 05:51:48 2013 INFO ForceDirectories(/mnt/disk1/nzbget/dst/)

Wed Mar 13 05:51:48 2013 INFO stat: 1

Wed Mar 13 05:51:48 2013 INFO dir exists: 1

Wed Mar 13 05:51:48 2013 INFO st_mode: 16877

Wed Mar 13 05:51:48 2013 INFO ForceDirectories(/mnt/disk1/nzbget/tmp/)

Wed Mar 13 05:51:48 2013 INFO stat: 1

Wed Mar 13 05:51:48 2013 INFO dir exists: 1

Wed Mar 13 05:51:48 2013 INFO st_mode: 16877

Wed Mar 13 05:51:48 2013 INFO ForceDirectories(/mnt/disk1/nzbget/queue/)

Wed Mar 13 05:51:48 2013 INFO stat: 1

Wed Mar 13 05:51:48 2013 INFO dir exists: 1

Wed Mar 13 05:51:48 2013 INFO st_mode: 16877

Wed Mar 13 05:51:48 2013 INFO ForceDirectories(/mnt/disk1/nzbget/nzb/)

Wed Mar 13 05:51:48 2013 INFO stat: 1

Wed Mar 13 05:51:48 2013 INFO dir exists: 1

Wed Mar 13 05:51:48 2013 INFO st_mode: 16877

6. mv /mnt/disk1/nzbget.log /mnt/disk1/nzbget.log.sav

7. change destdir to /mnt/user/downloads 

(/mnt/user exists but /mnt/user/downloads does not)

8. soft restart nzbget

9. result of log:

Wed Mar 13 06:11:59 2013        INFO    Reloading...

Wed Mar 13 06:11:59 2013        INFO    ForceDirectories(/mnt/user/downloads/)

Wed Mar 13 06:11:59 2013        INFO    stat: 0

Wed Mar 13 06:11:59 2013        INFO    dir exists: 0

Wed Mar 13 06:11:59 2013        INFO    st_mode: 0

Wed Mar 13 06:11:59 2013        INFO    ForceDirectories(/mnt/user)

Wed Mar 13 06:11:59 2013        INFO    stat: 0

Wed Mar 13 06:11:59 2013        INFO    dir exists: 0

Wed Mar 13 06:11:59 2013        INFO    st_mode: 20

Wed Mar 13 06:11:59 2013        INFO    ForceDirectories(/mnt)

Wed Mar 13 06:11:59 2013        INFO    stat: 1

Wed Mar 13 06:11:59 2013        INFO    dir exists: 1

Wed Mar 13 06:11:59 2013        INFO    st_mode: 16877

Wed Mar 13 06:11:59 2013        ERROR  nzbget.conf(32): Invalid value for option "DestDir": could not create directory "/mnt/user/downloads/"

Wed Mar 13 06:11:59 2013        INFO    ForceDirectories(/mnt/disk1/nzbget/tmp/)

Wed Mar 13 06:11:59 2013        INFO    stat: 1

Wed Mar 13 06:11:59 2013        INFO    dir exists: 1

Wed Mar 13 06:11:59 2013        INFO    st_mode: 16877

Wed Mar 13 06:11:59 2013        INFO    ForceDirectories(/mnt/disk1/nzbget/queue/)

Wed Mar 13 06:11:59 2013        INFO    stat: 1

Wed Mar 13 06:11:59 2013        INFO    dir exists: 1

Wed Mar 13 06:11:59 2013        INFO    st_mode: 16877

Wed Mar 13 06:11:59 2013        INFO    ForceDirectories(/mnt/disk1/nzbget/nzb/)

Wed Mar 13 06:11:59 2013        INFO    stat: 1

Wed Mar 13 06:11:59 2013        INFO    dir exists: 1

Wed Mar 13 06:11:59 2013        INFO    st_mode: 16877

Wed Mar 13 06:11:59 2013        INFO    Pausing all activities due to errors in configuration

 

NB: the above was done with DaemonUsername = nobody / UMask = 1000 & DaemonUsername = root / UMask = 000 (same result both times).

 

Based on above, I am not sure how to proceed next.  I do not understand where the problem is that is causing the failure to create /mnt/user/downloads.  Please advise if you have any further thoughts on this.

 

 

Kind Regards,

overbyrn

 

 

Link to comment

System function stat fails for "/mnt/user" but works for "/mnt".

The linked article for "stat" has an example program. Can you compile it and run with "/mnt" and "/mnt/user" as parameters to compare the output? The program should print error message if "stat" fails.

Save the example to file "test.c" and compile using c-compiler.

Link to comment

System function stat fails for "/mnt/user" but works for "/mnt".

The linked article for "stat" has an example program. Can you compile it and run with "/mnt" and "/mnt/user" as parameters to compare the output? The program should print error message if "stat" fails.

Save the example to file "test.c" and compile using c-compiler.

Hi hugbug, thanks for your continued support.  Would be great to get to the bottom of this issue.  I have done as you requested and here are the results;

 

root@EddieDEV2:~# /boot/stat_test /mnt
File type:                directory
I-node number:            879
Mode:                     40755 (octal)
Link count:               5
Ownership:                UID=0   GID=0
Preferred I/O block size: 4096 bytes
File size:                0 bytes
Blocks allocated:         0
Last status change:       Fri Mar 15 11:14:41 2013
Last file access:         Fri Mar 15 11:14:29 2013
Last file modification:   Fri Mar 15 11:14:41 2013

 


root@EddieDEV2:~# /boot/stat_test /mnt/user
stat: Value too large for defined data type

 

I did some reading to understand the error and found this: link

 

I added this param to gcc and recompiled the same stat code as before to a new binary thus;

gcc -D_FILE_OFFSET_BITS=64 -o stat_test2 stat_test.c

 

And this time when I repeat the same stat against /mnt/user, I get:

root@EddieDEV2:~# /boot/stat_test2 /mnt/user
File type:                directory
I-node number:            2
Mode:                     40777 (octal)
Link count:               1
Ownership:                UID=99   GID=100
Preferred I/O block size: 131072 bytes
File size:                80 bytes
Blocks allocated:         0
Last status change:       Fri Mar 15 11:14:41 2013
Last file access:         Mon Mar 11 07:31:26 2013
Last file modification:   Fri Mar 15 11:12:44 2013

:)

 

I have no clue where to make the change and more importantly if this is the correct change!  This is not my area of expertise, so I will leave it to you to advise what can be done next.

 

EDIT: FYI, UnRAID v5 is based on Slack 13.1, gcc-4.4.4, glibc-2.11.1 & glib2-2.22.5.

 

 

Kind Regards,

overbyrn

 

 

Link to comment
Guest
This topic is now closed to further replies.