Page 1 of 1

iTunes import failed: Could not add file...

PostPosted: Thu Sep 05, 2013 11:03 am
by mrmachine
I use beets to manage my music library, but I would like for Hazel to automatically import any music added to my library via beets. I have configured iTunes to not copy files into it's managed library folder.

My rules are 1: (if Kind is Folder) Run rules on folder contents; 2: (if Kind is Music) Import into iTunes.

This finds all my files, and tries to import them into iTunes. But for what seems like every single file (not 100% sure, there are a lot of files), I see errors like this in the console:

2013-09-06 00:50:21.941 hazelworker[1437] 08 Nihilist Assault Group.mp3: Rule Newly Added Files matched.
2013-09-06 00:50:22.035 hazelworker[1437] Error adding track /Volumes/dataset/Music/Stereolab/Mars Audiac Quintet/08 Nihilist Assault Group.mp3 to playlist Music: Error Domain=NSOSStatusErrorDomain Code=-54 "The operation couldn’t be completed. (OSStatus error -54.)" (permErr: permissions error (on file open)) UserInfo=0x7fcb7e0a2c20 {ErrorNumber=-54}
2013-09-06 00:50:22.035 hazelworker[1437] [Error] iTunes import failed: Could not add file /Volumes/dataset/Music/Stereolab/Mars Audiac Quintet/08 Nihilist Assault Group.mp3 to iTunes.

I see a new notification for "iTunes import failed" at a rate of 1-2 per second in the top right hand corner. The strange thing is, when I check iTunes that file is actually in the library and it can be played. I can also see and play the file from Finder. So I very much doubt there is a permissions error on file open.

Is it because I am telling iTunes to not copy files into the iTunes library? Is Hazel expecting the file to be copied into iTunes, and reporting an error when it is not, even though the track is imported and is referenced from its original location?

Re: iTunes import failed: Could not add file...

PostPosted: Thu Sep 05, 2013 12:18 pm
by Mr_Noodle
That error comes from iTunes. What happens if you try and import one of those files manually?

Re: iTunes import failed: Could not add file...

PostPosted: Thu Sep 05, 2013 5:59 pm
by mrmachine
If I just drag files into iTunes it works as expected. Only Hazel complains, even though the files are actually imported.

Re: iTunes import failed: Could not add file...

PostPosted: Fri Sep 06, 2013 12:21 pm
by Mr_Noodle
It looks like it's being imported from an external drive. Is there anything about it that is out of the ordinary?

Re: iTunes import failed: Could not add file...

PostPosted: Fri Sep 06, 2013 5:58 pm
by mrmachine
It's an AFP share from a NAS4Free server. Seems weird though that iTunes would complain about permissions error opening files to Hazel, when the import does actually work and there's no error when I drag files and folders directly into iTunes?

Re: iTunes import failed: Could not add file...

PostPosted: Mon Sep 09, 2013 12:19 pm
by Mr_Noodle
Hazel may do a couple of things in its interactions, such as looking for whether the track already exists in the library. But ultimately, it's iTunes sending back that error. Maybe there's a permissions issue with the files that already exist in the library?

Re: iTunes import failed: Could not add file...

PostPosted: Mon Sep 09, 2013 6:19 pm
by mrmachine
I started with a completely fresh iTunes library. I dragged one album in from Finder, and it imported without error. I tested dragging the same folder in again, to see if it would import duplicates, but it didn't. The album could be played in iTunes.

Then I ran my Hazel rule across my whole Music folder and it started importing all the music, but as I noted I got an error for what seemed like every file being imported, even though it did import and did play. There would not have been any duplicates being imported or any existing files in the iTunes library.

iTunes is configured to NOT copy files into the managed iTunes library folder. It only imports by reference, so it never copies or moves or replaces any files.

Is there some way to increase the log level and maybe get some additional information?

Re: iTunes import failed: Could not add file...

PostPosted: Tue Sep 10, 2013 12:47 pm
by Mr_Noodle
Is the new library on the boot disk or on an external disk? As for debugging, you can try turning on debug mode as described in the sticky article near the top of this forum.

Re: iTunes import failed: Could not add file...

PostPosted: Tue Sep 10, 2013 5:58 pm
by mrmachine
iTunes library is on the boot disk, in the default location. Actual MP3s are on an AFP share.

Re: iTunes import failed: Could not add file...

PostPosted: Wed Sep 11, 2013 1:02 pm
by Mr_Noodle
Could you do the test with mp3's on the boot drive as well?

Re: iTunes import failed: Could not add file...

PostPosted: Mon Mar 17, 2014 10:29 am
by pjmorr
I am seeing sort of the same issue. I have an afp attached NAS drive (WD MyCloud) with all of my videos. My "import into iTunes rule" is simple. if extension is m4v AND tagged is "import into iTunes" then add to iTunes.

I am seeing mixed messages in the display messages. Some say failed and some say success. They ALL import into iTunes.

Like others, I have iTunes set to not migrate to local disk and not manage naming, just add it to iTunes.

I have connected to the afp share using the proper credentials and I have checked at the NAS level, unix file permissions are the same when comparing ones that said they failed vs. ones that worked.

This was with a completely empty iTunes library so it wasn't because the show was already there....

I would file this as a nuisance bug more than anything because all of the shows end up in iTunes...

Re: iTunes import failed: Could not add file...

PostPosted: Thu Mar 20, 2014 12:46 pm
by Mr_Noodle
Can you post the errors from your logs (even if they look the same as the other person's)?