I wanted to add my experience to this thread to help searchers. This has been bugging me for months and I was determined to sit down and fix it. The fact this Q refers to xcode is completely immaterial, I was seeing this issue across several apps with no commonality. I tried numerous searched fixes, including
- wiping all caches, cookies amd such like
- relogged into my account, signed out signed in etc
- rebooted, reset app store, manually deleted caches and such like
- screwed about with DNS, networking as mentioned in some quarters (red herring IMO)
- enabling the debug menu for app store (
defaults write com.apple.appstore ShowDebugMenu -bool true
) - this is what ultimately lead me to my solution
My symptoms were: various apps were uninstalled (moved to trash can etc) OR were updated over time. Then app store would show same apps and "Update" button. You click it, and the "an error occurred" message would appear, then the "Please use Purchase page..." Using purchases page buttons resulted in the same error. I tried dozens of combinations of solutions and googled it to death.
The solution in the end was quite odd. With the debug menu enabled, I switch on logging level 2 (at random), tried to reinstall a smallish app I bought a while back. Then skimmed through /var/log/install.log
I saw an extract like this (some IDs deliberately obfuscated due to paranoia)
Dec 30 19:00:36 macbookpro installd[23755]: PackageKit: ----- Begin install -----
Dec 30 19:00:36 macbookpro installd[23755]: PackageKit: request=PKInstallRequest
<1 packages, destination=/Volumes/Iomega_HDD>
Dec 30 19:00:36 macbookpro installd[23755]: PackageKit: packages=(
"PKLeopardPackage <file://localhost/var/folders/hb/6_bxxxxxxxxxxxxxxxxxxxx/C/com.apple.appstore/xxxxx3/xxxxxxxxxxxx33.pkg#com.neatberry.PhotoStyler.pkg>"
)
Dec 30 19:00:36 macbookpro installd[23755]: PackageKit: Install Failed: Error Domain=NSCocoaErrorDomain Code=640 "You can’t save the file “Iomega_HDD” because the volume “Iomega_HDD” is out of space." UserInfo=0xxxxxxxxxx {NSFilePath=/Volumes/Iomega_HDD} {
NSFilePath = "/Volumes/Iomega_HDD";
}
And there it was - a weird reference to an external drive during an install.
My "Iomega_HDD" is a FW drive always attached. I was using it for SuperDuper root disk mirroring. However my files had grown bigger than the drive, so it had been sat mounted and idle for probably 8-12 weeks (do not worry: timemachine was working to a NAS :-)
Being a mirror, and mounted, I can only assume that somehow app store monitored, or maintained some sort of linkage to the files on there, eg so previously deleted / purged apps on my root drive were present on the mirror.
Anyway, long story short, I unmounted the mirrored external drive, restarted App Store, used the debug menu item to "reset" and amazingly, all the apps magically corrected themselves to "Install" rather than "Update" and the Install/Update statuses also corrected themselves. And more importantly, all the buttons worked and no more error messages!!
I know how bizarre this sounds but the proof is in the logs. App Store was taking into consideration a mirrored (idle) drive that had legacy copies of the apps on.