This project has moved. For the latest updates, please go here.

2.4b1: add to iTunes library is failing

Nov 6, 2014 at 5:50 PM
I have "Add to iTunes" enabled for my MCEBuddy task, but MCEBuddy fails to add the video to iTunes. See the snippet from the log below (the full log is available on the upload site in the dmorse2112 directory, filename Arrow_20141105_19002000.ts-Comskip TS-2014-11-05T20-02-31.5975456-06-00.log)
--> About to add M:\Videos\TV Shows\Arrow\Arrow-S03E05-The Secret Origin of Felicity Smoak.mp4 to the iTunes library
ERROR> --> ERROR: Unable to communicate with iTunes Library, iTunes may not be installed or no user is logged in. File not added to the iTunes library.
Error : System.Runtime.InteropServices.COMException (0x80080005): Retrieving the COM class factory for component with CLSID {DC0C2640-1415-4644-875C-6F4D769839BA} failed due to the following error: 80080005 Server execution failed (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE)).
   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
   at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
   at System.Activator.CreateInstance(Type type, Boolean nonPublic)
   at System.Activator.CreateInstance(Type type)
   at MCEBuddy.MetaData.VideoMetaData.AddFileToiTunesLibrary(String filePath, Log jobLog)
Windows Server 2012 R2, MCEBuddy 2.4b1, latest iTunes 64-bit (12.0.1.26).

Any ideas?
Coordinator
Nov 6, 2014 at 6:23 PM
It isn't able to communicate with the iTunes COM object. This could be because of high server load causing the COM object to time out.
Also we've never tested with iTunes 12, only iTunes 11. Any way you can test with iTunes 11 and see if it works?
Marked as answer by rboy1 on 11/23/2014 at 11:42 AM
Nov 6, 2014 at 6:29 PM
rboy1 wrote:
It isn't able to communicate with the iTunes COM object. This could be because of high server load causing the COM object to time out.
This server is very powerful, so I doubt high load was the cause.
Also we've never tested with iTunes 12, only iTunes 11. Any way you can test with iTunes 11 and see if it works?
Probably not easily. When I updated to 12, on first launch it said "Updating iTunes library" and spun for a while. I have a feeling the iTunes 12 database format is newer (and probably not backwards compatible).
Coordinator
Nov 6, 2014 at 7:44 PM
Edited Nov 6, 2014 at 7:44 PM
Just tested it with iTunes 12 x64, Windows 8.1 and 2.4.1 it's working perfectly. Something with either your CPU (sometimes background processes can slow down the loading of the COM server which can cause a timeout, in a server it's quite possible) or a corrupted iTunes installation.
Coordinator
Nov 23, 2014 at 6:00 PM
Edited Nov 23, 2014 at 8:12 PM
Also ensure iTunes is closed.

There is another thing I found, if iTunes 12 is open while MCEBuddy is running it fails to connect via the COM server. Try to close iTunes and then run MCEBuddy. If that works great, it's an iTunes issue and the workaround is to close iTunes. It should be able to communicate via COM while it's open, if not then Apple may need to fix it. This is NOT consistent, only sometimes so again it could be a COM server issue.
Marked as answer by rboy1 on 11/23/2014 at 11:01 AM
Coordinator
Nov 23, 2014 at 7:47 PM
To work around we are adding a retry option, sometimes the COM server responds after a few retries. We will retry upto 5 times going forwaord. Wait for today's build for the new update
Nov 23, 2014 at 9:26 PM
rboy1 wrote:
To work around we are adding a retry option, sometimes the COM server responds after a few retries. We will retry upto 5 times going forwaord. Wait for today's build for the new update
Very cool. Will test this with and without iTunes open. Thanks for continuing to pursue this issue.

David