Orphaned Jobs wiped my drive?!

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
SABdeletedData48
Newbie
Newbie
Posts: 2
Joined: March 4th, 2025, 1:41 pm

Orphaned Jobs wiped my drive?!

Post by SABdeletedData48 »

I noticed I had orphaned jobs in the Status and interface page, so I hit "Queue Repair." This just deleted 6TB of data that I cannot find. What the hell just happened?! Why is SABNzb showing folder structure that is capable of being deleted in here?!

Is there any way to get the data back or am I just out the last 20 years of data I had on that drive? NZBs were stored on a drive that had other folders on it from the rest of my life. I am running this on my macbook, MacOS 10.15.7.
User avatar
safihre
Administrator
Administrator
Posts: 5678
Joined: April 30th, 2015, 7:35 am
Contact:

Re: Orphaned Jobs wiped my drive?!

Post by safihre »

No files are deleted during queue repair, as far as I know.
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
SABdeletedData48
Newbie
Newbie
Posts: 2
Joined: March 4th, 2025, 1:41 pm

Re: Orphaned Jobs wiped my drive?!

Post by SABdeletedData48 »

It cleared a 6TB hard drive with no option to restore, so I can politely call BS on "no files are deleted."
throwaway2050
Newbie
Newbie
Posts: 4
Joined: October 12th, 2025, 11:59 pm

Re: Orphaned Jobs wiped my drive?!

Post by throwaway2050 »

This just happened to me after deleting orphaned jobs. It's literally the only action I took on a particular drive that could have possibly caused it. It's clearly rare, since google found nothing other than this thread. But it would make this thread a hell of a coincidence if something else caused it.

I've never looked at the sabnzbd source code but i am a programmer so I assume what must be happening is that deleting orphaned jobs deletes the temp folder, which in this particular case was the main directory of a media drive I have. Again, I haven't looked at the code, so I'm not sure how the program stores orphaned data, along with how it deals with freeing up that space. If truly all it is doing is wiping the temp folder, then I assume the intent was to keep the code simple, but that is incredibly lazy programming.
User avatar
safihre
Administrator
Administrator
Posts: 5678
Joined: April 30th, 2015, 7:35 am
Contact:

Re: Orphaned Jobs wiped my drive?!

Post by safihre »

It lists the folders in the temp folder and compares those to the ones in the queue. All folders not used by queued items will be removed.
How else do you suppose it should work?
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
throwaway2050
Newbie
Newbie
Posts: 4
Joined: October 12th, 2025, 11:59 pm

Re: Orphaned Jobs wiped my drive?!

Post by throwaway2050 »

safihre wrote: October 14th, 2025, 2:22 pm It lists the folders in the temp folder and compares those to the ones in the queue. All folders not used by queued items will be removed.
How else do you suppose it should work?
This is like saying, "I've marked the trash as trash, but instead of throwing out things marked as trash, I'm going to throw out anything not marked not-trash". Lazy, indirect, arm-length programming.
User avatar
safihre
Administrator
Administrator
Posts: 5678
Joined: April 30th, 2015, 7:35 am
Contact:

Re: Orphaned Jobs wiped my drive?!

Post by safihre »

We don't mark it as trash, it's just folders we don't have any reference to. So they must be some crashed job that we could not recover.
If we had a reference for it, it wouldn't be an orphan. Hence the name.
Nobody should be using our temporary folder except us...
Why place anything in there?
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
Puzzled
Full Member
Full Member
Posts: 168
Joined: September 2nd, 2017, 3:02 am

Re: Orphaned Jobs wiped my drive?!

Post by Puzzled »

Using the root of a drive that you have filled with other stuff as temp isn't the best idea, but someone who does that will probably click delete on auto pilot as well. You could add a verification step to make it very clear what's going on. "Are you sure you want to DELETE all these directories?" and then list them again.

throwaway2050: It does list the "trash" in the window below the wipe all button. All the directories you lost would have been listed there.
throwaway2050
Newbie
Newbie
Posts: 4
Joined: October 12th, 2025, 11:59 pm

Re: Orphaned Jobs wiped my drive?!

Post by throwaway2050 »

Puzzled wrote: October 15th, 2025, 12:16 pm Using the root of a drive that you have filled with other stuff as temp isn't the best idea, but someone who does that will probably click delete on auto pilot as well. You could add a verification step to make it very clear what's going on. "Are you sure you want to DELETE all these directories?" and then list them again.

throwaway2050: It does list the "trash" in the window below the wipe all button. All the directories you lost would have been listed there.
For the record, this particular drive is used for temp usenet downloads, not as a storage for curated media. So I never bothered creating a sub-directory for temp files. Since there was space, I had thrown some other random non-curated media on there. That's how I discovered this. It wasn't as huge a deal as the tone of my second comment may have implied. But I don't buy that people can't fathom the sort of setup I've described above, or that the feature "delete orphaned jobs" doesn't connote "the entire directory will be wiped" to everyone using the software.
safihre wrote: October 15th, 2025, 4:16 am We don't mark it as trash, it's just folders we don't have any reference to. So they must be some crashed job that we could not recover.
If we had a reference for it, it wouldn't be an orphan. Hence the name.
Nobody should be using our temporary folder except us...
Why place anything in there?
I do appreciate the elaboration. However, if all references to the data have been lost, why would there even be a "delete orphaned jobs" feature? This might come across as nitpicky but even rebranding to something like "clear temp directory" would be an improvement. "Delete orphaned jobs" doesn't appropriately describe everything the operation does.
User avatar
safihre
Administrator
Administrator
Posts: 5678
Joined: April 30th, 2015, 7:35 am
Contact:

Re: Orphaned Jobs wiped my drive?!

Post by safihre »

I will add an additional warning that clicking Clear all results in wiping.
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
User avatar
sander
Release Testers
Release Testers
Posts: 9429
Joined: January 22nd, 2008, 2:22 pm

Re: Orphaned Jobs wiped my drive?!

Post by sander »

> Nobody should be using our temporary folder except us...
> Why place anything in there?

So this about users that override SABnzb'd default Incomplete/temp directory "~/Downloads/incomplete" and point it to a general directory (or Downloads/complete, or maybe the root of a drive, so "/media/mybigdrive/" )? Or the other way around: put non-SABnzbd stuff into "~/Downloads/incomplete"

If so, then I now understand.

> I will add an additional warning that clicking Clear all results in wiping.

So ... Windows-style "Are you sure you're sure?"? ;-)

How about this: SABnzbd should consider a directory orphaned if and only if:

SAB has no reference to it

AND

the directory contains the unique SABnzbd signature ".../__ADMIN__/SABnzbd..."

I expect it will find 99+% of orphaned jobs / directories, and avoid the above problems.
User avatar
safihre
Administrator
Administrator
Posts: 5678
Joined: April 30th, 2015, 7:35 am
Contact:

Re: Orphaned Jobs wiped my drive?!

Post by safihre »

This is really for crash recovery. So it could be due to some race condition that there is no admin dir..
So it's fine liks this. With an extra chec. And text that explains what will happen.
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
throwaway2050
Newbie
Newbie
Posts: 4
Joined: October 12th, 2025, 11:59 pm

Re: Orphaned Jobs wiped my drive?!

Post by throwaway2050 »

sander wrote: October 17th, 2025, 10:16 am How about this: SABnzbd should consider a directory orphaned if and only if:

SAB has no reference to it

AND

the directory contains the unique SABnzbd signature ".../__ADMIN__/SABnzbd..."

I expect it will find 99+% of orphaned jobs / directories, and avoid the above problems.
This is what I was going to reply to the question "How else were we supposed to do it?" but it's such an obviously better way of doing it, and paired with the fact I haven't actually seen the source code, well I didn't want to be overly presumptive before knowing for sure that there wasn't some really good reason why it was done this other way. Then when the admin said it's done bc there's no reference to orphaned data, I just became even more confused. Idk, must be my C training, but I can't really conjure a situation where I'd write programs where I end up losing references to data that some operation somewhere will still need to deal with. Even when I'm positive no user could mess things up.
Post Reply