I have a strange problem with a raspberry pi 3 that has been working for about 6 months without problem. I had an issue with it today connecting to wifi so I tried rebooting it from the gui. After reboot I got the login screen and proceeded to log in as pi. It took the login, the screen went black for a second or so and the login page reappeared. I entered an incorrect password and got the incorrect password message implying that the first failure was not due to a password error.
Reading the log is part of the lightdm.log file, which handles the login. At 6.91s it seems to say that the login was successful. It then, at 6.92s, logs to .xsession-errors, so at this point it seems to have encountered an error, I think. It goes on to activate vt7 and a session and then exits with a return value of 11. I have not been able to find return codes for lightdm, so I don't know what it means?
Below that I ran the command to show the .xsession-errors log which just seems to say that LXDE is started with the LXDE-pi profile. That profile directory (.config/lxsession/LXDE-pi/) has three files: autostart.sh autostart desktop.conf
The desktop.conf file has details of the configutation settings but interestingly was written when the pi was booted. The autostart and autostart.sh files are dated in year 2015 and since the pi was previously working, I don't suspect them to be bad (they don't appear to be corrupted in any way).
If I try to login with another user of this device, the behavior is identical to what I have described.
I switched the desktop environment to openbox on the login page and then logged in. I got a gray screen with a mouse pointer on it... But at least it didn't crash! Right clicking allowed me to bring up a web browser and I was able to reach sites! The problem appears to be something with the LXDE desktop or it's configuration?
I don't know what to do next to restore the pi short of rebuilding the whole thing, which I'd like to avoid if at all possible. Any advice on how to fix this issue would be greatly appreciated.