Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep getting "Destination path '%s' already exists..." error when moving to "Automatically Add to iTunes" #250

Closed
OskarPersson opened this issue Apr 23, 2015 · 15 comments

Comments

@OskarPersson
Copy link

I've setup sickbeard_mp4_automator together with Sickrage and Deluge and for some reason I sometimes get the Destination path '%s' already exists" % real_ds.. error when converting a video and moving it to Automatically Add to iTunes.

In sickbeard_mp4_automator/autoProcess.ini I have

output_directory = C:\Users\oskar\Desktop\converted\tv
move_to = D:\iTunes Media\Automatically Add to iTunes

Deluge is set to move all finished videos with the sickrage label to C:\Users\oskar\Desktop\complete\tv

In Sickrage\config.ini I have

torrent_path = C:\Users\oskar\Desktop\complete\tv
root_dirs = 0|D:\iTunes Media\TV Shows
tv_download_dir = C:\Users\oskar\Desktop\complete\tv
process_method = move
torrent_dir = c:\\Users\\oskar\\torrents

Am I missing something?

@mdhiggins
Copy link
Owner

Can you post your info.log file for me?

@OskarPersson
Copy link
Author

2015-04-24 03:10:49 - SickbeardPostConversion - INFO - Sickbeard extra script post processing started.
2015-04-24 03:10:50 - readSettings - WARNING - Audio bitrate was invalid, defaulting to 256 per channel.
2015-04-24 03:10:53 - SickbeardPostConversion - INFO - Processing D:\iTunes Media\TV Shows\The Big Bang Theory\Season 8\The Big Bang Theory S08E22 The Graduation Transmission.mp4.
2015-04-24 03:10:59 - SickbeardPostConversion - INFO - Tagging D:\iTunes Media\TV Shows\The Big Bang Theory\Season 8\The Big Bang Theory S08E22 The Graduation Transmission.mp4 with ID 80379 season 8 episode 22.
2015-04-24 03:11:01 - tvdb_mp4 - INFO - Tagging file: C:\Users\oskar\Desktop\converted\tv\The Big Bang Theory S08E22 The Graduation Transmission.mp4.
2015-04-24 03:11:01 - tvdb_mp4 - INFO - Trying to write tags.
2015-04-24 03:11:02 - tvdb_mp4 - INFO - Tags written successfully.
2015-04-24 03:11:02 - mkvtomp4 - INFO - Relocating MOOV atom to start of file.
2015-04-24 03:11:02 - mkvtomp4 - WARNING - QT FastStart did not run - perhaps moov atom was at the start already.
2015-04-24 03:11:02 - mkvtomp4 - ERROR - Unable to move C:\Users\oskar\Desktop\converted\tv\The Big Bang Theory S08E22 The Graduation Transmission.mp4 to D:\iTunes Media\Automatically Add to iTunes
Traceback (most recent call last):
  File "C:\sickbeard_mp4_automator\mkvtomp4.py", line 611, in replicate
    shutil.move(inputfile.decode(sys.getfilesystemencoding()), moveto)
  File "C:\Python27\lib\shutil.py", line 292, in move
    raise Error, "Destination path '%s' already exists" % real_dst
Error: Destination path 'D:\iTunes Media\Automatically Add to iTunes\The Big Bang Theory S08E22 The Graduation Transmission.mp4' already exists

@mdhiggins
Copy link
Owner

And does the file appear in your Automatically Add to iTunes folder ever? or is this a weird false positive that shutil is complaining about?

@OskarPersson
Copy link
Author

It does but it stays at 0 KB

@mdhiggins
Copy link
Owner

So the way the move-to function works, is that it tries to move the file first, and when it fails it repeats the attempt using getfilesystemencoding() assuming that the initial failure was due to a special character in the filename.

What's probably happening is that the initial copy is failing for an unknown reason, then this second attempt using the modified filename fails because the first attempt didn't fail in the way that was expected.

I went ahead and put in some more logging information so we can see why the first attempt is failing and address that problem. I also put in an additional check during the second attempt to delete any existing file that matches the file name, which may resolve your issue.

Update and report back for me. Even if it works I'm curious why its failing during the initial attempt.

@OskarPersson
Copy link
Author

Tried again after update. Still only a file at 0 kB

2015-04-24 17:14:29 - SickbeardPostConversion - INFO - Sickbeard extra script post processing started.
2015-04-24 17:14:29 - readSettings - WARNING - Audio bitrate was invalid, defaulting to 256 per channel.
2015-04-24 17:14:29 - SickbeardPostConversion - INFO - Processing D:\iTunes Media\TV Shows\The Big Bang Theory\Season 8\The Big Bang Theory S08E22 The Graduation Transmission.mkv.
2015-04-24 17:14:29 - mkvtomp4 - INFO - Reading video stream.
2015-04-24 17:14:29 - mkvtomp4 - INFO - Video codec detected: h264
2015-04-24 17:14:29 - mkvtomp4 - INFO - Reading audio streams.
2015-04-24 17:14:30 - mkvtomp4 - INFO - Audio detected for stream #1: aac [eng].
2015-04-24 17:14:30 - mkvtomp4 - INFO - Creating audio stream 0 from source audio stream 1 [iOS-audio].
2015-04-24 17:14:30 - mkvtomp4 - INFO - Creating audio stream 1 from source audio stream 1.
2015-04-24 17:14:30 - mkvtomp4 - INFO - Reading subtitle streams.
2015-04-24 17:14:30 - mkvtomp4 - INFO - Subtitle detected for stream #2: srt [eng].
2015-04-24 17:14:30 - mkvtomp4 - INFO - Creating subtitle stream 0 from source subtitle stream 2.
2015-04-24 17:14:30 - mkvtomp4 - INFO - Starting conversion.
2015-04-24 17:17:19 - mkvtomp4 - INFO - C:\Users\oskar\Desktop\converted\tv\The Big Bang Theory S08E22 The Graduation Transmission.mp4 created.
2015-04-24 17:17:19 - SickbeardPostConversion - INFO - Tagging D:\iTunes Media\TV Shows\The Big Bang Theory\Season 8\The Big Bang Theory S08E22 The Graduation Transmission.mkv with ID 80379 season 8 episode 22.
2015-04-24 17:17:21 - tvdb_mp4 - INFO - Tagging file: C:\Users\oskar\Desktop\converted\tv\The Big Bang Theory S08E22 The Graduation Transmission.mp4.
2015-04-24 17:17:21 - tvdb_mp4 - INFO - Trying to write tags.
2015-04-24 17:17:22 - tvdb_mp4 - INFO - Tags written successfully.
2015-04-24 17:17:22 - mkvtomp4 - INFO - Relocating MOOV atom to start of file.
2015-04-24 17:17:26 - mkvtomp4 - ERROR - Unable to move C:\Users\oskar\Desktop\converted\tv\The Big Bang Theory S08E22 The Graduation Transmission.mp4 to D:\iTunes Media\Automatically Add to iTunes
Traceback (most recent call last):
  File "C:\sickbeard_mp4_automator\mkvtomp4.py", line 618, in replicate
    shutil.move(inputfile.decode(sys.getfilesystemencoding()), moveto)
  File "C:\Python27\lib\shutil.py", line 292, in move
    raise Error, "Destination path '%s' already exists" % real_dst
Error: Destination path 'D:\iTunes Media\Automatically Add to iTunes\The Big Bang Theory S08E22 The Graduation Transmission.mp4' already exists

@mdhiggins
Copy link
Owner

My mistake, I stupidly wrapped the new exception printing inside the second try bracket. Which means there’s no new useful logging in what you just posted. This log does confirm that its failing on the second try now however.

I fixed it and pushed another update. We should get some more logging information now if you update and run again. Sorry about that.


Sent from Mailbox

On Fri, Apr 24, 2015 at 11:21 AM, Oskar Persson notifications@github.com
wrote:

Tried again after update

2015-04-24 17:14:29 - SickbeardPostConversion - INFO - Sickbeard extra script post processing started.
2015-04-24 17:14:29 - readSettings - WARNING - Audio bitrate was invalid, defaulting to 256 per channel.
2015-04-24 17:14:29 - SickbeardPostConversion - INFO - Processing D:\iTunes Media\TV Shows\The Big Bang Theory\Season 8\The Big Bang Theory S08E22 The Graduation Transmission.mkv.
2015-04-24 17:14:29 - mkvtomp4 - INFO - Reading video stream.
2015-04-24 17:14:29 - mkvtomp4 - INFO - Video codec detected: h264
2015-04-24 17:14:29 - mkvtomp4 - INFO - Reading audio streams.
2015-04-24 17:14:30 - mkvtomp4 - INFO - Audio detected for stream #1: aac [eng].
2015-04-24 17:14:30 - mkvtomp4 - INFO - Creating audio stream 0 from source audio stream 1 [iOS-audio].
2015-04-24 17:14:30 - mkvtomp4 - INFO - Creating audio stream 1 from source audio stream 1.
2015-04-24 17:14:30 - mkvtomp4 - INFO - Reading subtitle streams.
2015-04-24 17:14:30 - mkvtomp4 - INFO - Subtitle detected for stream #2: srt [eng].
2015-04-24 17:14:30 - mkvtomp4 - INFO - Creating subtitle stream 0 from source subtitle stream 2.
2015-04-24 17:14:30 - mkvtomp4 - INFO - Starting conversion.
2015-04-24 17:17:19 - mkvtomp4 - INFO - C:\Users\oskar\Desktop\converted\tv\The Big Bang Theory S08E22 The Graduation Transmission.mp4 created.
2015-04-24 17:17:19 - SickbeardPostConversion - INFO - Tagging D:\iTunes Media\TV Shows\The Big Bang Theory\Season 8\The Big Bang Theory S08E22 The Graduation Transmission.mkv with ID 80379 season 8 episode 22.
2015-04-24 17:17:21 - tvdb_mp4 - INFO - Tagging file: C:\Users\oskar\Desktop\converted\tv\The Big Bang Theory S08E22 The Graduation Transmission.mp4.
2015-04-24 17:17:21 - tvdb_mp4 - INFO - Trying to write tags.
2015-04-24 17:17:22 - tvdb_mp4 - INFO - Tags written successfully.
2015-04-24 17:17:22 - mkvtomp4 - INFO - Relocating MOOV atom to start of file.
2015-04-24 17:17:26 - mkvtomp4 - ERROR - Unable to move C:\Users\oskar\Desktop\converted\tv\The Big Bang Theory S08E22 The Graduation Transmission.mp4 to D:\iTunes Media\Automatically Add to iTunes
Traceback (most recent call last):
  File "C:\sickbeard_mp4_automator\mkvtomp4.py", line 618, in replicate
    shutil.move(inputfile.decode(sys.getfilesystemencoding()), moveto)
  File "C:\Python27\lib\shutil.py", line 292, in move
    raise Error, "Destination path '%s' already exists" % real_dst
Error: Destination path 'D:\iTunes Media\Automatically Add to iTunes\The Big Bang Theory S08E22 The Graduation Transmission.mp4' already exists

Reply to this email directly or view it on GitHub:
#250 (comment)

@OskarPersson
Copy link
Author

2015-04-24 18:01:11 - SickbeardPostConversion - INFO - Sickbeard extra script post processing started.
2015-04-24 18:01:11 - readSettings - WARNING - Audio bitrate was invalid, defaulting to 256 per channel.
2015-04-24 18:01:11 - SickbeardPostConversion - INFO - Processing D:\iTunes Media\TV Shows\The Big Bang Theory\Season 8\The Big Bang Theory S08E22 The Graduation Transmission.mkv.
2015-04-24 18:01:11 - mkvtomp4 - INFO - Reading video stream.
2015-04-24 18:01:11 - mkvtomp4 - INFO - Video codec detected: h264
2015-04-24 18:01:11 - mkvtomp4 - INFO - Reading audio streams.
2015-04-24 18:01:11 - mkvtomp4 - INFO - Audio detected for stream #1: aac [eng].
2015-04-24 18:01:11 - mkvtomp4 - INFO - Creating audio stream 0 from source audio stream 1 [iOS-audio].
2015-04-24 18:01:11 - mkvtomp4 - INFO - Creating audio stream 1 from source audio stream 1.
2015-04-24 18:01:11 - mkvtomp4 - INFO - Reading subtitle streams.
2015-04-24 18:01:11 - mkvtomp4 - INFO - Subtitle detected for stream #2: srt [eng].
2015-04-24 18:01:11 - mkvtomp4 - INFO - Creating subtitle stream 0 from source subtitle stream 2.
2015-04-24 18:01:11 - mkvtomp4 - INFO - Starting conversion.
2015-04-24 18:04:04 - mkvtomp4 - INFO - C:\Users\oskar\Desktop\converted\tv\The Big Bang Theory S08E22 The Graduation Transmission.mp4 created.
2015-04-24 18:04:04 - SickbeardPostConversion - INFO - Tagging D:\iTunes Media\TV Shows\The Big Bang Theory\Season 8\The Big Bang Theory S08E22 The Graduation Transmission.mkv with ID 80379 season 8 episode 22.
2015-04-24 18:04:06 - tvdb_mp4 - INFO - Tagging file: C:\Users\oskar\Desktop\converted\tv\The Big Bang Theory S08E22 The Graduation Transmission.mp4.
2015-04-24 18:04:06 - tvdb_mp4 - INFO - Trying to write tags.
2015-04-24 18:04:06 - tvdb_mp4 - INFO - Tags written successfully.
2015-04-24 18:04:06 - mkvtomp4 - INFO - Relocating MOOV atom to start of file.
2015-04-24 18:04:11 - mkvtomp4 - ERROR - Unable to move C:\Users\oskar\Desktop\converted\tv\The Big Bang Theory S08E22 The Graduation Transmission.mp4 to D:\iTunes Media\Automatically Add to iTunes
Traceback (most recent call last):
  File "C:\sickbeard_mp4_automator\mkvtomp4.py", line 618, in replicate
    shutil.move(inputfile.decode(sys.getfilesystemencoding()), moveto)
  File "C:\Python27\lib\shutil.py", line 292, in move
    raise Error, "Destination path '%s' already exists" % real_dst
Error: Destination path 'D:\iTunes Media\Automatically Add to iTunes\The Big Bang Theory S08E22 The Graduation Transmission.mp4' already exists

@mdhiggins
Copy link
Owner

Just pushed another update that may actually fix the issue, sorry to keep making you test.

Let me know how it goes.

@OskarPersson
Copy link
Author

Hmm still not working. I'm glad to help btw! This is awesome support! :)

2015-04-24 18:40:36 - SickbeardPostConversion - INFO - Sickbeard extra script post processing started.
2015-04-24 18:40:36 - readSettings - WARNING - Audio bitrate was invalid, defaulting to 256 per channel.
2015-04-24 18:40:36 - SickbeardPostConversion - INFO - Processing D:\iTunes Media\TV Shows\The Big Bang Theory\Season 8\The Big Bang Theory S08E22 The Graduation Transmission.mkv.
2015-04-24 18:40:36 - mkvtomp4 - INFO - Reading video stream.
2015-04-24 18:40:36 - mkvtomp4 - INFO - Video codec detected: h264
2015-04-24 18:40:36 - mkvtomp4 - INFO - Reading audio streams.
2015-04-24 18:40:36 - mkvtomp4 - INFO - Audio detected for stream #1: aac [eng].
2015-04-24 18:40:36 - mkvtomp4 - INFO - Creating audio stream 0 from source audio stream 1 [iOS-audio].
2015-04-24 18:40:36 - mkvtomp4 - INFO - Creating audio stream 1 from source audio stream 1.
2015-04-24 18:40:36 - mkvtomp4 - INFO - Reading subtitle streams.
2015-04-24 18:40:36 - mkvtomp4 - INFO - Subtitle detected for stream #2: srt [eng].
2015-04-24 18:40:36 - mkvtomp4 - INFO - Creating subtitle stream 0 from source subtitle stream 2.
2015-04-24 18:40:36 - mkvtomp4 - INFO - Starting conversion.
2015-04-24 18:43:29 - mkvtomp4 - INFO - C:\Users\oskar\Desktop\converted\tv\The Big Bang Theory S08E22 The Graduation Transmission.mp4 created.
2015-04-24 18:43:29 - SickbeardPostConversion - INFO - Tagging D:\iTunes Media\TV Shows\The Big Bang Theory\Season 8\The Big Bang Theory S08E22 The Graduation Transmission.mkv with ID 80379 season 8 episode 22.
2015-04-24 18:43:31 - tvdb_mp4 - INFO - Tagging file: C:\Users\oskar\Desktop\converted\tv\The Big Bang Theory S08E22 The Graduation Transmission.mp4.
2015-04-24 18:43:31 - tvdb_mp4 - INFO - Trying to write tags.
2015-04-24 18:43:31 - tvdb_mp4 - INFO - Tags written successfully.
2015-04-24 18:43:31 - mkvtomp4 - INFO - Relocating MOOV atom to start of file.
2015-04-24 18:43:36 - mkvtomp4 - ERROR - First attempt to move the file has failed.
Traceback (most recent call last):
  File "C:\sickbeard_mp4_automator\mkvtomp4.py", line 614, in replicate
    shutil.move(inputfile, moveto)
  File "C:\Python27\lib\shutil.py", line 302, in move
    copy2(src, real_dst)
  File "C:\Python27\lib\shutil.py", line 130, in copy2
    copyfile(src, dst)
  File "C:\Python27\lib\shutil.py", line 83, in copyfile
    with open(dst, 'wb') as fdst:
IOError: [Errno 13] Permission denied: 'D:\\iTunes Media\\Automatically Add to iTunes\\The Big Bang Theory S08E22 The Graduation Transmission.mp4'
2015-04-24 18:43:36 - mkvtomp4 - ERROR - Unable to move C:\Users\oskar\Desktop\converted\tv\The Big Bang Theory S08E22 The Graduation Transmission.mp4 to D:\iTunes Media\Automatically Add to iTunes
Traceback (most recent call last):
  File "C:\sickbeard_mp4_automator\mkvtomp4.py", line 621, in replicate
    shutil.move(inputfile.decode(sys.getfilesystemencoding()), moveto)
  File "C:\Python27\lib\shutil.py", line 292, in move
    raise Error, "Destination path '%s' already exists" % real_dst
Error: Destination path 'D:\iTunes Media\Automatically Add to iTunes\The Big Bang Theory S08E22 The Graduation Transmission.mp4' already exists

@mdhiggins
Copy link
Owner

Well good news is we now know why you're having issues:

[Errno 13] Permission denied: 'D:\\iTunes Media\\Automatically Add to iTunes\\The Big Bang Theory S08E22 The Graduation Transmission.mp4'

Looks like the script does not have permissions to write to your iTunes directory.

@OskarPersson
Copy link
Author

Huh. Any tips? The drive that the iTunes directory is on is formated in HFS+ and I use this driver to read and write to it.

@mdhiggins
Copy link
Owner

I would check your read/write permissions on the specific directory (though I'm not sure how that's affected by that driver). I've never used that before so I can't offer much insight. But that's definitely the source of your problem.

@OskarPersson
Copy link
Author

Yeah seems like that. Thanks for all your help! Will look into it.

@mdhiggins
Copy link
Owner

Gonna close this for now since it seems like an isolate issue with your particular setup.

Good luck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants