Labels

3G (1) 8600GT (1) AI (4) amazon (1) API (1) apple (3) apple mail (1) atlassian (1) audio (1) bambo (1) Bamboo (1) bloat (1) boost (1) bugbear (1) C++ (5) calling conventions (1) cdecl (1) chromecast (1) CI (1) compiler (1) continuous integration (1) coursera (1) custom domain (1) debugging (1) deltanine (1) diagnosis (1) diy (5) DLL (1) dns (1) don't be evil (1) ec2 (1) education (1) electronics (1) express checkout (1) fail (6) fink (1) firewire (1) free hosting (1) GAE (1) google (1) Google App Engine (4) H170 (1) hackerx (1) hackintosh (1) Haskell (3) homebrew (2) i1394 (1) icloud (2) iOS 9 (1) ipad2 (2) jobhunting (2) lag (1) letsencrypt (2) libjpeg (1) linux (1) mac (2) mbcs (1) mechanic (1) memory (1) MFC (3) Microsoft (1) migration (1) ML (1) mobile (1) movi (1) MSBuild (1) music (1) naked domain (1) NLP (2) o2 sensor (1) obd (1) Optiplex960 (1) osx (1) outlook express (1) payments (1) paypal (1) photos (2) PIL (1) Project Euler (1) projectmix (1) python (2) raspberrypi (3) recruitment (1) renwal (1) skylake (1) soundcloud (1) ssl (2) stdcall (1) stripe (1) subaru (2) supermemo (1) supermemo anki java (1) sync (2) Telstra (1) tests (1) thunderbird (1) udacity (1) unicode (1) Uniform Cost Search (1) university (1) upgrade (2) vodafail (1) vodafone (1) VS2010 (1) vs2013 (1) VS6.0 (1) weather (1) win (1) Win32 (1) Z170 (1)

Tuesday 8 September 2015

My iCloud photos library finally synced sucessfully - no thanks to Apple!

In my previous post I mentioned how iCloud photos sync killed my MacBook. It was stuck on 90 Gb of my 180 Gb for 3 months, and when I fixed the issue it did the remaining 90 Gigs in about 10 days (on optus cable 1.5 Mbs upload speed).

Basically, my problem was that a couple of photos and videos in my library were corrupted, and iCloud photo sync is rubbish and keeps getting stuck on the corrupted files, instead of just skipping them (like rsync would). But you would never know this as it doesn't give any meaningful feedback on how the sync is progressing.

I first observed the issue using the system activity montor and seeing what files and handles the cloudd process had open. I could see it repeatedly looping over the same set of photos, over and over again. When I tried opening each of these photos in the finder, one of them caused preview to crash. I deleted this file and the sync got as little bit further before gettign stuck again.

I then tried repairing my Photos libaray by holding command + option while launching Photos.

http://osxdaily.com/2015/05/21/repair-photos-library-photos-app-mac-os-x/

This obviously did something as it managed to upload a few more gigs after that before getting stuck again.
Then my macbook died due to the stress of running icloud photo sync for 3 ½ months, so I took out the HDD and plugged it into my spare windows box and installed mac os 10.10 in VMWare to continue the sync, but after a while I would get a file IO eror and VM ware would crash.

I thought it might have been a problem with the physical disk, so I ran Disk Utility, and lo and behold it found a few errors and repaired them, but VM ware would still crash after a while when accessing my photos library. I then decided to copy my photos library to a virtual disk file and see if I had any more luck.

When using the finder to drag and drop the photos library to the virtual disk file, it would copy 90 Gigs (suspiciously close to the size of the library it has managed to upload before getting stuckl) and then crash.
I then began to suspect it was a problem with my photos library, so I went to the terminal and used cp -R -v to copy my photos library. After copying 90 gigs, it failed again, but this time I could see which file inside my library caused it to fail. I tried opening the photo in the finder, but it just caused the finder to hang, so I deleted the photo, which happened to be from the same event as the corrupt photo I deleted previously, and tried to copy it again, this time using rsync -v -a instead.

rsync is much more robust, and instead of failing it skips the files then tells you at the end which files failed- the iCloud developers could learn a thing or two from rsync! In this case, it was a photo and a video, both from the same event as the previous photos I had deleted. I deleted these files and ran rsync again, and it finished super quickly as it had managed to sync all of the files in the previous run.

I set . my newly copied photos library as my system photos library, and then tuned iCloud sync back on which continued to upload with no further dramas. It may have helped that the VM was running on a quad core Q6600 processor, and not a core 2 Duo laptop becuase the icloud photo sync uses your computers CPU to convert all your photos and videos to lower resolutions, which was the cause of the thermal stress which killed my trusty 2008 MacBook Pro.

TL;DR
If you are having trouble syncing your photos library to icloud, try repairing your photos library by holding down command + option when launching Photos. If that doesn't work, try copying your photos library using rysnc to see if there are any corrupt files which could be causing the problem and delete them. It also doesn't hurt to use a computer with a lot of grunt and Apple makes it work really hard converting all your photos and videos to lower resolutions.

Good luck!

No comments:

Post a Comment