extracting files fles with long paths --> failed extraction

Report & discuss bugs found in SABnzbd
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
Davor
Newbie
Newbie
Posts: 9
Joined: January 1st, 2011, 11:56 am

extracting files fles with long paths --> failed extraction

Post by Davor »

Sometimes rar files, when extracted, contain very long paths. Sabnzbd will not extract these, abort the extraction and complain that there were missing files in the history tab:
"Unpacking failed, an expected file was not unpacked"
In the logs you find something like this:

Code: Select all

... ::INFO::[newsunpack:403] Extracting rarfile ....
... ::INFO::[newsunpack:635] Missing expected file: ...
... ::INFO::[newsunpack:200] Unrar finished on ...
Upon manual extraction with winrar I get an error that the paths are too long (+260 chars), so I assume this is the culprit.

Extracting it manually with a short path works.

Whether this is worth a bug I leave up to you.

Regards,
Davor
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: extracting files fles with long paths --> failed extract

Post by shypike »

Windows is hindered by poor support for long file names.
Solving that properly is very hard and not an investment I'm willing to make right now,
due to other priorities.
However, there is an (hidden) option to limit the size of individual path elements.
See here: http://wiki.sabnzbd.org/configure-special item folder_max_length
A size of 64 is a safe bet.
Davor
Newbie
Newbie
Posts: 9
Joined: January 1st, 2011, 11:56 am

Re: extracting files fles with long paths --> failed extract

Post by Davor »

Thank you. Wasn't aware of those hidden options.
minimeh
Newbie
Newbie
Posts: 34
Joined: March 26th, 2010, 12:42 pm

Re: extracting files fles with long paths --> failed extract

Post by minimeh »

I ran into the path length problem because I wanted to keep Sab's working folders out of the root of the hard drive. So by the time you prepend something like "C:\Documents and Settings\theuser\My Documents\sabnzbd", you've used up a pretty good chunk of the 260 characters normally allowed. While Windows does support a prefix, "\\?\", that permits an extended-length path for a maximum total path length of 32,767 characters (e.g. "\\?\C:\Documents and Settings\theuser\My Documents\sabnzbd"), supporting that is tricky at best. See http://msdn.microsoft.com/en-us/library ... 85%29.aspx for Windows path name details.

The solution that I turned to was a junction point. A junction point allows the creation of a folder in one location that redirects to another folder in another location. So I created a folder "c:\sab" and pointed it to "C:\Documents and Settings\theuser\My Documents\sabnzbd", giving me 52 more characters to play with. Since doing that, I've had no issues.

There is a freeware utility called "Junction Link Magic" that makes managing junction points a snap. See http://www.rekenwonder.com/linkmagic.htm. That page also goes into details on junction points.

Of course, you could just reconfigure SabNZBD to work with a regular folder "c:\sab" and move what you currently have to there. In my case, the only problem experienced was during extraction. I have a bunch of scripts and media players and so forth that are configured to look at the original folder. By using a junction point, I'm able to keep all happy with the least amount of rejiggering.
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: extracting files fles with long paths --> failed extract

Post by shypike »

I know that Windows can handle long file names, only Microsoft made it very cumbersome.
Not all programming libraries support it properly and both par2 and unrar aren't so easily tamed.
As I said before, I know it's an issue, but I don't assign it a high priority right now.

Good that you found a working solution.
Davor
Newbie
Newbie
Posts: 9
Joined: January 1st, 2011, 11:56 am

Re: extracting files fles with long paths --> failed extract

Post by Davor »

minimeh wrote:There is a freeware utility called "Junction Link Magic" [...]
Nice idea. Note that you can use junction or linkd (from win resource kit or support tools) or mklink in Win7. I prefer those above the 3d party utils.
Post Reply