How to diagnose Finder losing icons for folders?

After a reboot several strange issues come up from nothing. Suddenly all system directory lost their icons: Desktop, Home, Downloads, Pictures, Movies... have the normal folder icon. Even in Finder's sidebar. In console.app I noticed this when Finder opens:

09/06/14 16:17:44,722 Finder[250]: Could not find image named '357D167A-6053-47A6-BD22-B028736F98C1'.
09/06/14 16:22:14,810 Finder[250]: Could not find image named 'D54AFEF0-1EF4-43D6-8F3F-84A181AC04B2'.
09/06/14 16:22:14,810 Finder[250]: Could not find image named '357D167A-6053-47A6-BD22-B028736F98C1'.

Every time I open Alfred 2 preferences these are reset to default. Themes, workflows, everything is reset.

At last Safari won't connect to service hosted on localhost through https

Safari can't open the page because Safari can't establish a secure connection to the server. I tried:
  • rebooting
  • repairing permissions
  • resetting safari
  • reinstalling Alfred
  • deleting com.apple.finder.plist
  • removing every login item and launch agent

The problem persists and I don't know what causes this or how to fix it. Is there a way to restore the custom folders Finder shows for user default folders?

Here there is the log of the boot taken from console.app.


Solution 1:

try this in Terminal

mkdir ${TMPDIR}/com.apple.IconServices

This recreates the com.apple.IconServices directory, which apparently gets itself deleted from time to time.