unrar not recognized / Extractor not working

Support for Deluge on Apple Mac OS
Post Reply
wilson
Member
Member
Posts: 23
Joined: Sat Dec 12, 2015 4:10 pm
Location: US

unrar not recognized / Extractor not working

Post by wilson »

It seems that deluge cannot find 'unrar.

Code: Select all

[WARNING ] 22:26:40 core:113 EXTRACTOR: unrar not found, disabling support for .rar
[WARNING ] 22:26:40 core:113 EXTRACTOR: 7zr not found, disabling support for .7z
This has happened before, reinstalling unrar fixed it last time. I have reinstalled 'unrar' again and yet deluge refuses to recognize it.

Code: Select all

server:~ theater$ which unrar
/opt/local/bin/unrar
How do I get deluge to recognized that I have 'unrar' installed?

I have confirmed that unrar works independent of deluge.

Code: Select all

server:~ theater$ unrar x -o+ -y /Volumes/Media\ SSD/Deluge/Ray.Donovan.S04E02.HDTV.x264-FLEET/ray.donovan.s04e02.hdtv.x264-fleet.rar 

UNRAR 5.21 freeware      Copyright (c) 1993-2015 Alexander Roshal


Extracting from /Volumes/Media SSD/Deluge/Ray.Donovan.S04E02.HDTV.x264-FLEET/ray.donovan.s04e02.hdtv.x264-fleet.rar

Extracting  Ray.Donovan.S04E02.HDTV.x264-FLEET.mkv                     4%

Extracting from /Volumes/Media SSD/Deluge/Ray.Donovan.S04E02.HDTV.x264-FLEET/ray.donovan.s04e02.hdtv.x264-fleet.r00

...         Ray.Donovan.S04E02.HDTV.x264-FLEET.mkv                     9%

Extracting from /Volumes/Media SSD/Deluge/Ray.Donovan.S04E02.HDTV.x264-FLEET/ray.donovan.s04e02.hdtv.x264-fleet.r01

...         Ray.Donovan.S04E02.HDTV.x264-FLEET.mkv                    14%

Extracting from /Volumes/Media SSD/Deluge/Ray.Donovan.S04E02.HDTV.x264-FLEET/ray.donovan.s04e02.hdtv.x264-fleet.r02

...         Ray.Donovan.S04E02.HDTV.x264-FLEET.mkv                    19%

Extracting from /Volumes/Media SSD/Deluge/Ray.Donovan.S04E02.HDTV.x264-FLEET/ray.donovan.s04e02.hdtv.x264-fleet.r03

...         Ray.Donovan.S04E02.HDTV.x264-FLEET.mkv                    24%

Extracting from /Volumes/Media SSD/Deluge/Ray.Donovan.S04E02.HDTV.x264-FLEET/ray.donovan.s04e02.hdtv.x264-fleet.r04

...         Ray.Donovan.S04E02.HDTV.x264-FLEET.mkv                    28%

Extracting from /Volumes/Media SSD/Deluge/Ray.Donovan.S04E02.HDTV.x264-FLEET/ray.donovan.s04e02.hdtv.x264-fleet.r05

...         Ray.Donovan.S04E02.HDTV.x264-FLEET.mkv                    33%

Extracting from /Volumes/Media SSD/Deluge/Ray.Donovan.S04E02.HDTV.x264-FLEET/ray.donovan.s04e02.hdtv.x264-fleet.r06

...         Ray.Donovan.S04E02.HDTV.x264-FLEET.mkv                    38%

Extracting from /Volumes/Media SSD/Deluge/Ray.Donovan.S04E02.HDTV.x264-FLEET/ray.donovan.s04e02.hdtv.x264-fleet.r07

...         Ray.Donovan.S04E02.HDTV.x264-FLEET.mkv                    43%

Extracting from /Volumes/Media SSD/Deluge/Ray.Donovan.S04E02.HDTV.x264-FLEET/ray.donovan.s04e02.hdtv.x264-fleet.r08

...         Ray.Donovan.S04E02.HDTV.x264-FLEET.mkv                    48%

Extracting from /Volumes/Media SSD/Deluge/Ray.Donovan.S04E02.HDTV.x264-FLEET/ray.donovan.s04e02.hdtv.x264-fleet.r09

...         Ray.Donovan.S04E02.HDTV.x264-FLEET.mkv                    52%

Extracting from /Volumes/Media SSD/Deluge/Ray.Donovan.S04E02.HDTV.x264-FLEET/ray.donovan.s04e02.hdtv.x264-fleet.r10

...         Ray.Donovan.S04E02.HDTV.x264-FLEET.mkv                    57%

Extracting from /Volumes/Media SSD/Deluge/Ray.Donovan.S04E02.HDTV.x264-FLEET/ray.donovan.s04e02.hdtv.x264-fleet.r11

...         Ray.Donovan.S04E02.HDTV.x264-FLEET.mkv                    62%

Extracting from /Volumes/Media SSD/Deluge/Ray.Donovan.S04E02.HDTV.x264-FLEET/ray.donovan.s04e02.hdtv.x264-fleet.r12

...         Ray.Donovan.S04E02.HDTV.x264-FLEET.mkv                    67%

Extracting from /Volumes/Media SSD/Deluge/Ray.Donovan.S04E02.HDTV.x264-FLEET/ray.donovan.s04e02.hdtv.x264-fleet.r13

...         Ray.Donovan.S04E02.HDTV.x264-FLEET.mkv                    72%

Extracting from /Volumes/Media SSD/Deluge/Ray.Donovan.S04E02.HDTV.x264-FLEET/ray.donovan.s04e02.hdtv.x264-fleet.r14

...         Ray.Donovan.S04E02.HDTV.x264-FLEET.mkv                    76%

Extracting from /Volumes/Media SSD/Deluge/Ray.Donovan.S04E02.HDTV.x264-FLEET/ray.donovan.s04e02.hdtv.x264-fleet.r15

...         Ray.Donovan.S04E02.HDTV.x264-FLEET.mkv                    81%

Extracting from /Volumes/Media SSD/Deluge/Ray.Donovan.S04E02.HDTV.x264-FLEET/ray.donovan.s04e02.hdtv.x264-fleet.r16

...         Ray.Donovan.S04E02.HDTV.x264-FLEET.mkv                    86%

Extracting from /Volumes/Media SSD/Deluge/Ray.Donovan.S04E02.HDTV.x264-FLEET/ray.donovan.s04e02.hdtv.x264-fleet.r17

...         Ray.Donovan.S04E02.HDTV.x264-FLEET.mkv                    91%

Extracting from /Volumes/Media SSD/Deluge/Ray.Donovan.S04E02.HDTV.x264-FLEET/ray.donovan.s04e02.hdtv.x264-fleet.r18

...         Ray.Donovan.S04E02.HDTV.x264-FLEET.mkv                    96%

Extracting from /Volumes/Media SSD/Deluge/Ray.Donovan.S04E02.HDTV.x264-FLEET/ray.donovan.s04e02.hdtv.x264-fleet.r19

...         Ray.Donovan.S04E02.HDTV.x264-FLEET.mkv                    OK 
All OK

theater: /Users/theater
server:~ theater$ ≈
Also, I still have the customized version of Extractor you supplied a while back. Extractor v0.5a1
Screen Shot 2016-07-09 at 8.49.18 AM.png
Screen Shot 2016-07-09 at 8.49.18 AM.png (87.37 KiB) Viewed 12020 times
I have confirmed that I ONLY have that version installed.
Screen Shot 2016-07-09 at 8.51.57 AM.png
Screen Shot 2016-07-09 at 8.51.57 AM.png (124.88 KiB) Viewed 12020 times
Any additional help would be greatly appreciated. Thanks for the support.
Cas
Top Bloke
Top Bloke
Posts: 3679
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: unrar not recognized / Extractor not working

Post by Cas »

This seems like a deluge user path issue for unrar.

You could test the actual 'which' python script works on osx:

https://raw.githubusercontent.com/delug ... r/which.py

Code: Select all

python -c "from which import which; print which('unrar')"
wilson
Member
Member
Posts: 23
Joined: Sat Dec 12, 2015 4:10 pm
Location: US

Re: unrar not recognized / Extractor not working

Post by wilson »

I have followed the last instruction. Here is the output.

Code: Select all

server:Documents theater$ python -c "from which import which; print which('unrar')"
/opt/local/bin/unrar
I look to the logs and find this after stopping the daemon and restarting

Code: Select all

[WARNING ] 14:32:31 core:113 EXTRACTOR: unrar not found, disabling support for .rar
[WARNING ] 14:32:31 core:113 EXTRACTOR: 7zr not found, disabling support for .7z
Doe this tell me that python is recognizing the installed version of unrar successfully but deluge cannot? unrar absolutely works on it's own.

Thanks again for all the help.
Cas
Top Bloke
Top Bloke
Posts: 3679
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: unrar not recognized / Extractor not working

Post by Cas »

Did you test that for the user that runs deluged? Look into adding unrar to the env var PATH.
wilson
Member
Member
Posts: 23
Joined: Sat Dec 12, 2015 4:10 pm
Location: US

Re: unrar not recognized / Extractor not working

Post by wilson »

I already had the path to unrar in my default $PATH. It is in the first directory listed: /opt/local/bin

Code: Select all

server:~ theater$ echo $PATH
/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Applications/Server.app/Contents/ServerRoot/usr/bin:/Applications/Server.app/Contents/ServerRoot/usr/sbin

theater: /Users/theater
server:~ theater$ which unrar
/opt/local/bin/unrar

I must be missing something else?

EDIT: To answer your previous question, yes, everything is running under a user called "theater" including deluged, here is my LaunchDaemon:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.deluged</string>
<key>ProgramArguments</key>
<array>
<string>/opt/local/bin/deluged</string>
<string>-d</string>
<string>-L</string>
<string>info</string>
<string>-l</string>
<string>/Users/theater/Library/Logs/deluged.log</string>
</array>
<key>UserName</key>
<string>theater</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
</dict>
</plist>
Here is my Activity Monitor:
Screen Shot 2016-07-17 at 7.57.49 PM.png
Screen Shot 2016-07-17 at 7.57.49 PM.png (32.64 KiB) Viewed 11976 times
Cas
Top Bloke
Top Bloke
Posts: 3679
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: unrar not recognized / Extractor not working

Post by Cas »

It's definitely a path issue and launchd although running as that user does not use PATH.
Apple Stackexchange: Executables Not Found In Path wrote: Terminal.app correctly starting the shell doesn’t mean much: it runs /usr/bin/login (with the full path) by default, which invokes your default shell (again: defined with a full path) as an interactive login shell (which will in turn read both .profile and .bashrc and leave you with a working $PATH). Your problem is non-interactive shells, which do neither, do not get any $PATH settings. That seems to point to OS X’ default path settings having somehow been clobbered.

To check this, run cat /etc/paths. The output should (at the very least) be

/usr/bin
/bin
/usr/sbin
/sbin

(these are the defaults on a pristine OS X install). If the first two are missing, you have your cause – and an easy solution:

mv /etc/paths /etc/paths.old # if you want to keep the current contents
def_paths=(/usr/bin /bin /usr/sbin /sbin)
for p in ${def_paths[@]}; do echo $p >> /etc/paths; done
cat /etc/paths.old >> /etc/paths # append previous contents

Note that as /etc/paths is owned by root, you will have to sudo su for this to work.
wilson
Member
Member
Posts: 23
Joined: Sat Dec 12, 2015 4:10 pm
Location: US

Re: unrar not recognized / Extractor not working

Post by wilson »

OK.

So after updating to 1.3.13, unrar is working however, I still have no file but I think I have a usable error from the log that will help troubleshoot what's happening. Does this log help?

Code: Select all

[ERROR   ] 20:43:58 core:172 EXTRACTOR: Extract failed: /path/to/file/folder/file.rar (5191160676451c2f470af6fe4a515096d118e78c) Upon execvpe unrar ['unrar', 'x', '-o+', '-y', '/path/to/file/folder/file.rar] in environment id 4477164632
:Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/twisted/internet/process.py", line 403, in _fork
    path, uid, gid, executable, args, environment)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/twisted/internet/process.py", line 453, in _execChild
    os.execvpe(executable, args, environment)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 355, in execvpe
    _execvpe(file, args, env)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 382, in _execvpe
    func(fullname, *argrest)
OSError: [Errno 8] Exec format error
I'm optimistic that this will give you what you need to help me resolve my final issue. Thanks in advance.
Post Reply