Once in a while (3 times over the past four weeks), I don't exist. The message in the title of this question is my response when I try to run ssh while not existing. Also, when I don't exist, if I run id, it shows my uid and not my username as it otherwise does. And I can't use sudo:
; sudo date
sudo: unknown uid: 13799
Every time, the problem disappears spontaneously within the hour, and I exist once more. Fortunately, I always have a terminal window with a root shell in it around, so I can still poke around in the system. And I see nothing amiss, at least nothing I can make sense of, except perhaps these lines in /var/log/opendirectoryd.log:
2012-02-27 07:31:39.911 CET - 70535.351417.351419.351421 - Client: netstat, UID: 0, EUID: 0, GID: 0, EGID: 0
2012-02-27 07:31:39.911 CET - 70535.351417.351419.351421, Node: /Local/Default, Module: PlistFile - recordtype 'networks' attribute 'address' is not indexed: performance hit
2012-02-27 07:31:40.904 CET - 70539.351444.351448 - Client: launchd, UID: 13799, EUID: 13799, GID: 20, EGID: 20
2012-02-27 07:31:40.904 CET - 70539.351444.351448, Module: SystemCache - unable to find node 71E63E19-F41E-4AF3-89A0-F50FE5185E5B
2012-02-27 07:31:40.905 CET - 70539.351444.351448 - Client: launchd, UID: 13799, EUID: 13799, GID: 20, EGID: 20
2012-02-27 07:31:40.905 CET - 70539.351444.351448, Module: SystemCache - ODQueryCreateWithNode failed with error 'Node ID is invalid' (90001)
Those are from this morning, as I woke up the laptop (I have used odutil to raise the logging level a bit). I've been poking around with dscl, and everything seems normal – I can see all data on my own user – but I am not very familiar with directory services, so I may well have missed something. (How do I lookup myself by uid using dscl?)
So my question is twofold: Does this problem ring a bell? My google-fu is not up to finding anything relevant. And can you suggest things to try to get a further handle on the problem, tests to run, things to look for?
While I have been typing in this question, today's event ended, and I exist once more. So it may well be a week or more before my next chance to debug this. I'm on OS X 10.7.3, btw, on a MacBook Pro.
opendirectorydlocally, but that is the default setup I believe, inherited from a sequence of machines using Migration Assistant, all the way back to Tiger, if memory serves (which it might not – I may have started from scratch during a migration years ago). – Harald Hanche-Olsen Feb 27 '12 at 08:12