Sad face loop - open /dev/fb0: Permission denied

TL;DR: I have a Raspberry Pi 3 with an external WD hard drive.
Problem: I removed the external HD and reconnected it again, then the sad face loop started.
Solution: add osmc to the video group.

Since there was no post with “/dev/fb0 permission denied” here in the forum, I’m documenting this, so maybe it helps someone else in the future.
If anyone has experimented this before, or has an explanation of why the problem appeared in the first place, I’m curious to know why.
Thanks!

Cause: unknown

I still don’t know what caused the problem, and how it started.

I had the .kodi directory on the external hard drive, then symlinked to OSMC’s home dir with ln -s /mnt/hd/.kodi /home/osmc/.kodi.
Restarting the Pi without the hard drive connected would show the sad face loop.

Using ssh, I removed the symlink and moved the .kodi dir permanently from the HD to the home dir.
But the sad face persisted.

Steps to identify the problem

Connection via ssh worked, so I ran sudo systemctl status mediacenter and also sudo journalctl -f.
The message open /dev/fb0: Permission denied appeared in both.

(...)
Nov 08 18:00:43 styx mediacenter[4943]: open /dev/fb0: Permission denied
Nov 08 18:00:49 styx sudo[5011]: pam_unix(sudo:session): session closed for user osmc
Nov 08 18:00:49 styx mediacenter[4943]: /usr/bin/mediacenter: line 142: 5011 Segmentation fault sudo -u osmc LIRC_SOCKET_PATH=/var/run/lirc/lircd $KODI --standalone -fs
Nov 08 18:00:49 styx mediacenter[4943]: Kodi exited with return code 139 after 0 hours, 0 minutes and 6 seconds
(...)

My logs collected with sudo grab-logs -a: https://paste.osmc.tv/cemuwopabe

Solution

I discovered this “frame buffer” when I stumbled upon this this post: How to turn on/off Raspberry Pi display? (permission errors) - Setup, Configuration and Use / Scripts & Rules - openHAB Community.
Then I ran these commands and Kodi started without errors:

$ sudo systemctl stop mediacenter
$ ls -al /dev/fb0
crw-rw---- 1 root video 29, 0 Nov 8 17:29 /dev/fb0
$ sudo usermod -a -G video osmc
$ groups osmc
osmc : osmc video docker
$ sudo systemctl start mediacenter

What didn’t work

  • Renaming/removing the ~/.kodi directory and let Kodi recreate it
  • Removing packages I had installed recently: sudo apt-get purge manpages manpages-dev manpages-posix manpages-posix-dev
  • Upgrading the system: sudo apt-get update && sudo apt-get dist-upgrade

You need to use grab-logs command with capital A, -a just gives apt logs.

I’m afraid your installation seems to have become messed up.

You correctly concluded that osmc should be added to the video group but this:

indicates that something has become broken since the correct output should be:

osmc@osmc:~$ groups osmc
osmc : osmc adm disk lp dialout cdrom audio video

(I haven’t instaled docker.)

Just a guess but, if you weren’t running it from a powered USB hub, removing and reattaching the WD hard drive might have caused a voltage glitch, which in turn caused some kind of filesystem corruption.

I think you’re probably looking at a reinstall.

Thank you both for the help.

Whoops, my bad; here is the full log.

Thanks for this list.
I found out what happened.
A wrong Ansible task I wrote myself; it replaced the groups instead of appending to them.

I fixed the groups manually, and my Kodi installation is working fine (so far).
If more problems arise, I will format the SD-Card and reinstall OSMC again.
I just did it recently, a few weeks ago.

1 Like