Cannot connect to update iTunes 10.6.3

Bug #1012243 reported by Edwin Hou on 2012-06-12
This bug affects 6 people
Affects Status Importance Assigned to Milestone

Bug Description

calibre, version 0.8.55
ERROR: Error: Error communicating with device

Unknown property, element or command: 'sources'

Traceback (most recent call last):
  File "site-packages/calibre/gui2/", line 82, in run
  File "site-packages/calibre/gui2/", line 339, in _books
  File "site-packages/calibre/devices/apple/", line 3166, in books
  File "site-packages/calibre/devices/apple/", line 2184, in _get_library_books
  File "site-packages/appscript/", line 580, in __getattr__
AttributeError: Unknown property, element or command: 'sources'

Edwin Hou (edwinhou) on 2012-06-12
description: updated

Changing the component for this bug.

 assignee griker
 tag apple-driver
 status triaged

Changed in calibre:
assignee: nobody → GRiker (griker)
status: New → Triaged

My initial guess is that Apple has implemented sandboxing for iTunes as of 10.6.3, making AppleScript access unavailable. I will continue to look at this and post updates here.

Changed in calibre:
status: Triaged → Confirmed


I have confirmed this bug on my system.

My best guess as to what's going on here is that Apple has implemented sandboxing for iTunes, meaning that they are no longer allowing external apps to control iTunes via AppleScript.

I will do some research and see if I can find any reports of other apps having similar problems, but this could be the end of the line for the Apple driver. The obvious solution would be use the server; the less desirable solution would be to run an older version of iTunes.



On Jun 12, 2012, at 1:58 PM, Kovid Goyal wrote:

> Changing the component for this bug.
> assignee griker
> tag apple-driver
> status triaged
> ** Changed in: calibre
> Status: New => Triaged
> ** Changed in: calibre
> Assignee: (unassigned) => GRiker (griker)
> --
> You received this bug notification because you are a bug assignee.
> Title:
> Cannot connect to update iTunes 10.6.3
> Status in calibre: e-book management:
> Triaged
> Bug description:
> calibre, version 0.8.55
> ERROR: Error: Error communicating with device
> Unknown property, element or command: 'sources'
> Traceback (most recent call last):
> File "site-packages/calibre/gui2/", line 82, in run
> File "site-packages/calibre/gui2/", line 339, in _books
> File "site-packages/calibre/devices/apple/", line 3166, in books
> File "site-packages/calibre/devices/apple/", line 2184, in _get_library_books
> File "site-packages/appscript/", line 580, in __getattr__
> AttributeError: Unknown property, element or command: 'sources'
> To manage notifications about this bug go to:

I created a forum post at describing the situation with sandboxing as of iTunes 10.6.3 on OS X.

There's no fix for this. Users updating to 10.6.3 will no longer be able to connect to iDevices nor iTunes.

Changed in calibre:
status: Confirmed → Fix Committed
Kovid Goyal (kovid) on 2012-06-14
Changed in calibre:
status: Fix Committed → Fix Released
Ed Rayner (ed-rayner) wrote :

Here's a way you can get around this problem (if there is no fix).

If you do a folder sync to ~/Music/iTunes/iTunes Music/Books you can see what books from the iTunes library can be matched with books in the Calibre library.

If you want to transfer books to iTunes, then all you need to do is have calibre copy the epub to ~/Music/iTunes/iTunes Music/Automatically Add to iTunes. iTunes will then automatically add the epub immediately.

The app would need to periodically rescan the folder sync folder to see if any new books have been added and then update itself

I tried this manually and it seemed to work, but there's no reason the calibre app couldn't automate it.

Ed - I tried something similar early in the development of the driver, and didn't think that it would be a workable solution. For one thing, it depends upon the user allowing iTunes to manage local storage (many calibre users don't). Another challenge is that calibre uses a special UDID to identify books, which calibre stores in the composer metadata using OSA. This wouldn't happen when adding books through the special folder.

Getting books to iTunes would be easy using the 'Connect to Folder' feature, but it's a one-way trip, and without metadata massaging.

If someone else wants to pick up the development of the driver to try alternative solutions they are welcome to do so.

Ed Rayner (ed-rayner) wrote :

Griker -

Thanks for your prompt reply. I'm not a developer, so I'm not in a position to pick up development of the driver. I also understand that people need to allow iTunes to manage local storage for this work (although I suspect that most people with large iTunes libraries already do this). I did notice though that after I transferred a book through this technique and then ejected the folder (the iTunes book folder) and then reconnected to the folder that it recognized that the book added through the add to iTunes folder was recognized as being in the iTunes book folder and a check mark appeared next to it. It seems to do this even though it doesn't have the special UDID identifier (or maybe it transferred the UDID data anyway to iTunes metadata). What other purpose would putting the UDID data into iTunes serve other than using it to make sure it was the same book in iTunes as in the calibre application?

I understand that this would be a limited solution and that it wouldn't work for some people, but could you make it an option that a user can select in the configuration?

Thanks for considering my suggestion.

Ed Rayner (ed-rayner) wrote :

Upon further checking I see what you mean - the author metadata on the book I transferred was blank (although the title was correct). But isn't the metadata of an epub stored in the epub itself?

I've copied over epubs directly to iTunes and it has found the author metadata automatically, so it must have been metadata stored in the epub itself. I guess that calibre doesn't normally store its metadata in the epub itself. Can't the metadata be transferred to the epub before it is copied to the automatically add to iTunes folder?

Minimal metadata – author, title, genre – are extracted from the OPF file by iTunes when adding a book. All other metadata fields can only be added or edited manually by the user in iTunes, or through the OSA interface.

Calibre's UDID for the book is stored in the 'composer' field, which was selected because it's one of the few fields which can be searched through the iTunes OSA interface. There's no way that I'm aware of to put something in the OPF file that iTunes would subsequently discover and place into the composer field in its database. That's the tip of the iceberg. The rest of the lesser-used metadata - sort fields, series #s, comments, etc - also need a means of finding their way into the iTunes database.

To simplify, the driver as implemented sends the book to iTunes. Once the book has been added to iTunes, calibre then tweaks the metadata according to the user's options.

Without OSA communication, it's possible to get the book to iTunes, but once it's there, there's no way to update the metadata or delete the book.

Fixed in branch lp:calibre. The fix will be in the next release. calibre is usually released every Friday.

 status fixreleased

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers