0

I copied several thousand photos off of a network drive onto my local drive and I'm trying to import them into Photos. Several hundred of them had an "Unknown Error" importing, so I opened Console, tried reimporting one of the failed photos, and found this in the logs:

CreateWithURL:306: *** ERROR: err=1 (Operation not permitted) - could not open /Users/david/Downloads/1980s/1989_April_0001_a.jpg

I enabled Full Disk Access for Photos in Settings and restarted. I ran xattr -rc to strip extended attributes and then chmod 777 on all the photos. I even tried running Photos as sudo. I got the same error every time. I ran DiskUtil diagnostics on the drive and it's not showing any file permissions issues.

A strange thing I noticed is that when I try to import one of the failed photos individually, it fails as expected. BUT if I then close Photos, reopen it, and import that same photo, it works. This makes me think there might be some caching of failed imports in Photos. Is there some sort of cache that Photos keeps of failed imports, and if so, is there a way to clear that cache?

1
  • I found a Reddit thread that mentioned changing the extension from .jpg to .jpeg and, strangely, that fixed it for a few hundred of these. I did have to quit and reopen photos several times to import the batch of 4,000+ photos I was importing. Photos seems to have some kind of per-import size or quantity limit that resets when you quit and reopen. You can rename files this way with this command: find . -type f -name '*.jpg' -print0 | xargs -0 rename 's/\.jpg/\.jpeg/' Or in Finder, select all photos, right click, then select "Rename." Commented Jul 1 at 18:05

1 Answer 1

0

Okay, I chained a few things together and was able to get it working.

First, as mentioned earlier, I stripped out extended attributes and added generous permissions on the files with xattr -rc and chmod 777.

Then, I found a Reddit thread that mentioned changing the extension from .jpg to .jpeg, and, strangely, that allowed some of the failed ones to import successfully.

You can rename files this way with this command:

find . -type f -name '*.jpg' -print0 | xargs -0 rename 's/\.jpg/\.jpeg/' Or in Finder, select all photos, right-click, then select Rename.

I then imported my photos in batches of 1,000 at a time, quitting and reopening the app after each batch. This was a pain, given that I had several thousand photos, but my guess is that there is some kind of per-import file quantity or size limit.

You must log in to answer this question.

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