Recent Issue With GIT 0.7.x Branch

Questions and bug reports for Beta releases should be posted here.
Forum rules
Help us help you:
  • 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
sytanek
Release Testers
Release Testers
Posts: 6
Joined: October 18th, 2010, 9:38 am

Recent Issue With GIT 0.7.x Branch

Post by sytanek »

For the last two days I have been having issues with all downloads, this is the same setup I have been running for years, so not sure whats' gone wrong.

Box is Debian. Help? :)

Code: Select all

2014-02-25 02:11:21,680::DEBUG::[misc:813] Moving. Old path:/media/1000gb1/Downloads/incomplete/XXXXXX S06E16.720p HDTV x264-XXXXXX /XXXXXX .S06E16.720p.HDTV.X264-XXXXXX .nzb new path:/media/1000gb1/Downloads/complete/tv/_UNPACK_XXXXXX _S06E16.720p_HDTV_x264-DIMENSION/XXXXXX .S06E16.720p.HDTV.X264-XXXXXX .nzb overwrite?:0

2014-02-25 02:11:21,683::ERROR::[postproc:403] Error renaming "/media/1000gb1/Downloads/complete/tv/_UNPACK_XXXXXX _S06E16.720p_HDTV_x264-XXXXXX " to "/media/1000gb1/Downloads/complete/tv/XXXXXX _S06E16.720p_HDTV_x264-XXXXXX "

2014-02-25 02:11:21,683::INFO::[postproc:404] Traceback:
Traceback (most recent call last):
  File "/opt/usenet/sabnzbd/sabnzbd/postproc.py", line 401, in process_job
    newfiles = rename_and_collapse_folder(tmp_workdir_complete, workdir_complete, newfiles)
  File "/opt/usenet/sabnzbd/sabnzbd/postproc.py", line 792, in rename_and_collapse_folder
    renamer(oldpath, newpath)
  File "/opt/usenet/sabnzbd/sabnzbd/misc.py", line 1254, in renamer
    os.rename(old, new)
OSError: [Errno 18] Invalid cross-device link

sytanek
Release Testers
Release Testers
Posts: 6
Joined: October 18th, 2010, 9:38 am

Re: Recent Issue With GIT 0.7.x Branch

Post by sytanek »

Rolled back a couple versions for now, and back to working.

Seems to be a ton of google results for this os.rename Invalid Cross-Device Link Error.... One Solution mentioned quite a few times was the following.

# Instead of:
#os.renames(os.path.join(root, old), new) # Rename, remove empty folders

# Use:
if not os.path.exists(os.path.dirname(new)):
os.makedirs(os.path.dirname(new))
shutil.move(os.path.join(root, old), new)
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: Recent Issue With GIT 0.7.x Branch

Post by shypike »

This piece of code has been in there for quite some time, so I'm surprised that you suddenly get this.
Even so, I will look into this.
The os.renames() documentation isn't clear about support of cross-volume issues.
sytanek
Release Testers
Release Testers
Posts: 6
Joined: October 18th, 2010, 9:38 am

Re: Recent Issue With GIT 0.7.x Branch

Post by sytanek »

Thanks for the response shypike, I rolled back to commit e90ff0eeb76aa9d7d7b6aeb1c78ff3a47c30f265 and the issue doesn't occur. I can try updating one commit at a time to see when the issue does if it will help?

I am auto updating on SAB restart, I guess if its been a couple weeks since it restarted I could have been behind a couple commits.
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: Recent Issue With GIT 0.7.x Branch

Post by shypike »

Scanning through the changes since the 30f265 commit shows nothing related.
Very strange, if it's indeed a bug, it must be some far removed side-effect.
I would appreciate if you spend the effort on finding the bad commit.

Looking at the rename_and_collapse() function, it doesn't take into account cross-volume moves,
because there shouldn't be one.
This is also what your logging shows. I don't see a cross-volume move:
/media/1000gb1/Downloads/complete/tv/_UNPACK_XXXXXX _S06E16.720p_HDTV_x264-XXXXXX
/media/1000gb1/Downloads/complete/tv/XXXXXX _S06E16.720p_HDTV_x264-XXXXXX

Of course I can change the code to what you suggest, but I would need to check
the behaviour on multiple platforms.
sytanek
Release Testers
Release Testers
Posts: 6
Joined: October 18th, 2010, 9:38 am

Re: Recent Issue With GIT 0.7.x Branch

Post by sytanek »

I will work on it , it has happened to several pals now and they discovered that if you turn off config -> switches, 'folder rename', then it works again.

Which there is a note under that option to turn off if it doesn't work on your system....lol

I haven't messed with the config, so not sure what the deal was.
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: Recent Issue With GIT 0.7.x Branch

Post by shypike »

Odd, the option was only ever there for Windows systems,
which can be completely paranoid about folder renames.
Odd that more sensible systems suffer from the same problem.
Maybe it's a problem in Python's run-time library after all.
I will look into your alternative code.
finalius
Newbie
Newbie
Posts: 25
Joined: October 30th, 2011, 9:33 am

Re: Recent Issue With GIT 0.7.x Branch

Post by finalius »

shypike's latest commit (a6a68b9b672c4d2abcb4ae0d4bffad4e74184e9f) reversing an older commit fixed this for me - thanks!
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: Recent Issue With GIT 0.7.x Branch

Post by shypike »

Right, in retrospect it is obvious that this bad commit was the cause all along.
Sorry, I wasn't thinking when I did that one.
arabella
Newbie
Newbie
Posts: 1
Joined: March 14th, 2015, 12:11 am

Re: Recent Issue With GIT 0.7.x Branch

Post by arabella »

# Use:
if not os.path.exists(os.path.dirname(new)):
os.makedirs(os.path.dirname(new))
shutil.move(os.path.join(root, old), new)






_____________________
We offer guaranteed success for learn a language.com learn russian exam with help of latest certification http://www.learnalanguage.com/ and practice questions and the exams of French Yabla ccie security German.about
Last edited by arabella on March 30th, 2015, 12:17 am, edited 1 time in total.
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: Recent Issue With GIT 0.7.x Branch

Post by shypike »

That piece of code will not work properly.
For folders, the result will be that "old" will be moved inside "new".
I'll look into it again.
Post Reply