iCloud Photo Sharing: Large Image Uploads fixes

OK, I don’t know why this is a bug, but it definitely exists as an edge case. I’ve been slowly importing my photo library to iCloud, if you take say 4,000 images (I know I have a lot of them!), then it will take MacOS Photos about a week to upload them.
However, if you use iCloud Photo Sharing, this seems to break. I successfully imported 20K images and then when I turned iCloud Photo Sharing on, the synchronization broke. The photo library would not update and all the Photo processes stopped. And getting to 50K, I had to keep running these steps.

TL;dr

If you are doing big uploads and you get hangs, there are three basic steps for solve these errors, turn off your VPN, turn off iCloud Photo Sharing, import galore. When you get a hang, repair your Photo Library and then toggle iCloud Photo Library and run the last import to force a resync.

Hang on update #0: Turn off VPN and DNS Cloak

I’m not sure if this has anything to do with it, but when I turn off my VPN, I got fewer hangs and errors, so that’s the first piece of advice. I don’t think it should make any difference, but it could be that Apple is blocking traffic from VPN points for fraud reasons. I don’t think it matters but I also turned off DNS Cloak because I think that there are times when the DNS lookup for iCloud servers fails.

Hang up on Update : Turn off Photo Sharing

The only way I’ve found to fix this is pretty painful:
Hold the Command key when starting MacOS Photos and create a new library. You will need lots of disk for this!
Then with the new library, make it the System Library in Preferences and turn on iCloud Photo Library but do not turn on iCloud Photo Sharing, the entire library should populate.
Right now it looks like if you are doing lots of imports that you should never have it on. It looks like this doesn’t affect iOS, so you are free to use it it there. The fix seems to be to toggle off iCloud Photo Sharing when doing uploads, then turn it back on again when you are done.

Hang on Update : Toggle iCloud Photo Library

I get many times when it just seems to hang on Updating. The simple fix to repair your library first and then toggle the iCloud Photo Library option. And then run your last import. I also always leave keep folder organization so you can find things, otherwise it sorts of EXIF date and if you have old photos, they are really lost forever in a massive library. The last import is safe because it checks the photos already imported. Also note that you’ll have to fix the album list, because it doesn’t ever overwrite albums, so if you import jpg directory for instance, the next import will create it in jpg (1).
In the Photos/Preferences/iCloud preference, turn on and then off iCloud Photo Library. This seemed to kick it from Updating… to Uploading so many items. (Hat tip to Melvin Johnson over in Stackoverflow suggest signing in and out of iCloud but this is less extreme).
Once scary thing is that it then tries to upload the entire Photo Library, but looking at the logs, it appears to run a cloudphotosd sync session and the Uploading Items message in MacOS Photos seems to count down as it correlates existing photos with photos in iCloud. It is not a super fast process, at least for me, 20K photos to matched has needed 2.5 hours so far or about 8K photos per hour. Also photolibraryd will hog CPU like crazy and for a 50K library it took all night for a resync.

Fixing iCloud Photo Sharing : RDErrorServiceDatabaseOpenError Code=18 by toggling iCloud Photo Library

Even if you do the above, you will get trapped sometimes in the loop where the MacOS Photos just says updating and it hangs. At least for me, it is working when you see about 700Kbps uploads, but the hang state. If you go look at the console, I found the warning, denoted by a light yellow in the first column (you need to shut everything else down as the console is really messy) and search for Photos

Photos: Unable to get cached status information configuration client state 2
photoanalysisd Error getting CPL status: Error Domain=com.apple.reddwarf Code=18 “RDErrorServiceDatabaseOpenError” UserInfo={NSURL=file:_private_, NSLocalizedDescription=RDErrorServiceDatabaseOpenError, NSUnderlyingError=0x7f8f4ce9e820 {Error Domain=com.apple.lithium Code=18 “LiErrorServiceDatabaseRebuildInProgress” UserInfo={NSLocalizedDescription=LiErrorServiceDatabaseRebuildInProgress}}}
Photos Error getting status information: Error Domain=com.apple.reddwarf Code=18 “RDErrorServiceDatabaseOpenError” UserInfo={NSURL=file:_private_, NSLocalizedDescription=RDErrorServiceDatabaseOpenError, NSUnderlyingError=0x604000c50a10 {Error Domain=com.apple.lithium Code=18 “LiErrorServiceDatabaseRebuildInProgress” UserInfo={NSLocalizedDescription=LiErrorServiceDatabaseRebuildInProgress}}}. Will retry on status change.

So I did a Google search for these, but no one seems to have figured out what is wrong. In fact searching for reddwarf and lithium (which seem like two iCloud internal services) yield zero results?!@#
The current workaround seems to be:
Try the ALT-CMD-click on Photos to do a local database repair (this actually works about half the time for me) and you get the number of items uploading.
IThe one thing that did work for me is painful. Create a new Photo Library, turn on iCloud Photo Sharing, have Apple download the entire library again (this can be 1TB so beware if you have a bandwidth cap), then try the import again. The import is smart enough that it won’t upload photos that are already there.
Something I tried was Lester Yu says deleted some set of directories in your ~/Library/Containers/com.apple.cloudphotosd/Application Support/com.apple.cloudphotosd directory but this didn’t work for me.
Finally, Apple says find all the unexpected photos through a Smart Album and try to reimport them. Somehow I really doubt this will work, but I’ll give it a try.
Photo by Yeshi Kangrang on Unsplash

I’m Rich & Co.

Welcome to Tongfamily, our cozy corner of the internet dedicated to all things technology and interesting. Here, we invite you to join us on a journey of tips, tricks, and traps. Let’s get geeky!

Let’s connect