Base Folder issue: "The Completed Download Folder cannot be the same or a subfolder of the Temporary Download Folder"

Get help with all aspects of 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
montydepaola
Newbie
Newbie
Posts: 5
Joined: November 29th, 2024, 6:19 pm

Base Folder issue: "The Completed Download Folder cannot be the same or a subfolder of the Temporary Download Folder"

Post by montydepaola »

I have a Windows Server 2016 with two drives.
While installing I try and set my folders to my second drive, in this case my Z: drive.
The Z: drive has two folders, Z:\complete and Z:\incomplete
When I switch the folders and try to apply the setting I receive the following error

The Completed Download Folder cannot be the same or a subfolder of the Temporary Download Folder

This error really makes no sense as neither statement in the error is true.
I have tried the default values and then editing the config file with the new locations but the server reverts to the original locations for the Temporary Download folder each time during startup.

I have also gone as far as changing my Downloads folder via the registry. This also does not work as it still shows the downloads folder at C:\Users\Administrator\Downloads.

Am I missing something that lets me me use C:\Users\Administrator and simply not Z:\ as the root for these folders?

Thanks for any input
User avatar
sander
Release Testers
Release Testers
Posts: 9079
Joined: January 22nd, 2008, 2:22 pm

Re: Base Folder issue

Post by sander »

Can you post a screenshot (like described on https://forums.sabnzbd.org/viewtopic.php?t=26810 )?
montydepaola
Newbie
Newbie
Posts: 5
Joined: November 29th, 2024, 6:19 pm

Re: Base Folder issue

Post by montydepaola »

imgur . com / a / BLJMT9h
User avatar
sander
Release Testers
Release Testers
Posts: 9079
Joined: January 22nd, 2008, 2:22 pm

Re: Base Folder issue

Post by sander »

So https://imgur.com/a/BLJMT9h . Thanks.

Can you show a picture with both Incomplete/Temp and Complete in the screenshot?

It happens here https://github.com/sabnzbd/sabnzbd/blob ... #L430-L463 ... but I don't know why.

If you use C:\incomplete resp C:\complete ... is that accepted? Note: first make those directories!

If you use Z:\complete and Z:\incomplete (so: 'wrong' order): is that accepted by SABnzbd?

In other words: play with the directories so we can pinpoint / deduct better.
montydepaola
Newbie
Newbie
Posts: 5
Joined: November 29th, 2024, 6:19 pm

Re: Base Folder issue: "The Completed Download Folder cannot be the same or a subfolder of the Temporary Download Folder

Post by montydepaola »

Nice catch there.
So here is everything I have tried now.
Place both folders directly on the c: drive...C:\complete and C:\incomplete...this works fine
Switch the two folders on the Z: drive...use Z:\incomplete for the completed folder and Z:\complete for incomplete folder...same error
Created random named folders on the Z: drive...same error
Create symbolic link in C:\arrs "mlink /H C:\arrs\complete Z:\complete" as complete pointing to Z:\complete while still using Z:\incomplete for the temp...same error

Needless to say....I am lost somewhere here
montydepaola
Newbie
Newbie
Posts: 5
Joined: November 29th, 2024, 6:19 pm

Re: Base Folder issue: "The Completed Download Folder cannot be the same or a subfolder of the Temporary Download Folder

Post by montydepaola »

OK, let me go through some setup changes here to see if this helps.
I am running a Windows 2016 server as a virtual server in UNRAID
Server is up to date with all drivers and guest-tools installed
Server has two drives, one for the OS, C: and one for applications Z:...both drives are qcow2

To try and figure this out I decided to add a passthrough USB drive to the server. I formatted it as exFAT and gave it a drive letter of Y:
I made the folders...
Y:\incomplete
Y:\complete
Y:\complete\movies
Y:\complete\shows
I changed the paths to correspond Y:\incomplete for the temp folder and Y:\complete for the completed folder and everything works.

So my real confusion now is why will the USB drive work but the second drive via QEMU will not?
I am going to try one more setup to see if there is a difference, I have a spare SSD drive in my server and am going to pass it through to the VM and see if by doing it this way will give me a different result.

Also am currently creating a 2012 R2 server with the same original setup of two qcow2 drives of C: and Z: to see if this is a server version issue.
Lets hope for something good here
User avatar
sander
Release Testers
Release Testers
Posts: 9079
Joined: January 22nd, 2008, 2:22 pm

Re: Base Folder issue: "The Completed Download Folder cannot be the same or a subfolder of the Temporary Download Folder

Post by sander »

Ah, a special setup! And Unraid, so normally I would shout #UnraidAlert ... but I cannot image unraid is causing this.

Do you have (or can you create) a github account?

If so, I can create a Windows binary that does extra logging in the relevant python code. My guess is one of the functions is truncating your directory names to the same (maybe an empty?) string.

SABnzbd only checks on the string, not on the type of filesystem, so I'm still surprised.
montydepaola
Newbie
Newbie
Posts: 5
Joined: November 29th, 2024, 6:19 pm

Re: Base Folder issue: "The Completed Download Folder cannot be the same or a subfolder of the Temporary Download Folder

Post by montydepaola »

So, am now thinking the is something on the UNRAID side. I am running 7.0.0-beta.4 right now.
I had the same problem with the 2012 R2 server with two qcow2 drives
The passthrough SSD drive works just fine just like the attached USB drive

Also I did throw up a BOHDI box with 2 qcow2 drives with the second drive mounted under /media and there is no problem there at all, but sadly for this server there is no way for me to use a Linux box.

As a last resort I setup a quick web server with php on the 2016 VM box and took a look at the the output of the folder names on the Z: drive with echo $_SERVER['DOCUMENT_ROOT'].
Instead of coming out as Z:\complete and Z:\incomplete as they should, they show as ////?//Z:\complete and ////?//Z:\incomplete
Think this has something to do with virtio as the same folders on the C: drive show up with the correct paths and the C: drive is passed through as a SATA drive to make the install easier.

I will now try and pass the Z: drive through as SATA and see where that leaves me.
Need to leave for a bit but will let you know where this ends.

Thanks again for all the help and all the work that goes into this project.
User avatar
sander
Release Testers
Release Testers
Posts: 9079
Joined: January 22nd, 2008, 2:22 pm

Re: Base Folder issue: "The Completed Download Folder cannot be the same or a subfolder of the Temporary Download Folder

Post by sander »

> Instead of coming out as Z:\complete and Z:\incomplete as they should, they show as ////?//Z:\complete and ////?//Z:\incomplete

I think that is some kind of (correct?) Windows speak

https://github.com/sabnzbd/sabnzbd/blob ... #L715-L719 says

path = path.replace("\\\\?\\UNC\\", "\\\\", 1).replace("\\\\?\\", "", 1)


I cannot simulate from fillesystem.same_directory() because I'm not on Windows, but maybe the below is helpful for you (if you have python3 on your system). Even with overruling the win32 checks.

Code: Select all

sander@zwarte:~/git/sabnzbd$ python3
Python 3.12.3 (main, Nov  6 2024, 18:32:19) [GCC 13.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from sabnzbd import filesystem

>>> filesystem.same_directory("a", "b")
0

>>> filesystem.same_directory("abc", "abc")
1

>>> filesystem.same_directory("////?//Z:\\complete", "////?//Z:\\incomplete")
0
User avatar
sander
Release Testers
Release Testers
Posts: 9079
Joined: January 22nd, 2008, 2:22 pm

Re: Base Folder issue: "The Completed Download Folder cannot be the same or a subfolder of the Temporary Download Folder

Post by sander »

I created a sabnzbd with more logging. You need a github account to access & download the Windows binary.

Go to https://github.com/sabnzbd/sabnzbd/acti ... 2105461171 and scroll down to bottom of the page, and you'll see:
" Windows installer"
"Windows standalone binary (64bit)" ... I used this one and installed into its own directory C:\temp\sab-samedir

Then:
stop the normal SABnzbd
from the unpack directory run sabnzbd.exe (or sabnzbd-console.exe). Windows will probably say "are you sure" because it doesn't know the binary.
make sure logging +Debug is on
go into the SABnzbd GUI, and change the directory to something. In sabnzbd.log you should see logging like below.

And ... I cannot reproduce the problem.


Code: Select all

2024-12-01 13:41:58,368::DEBUG::[filesystem:436] samedir 100: a is \\?\d:\incomplete, b is \\?\D:\complete
2024-12-01 13:41:58,368::DEBUG::[filesystem:442] samedir 200: a is d:\incomplete, b is d:\complete
2024-12-01 13:41:58,369::DEBUG::[filesystem:447] samedir 300: a is d:\incomplete, b is d:\complete
2024-12-01 13:41:58,369::DEBUG::[filesystem:456] samedir 400: a is d:\incomplete\, b is d:\complete\
2024-12-01 13:41:58,369::DEBUG::[filesystem:463] samedir 500 is_subfolder 0
2024-12-01 13:41:58,370::DEBUG::[filesystem:470] samedir 700
EDIT

With some more hacking on Windows, I get this:

Code: Select all

C:\temp\git\sabnzbd>python
Python 3.11.9 (tags/v3.11.9:de54cf5, Apr  2 2024, 10:12:12) [MSC v.1938 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from sabnzbd import filesystem
>>> filesystem.same_directory("a", "b")
samedir 100: a is a, b is b
samedir 200: a is a, b is b
samedir 300: a is C:\temp\git\sabnzbd\a, b is C:\temp\git\sabnzbd\b
samedir 400: a is C:\temp\git\sabnzbd\a\, b is C:\temp\git\sabnzbd\b\
samedir 500 is_subfolder 0
samedir 900
0
That's weird in 300 and 400: the directory is put in front of the string? So that's done by a = os.path.normpath(os.path.abspath(a)) ?

Anyway: With the UNC directories you gave, I cannot reproduce:

Code: Select all

>>> filesystem.same_directory("////?//Z:\complete", "////?//Z:\incomplete")
samedir 100: a is ////?//Z:\complete, b is ////?//Z:\incomplete
samedir 200: a is ////?//z:\complete, b is ////?//z:\incomplete
samedir 300: a is \\\?\z:\complete, b is \\\?\z:\incomplete
samedir 400: a is \\\?\z:\complete\, b is \\\?\z:\incomplete\
samedir 500 is_subfolder 0
samedir 900


0
User avatar
sander
Release Testers
Release Testers
Posts: 9079
Joined: January 22nd, 2008, 2:22 pm

Re: Base Folder issue: "The Completed Download Folder cannot be the same or a subfolder of the Temporary Download Folder

Post by sander »

> Instead of coming out as Z:\complete and Z:\incomplete as they should, they show as ////?//Z:\complete and ////?//Z:\incomplete

Wait: forward slashes on Windows?! On my Windows setup: \\?\D:\incomplete ... so normal windows-backslash.

So this is caused by the layers of VMs/OSes (Windows in a VM on Unraid) and disks you're using?

Anyway: hopefully your logging will tell how same_directory() is handling this.
User avatar
sander
Release Testers
Release Testers
Posts: 9079
Joined: January 22nd, 2008, 2:22 pm

Re: Base Folder issue: "The Completed Download Folder cannot be the same or a subfolder of the Temporary Download Folder

Post by sander »

@montydepaola

Will you test with the Windows test SABnzbd I provided? Would be useful. If not for you (workaround?), then for SABnzbd in general: if there is a bug in SABnzbd and/or we can improve SABnzbd's handling.

If you're not going to test, let me know, so I don't have to wait in vain.
Post Reply