Finder won't open app document from iCloud Drive

Originator:jerrykrinock
Number:rdar://19088057 Date Originated:2014-Nov-26
Status:Closed as Duplicate Resolved:
Product:OS X Product Version:OS X 10.10.2 (14C68m)
Classification:Serious Bug Reproducible:Always
 
VIDEO DEMO (1 min 48 sec)

http://youtu.be/QezmbMmgVXs


SUMMARY

OS X apps will not open documents created by non-Apple apps residing in iCloud Drive .  The non-Apple app activates, but nothing opens.


STEPS TO REPRODUCE

1.  Activate Xcode 6.1.
2.  Create a new project.
3.  Configure as OS X, Cocoa app, document-based.
4.  Edit the NSDocument subclass, Document.m
5.  Replace code in -dataOfType:error:, lines 40-43 with:
          return [@"No sandbox, Mom!" dataUsingEncoding:NSUTF8StringEncoding] ;
6.  Delete lines 44-47 so that -readFromData:ofType:error: just returns YES.
7.  Build and Run.  App launches and document window appears.
8.  Click File > Save to ~/Documents
9.  Quit the demo app.
10.  Activate Finder.
11.  Navigate to the saved document
12.  Double-click the document.  App launches and shows document window.
13.  Quit the demo app again.
14.  Activate Finder.
15.  Move the document into iCloud Drive.
16.  Double-click the document again.


EXPECTED RESULT

Test app should launch and show document window.


ACTUAL RESULT

Test app launches but does not show document window.  Several log entries indicating sandbox burps appear in the system console.


NOTES

The possible results from File > Open… are, randomly, one of:

• Once in a while, it works.
• It will silently fail to open.
• It will fail to open and com.apple.bird will log hundreds of messages to the system console.
• You can’t even find the document, because when you click on “iCloud Drive” in the sidebar of the Open sheet, the main pane (where the files and folders should be) is empty and a progress spinner in the lower left corner of the sheet spins forever.

I suspect that the different behaviors may depend on whether or not the file is currently synced to iCloud, and the status of the iCloud Drive daemon, which appears to be nsurlsessiond.  But I haven’t seen any pattern.

I have duplicated the behavior with other non-sandboxed, and at least one non-Apple sandboxed app.   Restarting does not help.

If I navigate to a text file in my iCloud Drive and File > Open with… from the contextual menu, it works with TextEdit, Safari, Firefox, iCab or Opera 12, but fails with my nonsandboxed (I think) BBEdit, or HexEdit.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!