Page 1 of 1

Recent Issue With GIT 0.7.x Branch

Posted: February 24th, 2014, 9:15 pm
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


Re: Recent Issue With GIT 0.7.x Branch

Posted: February 24th, 2014, 9:17 pm
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)

Re: Recent Issue With GIT 0.7.x Branch

Posted: February 25th, 2014, 10:37 am
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.

Re: Recent Issue With GIT 0.7.x Branch

Posted: February 25th, 2014, 10:52 am
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.

Re: Recent Issue With GIT 0.7.x Branch

Posted: February 25th, 2014, 3:53 pm
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.

Re: Recent Issue With GIT 0.7.x Branch

Posted: February 25th, 2014, 5:39 pm
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.

Re: Recent Issue With GIT 0.7.x Branch

Posted: February 26th, 2014, 10:35 am
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.

Re: Recent Issue With GIT 0.7.x Branch

Posted: March 1st, 2014, 3:48 am
by finalius
shypike's latest commit (a6a68b9b672c4d2abcb4ae0d4bffad4e74184e9f) reversing an older commit fixed this for me - thanks!

Re: Recent Issue With GIT 0.7.x Branch

Posted: March 1st, 2014, 3:53 am
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.

Re: Recent Issue With GIT 0.7.x Branch

Posted: March 14th, 2015, 12:17 am
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

Re: Recent Issue With GIT 0.7.x Branch

Posted: March 14th, 2015, 2:45 pm
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.