2

I've been storing image files on Dropbox (uploaded automatically from my phone via their "Camera Uploads" feature). I just discovered that I don't have permission to open them from my synced Dropbox folder on my computer. The error is a dialog box reading:

The file “20160622_165411.jpg” couldn’t be opened because you don’t have permission to view it.
To view or change permissions, select the item in the Finder and choose File > Get Info.

In Console, I see:

2017-02-06 08:12:33.317 Preview[15288]: PVImageContainer initWithURL:file:///Users/zipslime/Dropbox/20160622_165411.jpg failed, error = Error Domain=NSCocoaErrorDomain Code=257 "The file “20160622_165411.jpg” couldn’t be opened because you don’t have permission to view it." UserInfo={NSFilePath=/Users/zipslime/Dropbox/20160622_165411.jpg, NSUnderlyingError=0x7fea18e85bd0 {Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"}}

This only seems to happen with my computer's default program (Preview). I can open the files in Firefox, and even with Finder's Quick Look. What's going on with Preview, and how can I fix this?


Solutions I've tried:

  • Check Get Info (already shows the right permissions; see below)
  • chmod 744 and chmod 777
  • Move the files out of the Dropbox folder
  • Downloading a fresh copy of the file via the Dropbox web client does work, but is not a reasonable solution at scale.

From Get Info:

enter image description here

From Terminal:

> ls -l 20160622_165411.jpg 
-rw-r--r--@ 1 zipslime  staff   3.0M Jun 24  2016 20160622_165411.jpg

> whoami
zipslime

> chmod 777 20160622_165411.jpg 
> ls -l 20160622_165411.jpg 
-rwxrwxrwx@ 1 zipslime  staff   3.0M Jun 24  2016 20160622_165411.jpg*

> open 20160622_165411.jpg 
# still fails

I found an unusual attribute (the content was a bunch of inscrutable hex characters), but deleting it doesn't change things either.

> ls -lO@ 20160622_165411.jpg 
-rwxrwxrwx@ 1 zipslime  staff  -  3.0M Jun 24  2016 20160622_165411.jpg*    com.dropbox.attributes    83B
> xattr -d com.dropbox.attributes 20160622_165411.jpg

> open 20160622_165411.jpg 
# still fails
  • Have you contacted Dropbox support? – IconDaemon Feb 6 '17 at 18:07
  • Thanks for suggesting that. I'll try it, though I'm still interested in the question of how it's even possible for Preview to be unable to open a file with these permissions. – octern Feb 6 '17 at 19:07
  • Are the files at the root level of your Dropbox folder, stored in the default Camera Uploads folder, or in another folder altogether? – IconDaemon Feb 6 '17 at 19:18
  • It occurs for most or all files in Camera Uploads. It's also occurring for some images in the Dropbox root, but other files in that folder are unaffected. – octern Feb 7 '17 at 1:40
0

This solution on the dropbox website solved my problem. However, I'm still perplexed! Where was the secret permission that wasn't visible from Get Info, ls, or xattr? Alternate answers with explanation would be welcome.

  1. Click on the Dropbox icon in your menu bar and then click on the gear in the Notifications panel.
  2. Select 'Preferences' then click on the 'Account' tab.
  3. Hold down the 'Option' key, and the "unlink this dropbox" button will change to "Fix Permissions". Click the button while continuing to hold down Option.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .