Bug: mathpix-snipping-tool: Qt: Session management error

Environment:

  • Ubuntu 20.04.1

Error:

$ mathpix-snipping-tool 
Qt: Session management error: None of the authentication protocols specified are supported
QNetworkManagerInterface::QNetworkManagerInterface(QObject*) propsReply "An AppArmor policy prevents this sender from sending this message to this recipient; type=\"method_call\", sender=\":1.1637\" (uid=1000 pid=394977 comm=\"mathpix-snipping-tool \" label=\"snap.mathpix-snipping-tool.mathpix-snipping-tool (enforce)\") interface=\"org.freedesktop.DBus.Properties\" member=\"GetAll\" error name=\"(unset)\" requested_reply=\"0\" destination=\"org.freedesktop.NetworkManager\" (uid=0 pid=234927 comm=\"/usr/sbin/NetworkManager --no-daemon \" label=\"unconfined\")"
QNetworkManagerInterface::QNetworkManagerInterface(QObject*) nmReply "An AppArmor policy prevents this sender from sending this message to this recipient; type=\"method_call\", sender=\":1.1637\" (uid=1000 pid=394977 comm=\"mathpix-snipping-tool \" label=\"snap.mathpix-snipping-tool.mathpix-snipping-tool (enforce)\") interface=\"org.freedesktop.NetworkManager\" member=\"GetDevices\" error name=\"(unset)\" requested_reply=\"0\" destination=\"org.freedesktop.NetworkManager\" (uid=0 pid=234927 comm=\"/usr/sbin/NetworkManager --no-daemon \" label=\"unconfined\")"
"Object path cannot be empty"
libGL error: MESA-LOADER: failed to retrieve device information
libGL error: Version 4 or later of flush extension not found
libGL error: failed to load driver: i915
libGL error: MESA-LOADER: failed to retrieve device information
[1]    394977 killed     mathpix-snipping-tool

snap list

Name                             Version                     Rev    Tracking         Publisher   Notes
canonical-livepatch              9.5.5                       95     latest/stable    canonical✓  -
core                             16-2.47.1                   10185  latest/stable    canonical✓  core
core18                           20200929                    1932   latest/stable    canonical✓  base
dmd                              2.090.1                     102    latest/stable    dlang       classic
gnome-3-26-1604                  3.26.0.20200529             100    latest/stable/…  canonical✓  -
gnome-3-28-1804                  3.28.0-19-g98f9e67.98f9e67  145    latest/stable    canonical✓  -
gnome-3-34-1804                  0+git.3556cb3               60     latest/stable    canonical✓  -
gtk-common-themes                0.1-36-gc75f853             1506   latest/stable/…  canonical✓  -
gtk2-common-themes               0.1                         13     latest/stable    canonical✓  -
kde-frameworks-5-core18          5.61.0                      32     latest/stable    kde✓        -
kde-frameworks-5-qt-5-14-core18  5.68.0                      4      latest/stable    kde✓        -
mathpix-snipping-tool            02.07.0002                  195    latest/stable    mathpix     -

Hi, welcome to the forum :slight_smile:

The Qt: Session management error is a red-herring in this case; it can be safely ignored as it occurs on almost every, if not all, Qt-based Snap Packages. I think your issue stems from the libGL error being unable to find the drivers for your GPU. Would it be possible for you to share your snapcraft.yaml so that we can try to diagnose why the driver is unavailable?

$ cat /snap/mathpix-snipping-tool/195/meta/snap.yaml 
name: mathpix-snipping-tool
version: 02.07.0002
summary: Mathpix Snipping Tool
description: 'Mathpix Snipping Tool

'
architectures:
- amd64
confinement: strict
grade: stable
apps:
mathpix-snipping-tool:
    command: command-mathpix-snipping-tool.wrapper
    environment:
    DISABLE_WAYLAND: 1
    plugs:
    - x11
    - network
    - desktop
    - home
    - unity7
    - wayland
    - gsettings
    - network-bind
    - network-manager

Well, that’s maybe a coincidence but I’ve just solved a similar Qt-* error in VLC (same Qt: Session management error: None of the authentication protocols specified are supported).

After searching a bit, I succeeded with these commands:

    sudo rm /var/cache/fontconfig/*
    rm ~/.cache/fontconfig/*
    fc-cache -r
    sudo fc-cache -r

These commands were present in my bash history and I can remember such a bug using snap (snap store ?).
I don’t know if it will solve your problem. Anyway this fonts-related trick has absolutely imho to banished from non-geek snap user experience. What I did these last days: refresh quadrapassel, remove brave, install code. Nothing more, so I did nothing weird.