Failed to create OpenGL context

glxinfo also shows Error of failed request

For me the following fixed the issue:

I use the Nouveau video driver with my nVidia card, so I removed all nVidia drivers first:
sudo apt purge nvidia*

Next, reinstall the xorg drivers and mesa:
sudo apt install --reinstall xserver-xorg-video-nouveau libgl1-mesa-glx

Reboot