Opera stops working after upgrade due to gnome connection issue

Hi snap team,

I am from Opera and we noticed that Opera stops working today after updating to use core18 to snap Opera.
$ opera
You need to connect this snap to the gnome platform snap.

You can do this with those commands:
snap install gnome-3-28-1804
snap connect opera:gnome-3-28-1804 gnome-3-28-1804

It seems related to a bug in core18 as mentioned in this post: Snaps don't recognise GNOME 3.24 platform snap connection

On my machine, I can solve the issue by running the following commands:
sudo snap refresh core18 --candidate
sudo snap revert opera
sudo snap refresh opera

Should we request an auto-connection for gnome-3-28-1804?
We already reverted Opera on the store. The snap.yaml with this issue is attached below.

$ cat /snap/opera/current/meta/snap.yaml 
name: opera
version: 65.0.3467.38
summary: Fast and secure web browser
description: |
  Opera is a fast, secure, and user-friendly web browser.
  It includes a built-in ad blocker, Video pop-out, and free VPN.
base: core18
architectures:
- amd64
confinement: strict
grade: stable
plugs:
  browser-sandbox:
    allow-sandbox: true
    interface: browser-support
  chromium-ffmpeg-93464:
    default-provider: chromium-ffmpeg
    interface: content
    target: $SNAP
  gnome-3-28-1804:
    default-provider: gnome-3-28-1804
    interface: content
    target: $SNAP/gnome-platform
  gtk-3-themes:
    default-provider: gtk-common-themes
    interface: content
    target: $SNAP/data-dir/themes
  icon-themes:
    default-provider: gtk-common-themes
    interface: content
    target: $SNAP/data-dir/icons
  sound-themes:
    default-provider: gtk-common-themes
    interface: content
    target: $SNAP/data-dir/sounds
apps:
  opera:
    command: snap/command-chain/snapcraft-runner $SNAP/command-opera.wrapper
    environment:
      DISABLE_WAYLAND: 1
    plugs:
    - audio-playback
    - avahi-observe
    - browser-sandbox
    - camera
    - cups-control
    - desktop
    - desktop-legacy
    - gsettings
    - home
    - mount-observe
    - network
    - network-control
    - network-manager
    - opengl
    - password-manager-service
    - process-control
    - pulseaudio
    - screen-inhibit-control
    - unity7
    - upower-observe
    - wayland
    - x11
1 Like

I switched to “extension” for GTK3 support, hoping that may solve our issue. And it did, at least partially. The new snap.yaml is:

 name: opera-developer
 version: 66.0.3512.0
 summary: Fast and secure web browser
 description: |
   Opera is a fast, secure, and user-friendly web browser.
   It includes a built-in ad blocker, Video pop-out, and free VPN.
 base: core18
 architectures:
 - amd64
 confinement: strict
 environment:
   SNAP_DESKTOP_RUNTIME: $SNAP/gnome-platform
 grade: stable
 layout:
   /usr/lib/x86_64-linux-gnu/webkit2gtk-4.0:
     bind: $SNAP/gnome-platform/usr/lib/x86_64-linux-gnu/webkit2gtk-4.0
   /usr/share/xml/iso-codes:
     bind: $SNAP/gnome-platform/usr/share/xml/iso-codes
 plugs:
   browser-sandbox:
     allow-sandbox: true
     interface: browser-support
   chromium-ffmpeg-93464:
     default-provider: chromium-ffmpeg
     interface: content
     target: $SNAP
   gnome-3-28-1804:
     default-provider: gnome-3-28-1804:gnome-3-28-1804
     interface: content
     target: $SNAP/gnome-platform
   gtk-3-themes:
     default-provider: gtk-common-themes:gtk-3-themes
     interface: content
     target: $SNAP/data-dir/themes
   icon-themes:
     default-provider: gtk-common-themes:icon-themes
     interface: content
     target: $SNAP/data-dir/icons
   sound-themes:
     default-provider: gtk-common-themes:sound-themes
     interface: content
     target: $SNAP/data-dir/sounds
 slots:
   dbus-daemon:
     bus: session
     interface: dbus
     name: com.opera.opera-developer
 apps:
   opera-developer:
     command: bin/opera-developer.launcher
     command-chain:
     - snap/command-chain/snapcraft-runner
     - snap/command-chain/desktop-launch
     environment:
       DISABLE_WAYLAND: 1
     plugs:
     - audio-playback
     - avahi-observe
     - browser-sandbox
     - camera
     - cups-control
     - desktop
     - desktop-legacy
     - gsettings
     - home
     - mount-observe
     - network
     - network-control
     - network-manager
     - opengl
     - password-manager-service
     - process-control
     - pulseaudio
     - screen-inhibit-control
     - unity7
     - upower-observe
     - wayland
     - x11
     slots:
     - dbus-daemon
 assumes:
 - command-chain

With this change, we no longer see the complain about connecting gnome-3-28-1804. However, some machines have an error about GdkPixbuf instead:

(opera-developer:8796): GLib-GIO-CRITICAL **: 08:56:32.295: g_settings_schema_source_lookup: assertion 'source != NULL' failed
CrashID=63211784-b19b-4ccc-805b-9f0e02191119
Fontconfig error: Cannot load default config file
(opera-developer:8849): GdkPixbuf-WARNING **: 08:56:32.529: Cannot open pixbuf loader module file '/home/radek/snap/opera-developer/common/.cache/gdk-pixbuf-loaders.cache': No such file or directory
This likely means that your installation is broken.
Try running the command
 gdk-pixbuf-query-loaders > /home/radek/snap/opera-developer/common/.cache/gdk-pixbuf-loaders.cache
to make things work again for the time being.
Gtk-Message: 08:56:32.554: Failed to load module "canberra-gtk-module"
Gtk-Message: 08:56:32.555: Failed to load module "canberra-gtk-module"
(opera-developer:8849): GLib-GIO-CRITICAL **: 08:56:32.574: g_settings_schema_source_lookup: assertion 'source != NULL' failed
libGL error: MESA-LOADER: failed to open r600 (search paths /snap/opera-developer/76/gnome-platform/usr/lib/x86_64-linux-gnu/dri)
libGL error: failed to load driver: r600
libGL error: MESA-LOADER: failed to open swrast (search paths /snap/opera-developer/76/gnome-platform/usr/lib/x86_64-linux-gnu/dri)
libGL error: failed to load driver: swrast
[8884:8884:1119/085632.649742:ERROR:gl_context_glx.cc(187)] Failed to create GL context with glXCreateNewContext.
[8884:8884:1119/085632.649804:ERROR:gpu_info_collector.cc(74)] gl::init::CreateGLContext failed
[8884:8884:1119/085632.649812:ERROR:gpu_info_collector.cc(206)] Could not create context for info collection.
[8884:8884:1119/085632.649826:ERROR:gpu_init.cc(66)] gpu::CollectGraphicsInfo failed.
[8884:8884:1119/085632.651411:ERROR:viz_main_impl.cc(180)] Exiting GPU process due to errors during initialization
(opera-developer:8849): GLib-GIO-ERROR **: 08:56:32.652: No GSettings schemas are installed on the system
CrashID=07642cad-914c-4e8d-83ce-091892191119
[8834:8837:1119/085632.866063:ERROR:broker_posix.cc(40)] Recvmsg error: Connection reset by peer (104)
CrashID=6b238ad7-3afc-43fd-96ff-ab2512191119
[8887:8890:1119/085633.340861:ERROR:broker_posix.cc(40)] Recvmsg error: Connection reset by peer (104)

Does anyone know about this? Any idea will be appreciated.

@xshi on the machines complaining about the missing gdk-pixbuf-loaders.cache, please rm -rf ~/snap/opera (or ~/snap/opera-developer, whichever is broken), and try relaunch the snap. It sounds like the cache may have gotten corrupted in one of your install cycles during testing.

@marcustomlinson Thanks for your reply. I removed the opera folder (~/snap/opera-developer in my case) but it doesn’t help. I noticed that the folder ~/snap/opera-developer/common is empty on the machines that Opera does work, but it is not on a failing machine (I can only check one currently). I am not sure if this is relevant.

You mean you remove ~/snap/opera-developer then run the snap and on some machines ~/snap/opera-developer/common is repopulated, and on some it isn’t?

Could it be that you think nothing’s there but really there is a hidden .cache folder present?

You are right. ~/snap/opera-developer/common on all machines has content. Sorry I had that wrong conclusion (not all ll alias includes -a). But removing ~/snap/opera-developer folder or reinstall the snap package doesn’t resolve the issue.

  1. Does ~/snap/opera-developer/common/.cache/gdk-pixbuf-loaders.cache actually exist?
  2. Could you run journalctl -f in a separate terminal, launch the snap and let me know if you see any apparmor=“DENIED” messages?
  1. No ~/snap/opera-developer/common/.cache/gdk-pixbuf-loaders.cache for problematic machines

  2. Yes, I found couple of these messages:

     lis 25 16:25:23 opera-VirtualBox dbus-daemon[1721]: apparmor="DENIED" operation="dbus_method_call" bus="session" path="/org/freedesktop/secrets" interface="org.freedesktop.DBus.Properties" member="GetAll" mask="send" name="org.freedesktop.secrets" pid=30023 label="snap.opera-developer.opera-developer" peer_pid=1695 peer_label="unconfined"
     lis 25 16:25:23 opera-VirtualBox audit[30051]: AVC apparmor="DENIED" operation="open" profile="snap.opera-developer.opera-developer" name="/proc/30036/environ" pid=30051 comm="opera_crashrepo" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000
     lis 25 16:25:23 opera-VirtualBox kernel: kauditd_printk_skb: 1 callbacks suppressed
     lis 25 16:25:23 opera-VirtualBox kernel: audit: type=1400 audit(1574695523.352:316): apparmor="DENIED" operation="open" profile="snap.opera-developer.opera-developer" name="/proc/30036/environ" pid=30051 comm="opera_crashrepo" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000
     lis 25 16:25:23 opera-VirtualBox audit[30068]: AVC apparmor="DENIED" operation="open" profile="snap.opera-developer.opera-developer" name="/proc/30036/environ" pid=30068 comm="ThreadPoolForeg" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000
     lis 25 16:25:23 opera-VirtualBox kernel: audit: type=1400 audit(1574695523.440:317): apparmor="DENIED" operation="open" profile="snap.opera-developer.opera-developer" name="/proc/30036/environ" pid=30068 comm="ThreadPoolForeg" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000
     lis 25 16:25:23 opera-VirtualBox kernel: traps: ThreadPoolForeg[30036] trap int3 ip:7f1c6fbdfea1 sp:7f1c59d86d20 error:0 in libglib-2.0.so.0.5600.4[7f1c6fb8e000+114000]
     lis 25 16:25:23 opera-VirtualBox audit[30098]: AVC apparmor="DENIED" operation="open" profile="snap.opera-developer.opera-developer" name="/proc/30082/environ" pid=30098 comm="opera_crashrepo" requested_mask="r" denied_mask="r" fsuid=1000 ouid=100

Ok, none of those denials look related. It is very odd that some machines don’t write a gdk-pixbuf-loaders.cache on launch. Hmm…

Could I have a link to the source code where your snapcraft.yaml is?

Looking through logs, I notice these error in the first run after I reinstall the snap package:

cp: cannot stat '/snap/opera-developer/78/gnome-platform/usr/share/mime': No such file or directory
Directory '/home/opera/snap/opera-developer/78/.local/share/mime/packages' does not exist!
/snap/opera-developer/78/snap/command-chain/desktop-launch: line 11: /snap/opera-developer/78/gnome-platform/usr/lib/x86_64-linux-gnu/libgtk-3-0/gtk-query-immodules-3.0: No such file or directory
ERROR: update-mime-database /home/opera/snap/opera-developer/78/.local/share/mime exited abnormally with status 1
ERROR: /snap/opera-developer/78/gnome-platform/usr/lib/x86_64-linux-gnu/libgtk-3-0/gtk-query-immodules-3.0 exited abnormally with status 127
Fontconfig error: Cannot load default config file

And here is a template for generating the snapcraft.yaml for different stream of opera:

name: {{ filesystem_name }}
version: {{ major }}.{{ minor }}.{{ nightly }}.{{ patch }}
summary: Fast and secure web browser
description: |
  Opera is a fast, secure, and user-friendly web browser.
  It includes a built-in ad blocker, Video pop-out, and free VPN.
architectures:
- amd64
base: core18
confinement: strict
grade: stable
plugs:
  browser-sandbox:
    allow-sandbox: true
    interface: browser-support
  # We need to specify the chromium-ffmpeg interface slot for Opera. When a snap
  # version Opera cannot play H.264 videos while the debian version can,
  # consider update to the latest interface slot first. A slot version may also
  # be removed from chromium-ffmpeg. In this case, we can do
  # `snap revert chromium-ffmpeg` as a workaround.
  #
  # For a new interface slot, we need to connect it manually for testing:
  # snap connect opera-developer:<slot> chromium-ffmpeg:<slot>
  # And before we publish it, we need to ask Ubuntu team to create an
  # auto-connect exception for Opera.
  chromium-ffmpeg-93464:
    interface: content
    target: $SNAP
    default-provider: chromium-ffmpeg
apps:
  {{ filesystem_name }}:
    command: bin/{{ filesystem_name }}.launcher
    desktop: usr/share/applications/{{ filesystem_name }}.desktop
    environment:
      DISABLE_WAYLAND: 1
    extensions: [gnome-3-28]
    slots:
    - dbus-daemon
    plugs:
    - audio-playback
    - avahi-observe
    - browser-sandbox
    - camera
    - cups-control
    - desktop
    - desktop-legacy
    - gsettings
    - home
    - mount-observe
    - network
    - network-control
    - network-manager
    - opengl
    - password-manager-service
    - process-control
    - pulseaudio
    - screen-inhibit-control
    - unity7
    - upower-observe
    - wayland
    - x11
parts:
  browser:
    plugin: dump
    source: data
    stage-packages:
    - libasound2
    - libatk-bridge2.0-0
    - libatk1.0-0
    - libatspi2.0-0
    - libcairo-gobject2
    - libcairo2
    - libcups2
    - libcurl3
    - libdatrie1
    - libepoxy0
    - libfontconfig1
    - libfreetype6
    - libgconf-2-4
    - libgl1-mesa-glx
    - libglu1-mesa
    - libgnome-keyring0
    - libgpm2
    - libgraphite2-3
    - libgtk-3-0
    - libharfbuzz0b
    - libnotify4
    - libnspr4
    - libnss3
    - libpango-1.0-0
    - libpangocairo-1.0-0
    - libpangoft2-1.0-0
    - libpixman-1-0
    - libpulse0
    - libsecret-1-0
    - libthai0
    - libwayland-client0
    - libwayland-cursor0
    - libwayland-egl1
    - libxcb-render0
    - libxcb-shm0
    - libxcomposite1
    - libxcursor1
    - libxi6
    - libxinerama1
    - libxkbcommon0
    - libxrandr2
    - libxrender1
    - libxss1
    - libxtst6
    override-build: |
      snapcraftctl build
      chmod 4755 $SNAPCRAFT_PART_INSTALL/{{ target_dir }}/{{ filesystem_name }}/opera_sandbox
slots:
  dbus-daemon:
    interface: dbus
    bus: session
    name: com.opera.{{ filesystem_name }}

Could I ask you to try one more time:

snap remove --purge opera-developer
rm -rf ~/snap/opera-developer
snap install opera-developer
snap run opera-developer

And does /snap/gnome-3-28-1804/current/usr/share/mime exist? If so it seems like some kind of permissions issue going on.

Of course :slight_smile:

I first ran these four commands and installed build 75, which is using the legacy desktop support. I got the issue about connection to gnome-3-28-1804 (my initial issue).

Then I ran the four commands again and this time I install the edge one (build 78). Unfortunately, I still get the issue about gdk-pixbuf-loaders.cache.

/snap/gnome-3-28-1804/current/usr/share/mime does exits.

The machine has kernel 5.0.0-25-generic, which is older than the working machine. I will try upgrading it tomorrow.

opera@opera-VirtualBox:~$ snap version
snap 2.42.1
snapd 2.42.1
series 16
ubuntu 18.04
kernel 5.0.0-25-generic

opera@opera-VirtualBox:~$ snap list
Name Version Rev Tracking Publisher Notes
chromium-ffmpeg 0.1 15 stable canonicalâś“ -
core 16-2.42.1 8039 stable canonicalâś“ core
core18 20191030 1265 stable canonicalâś“ base
gnome-3-26-1604 3.26.0.20191114 98 stable/… canonical✓ -
gnome-3-28-1804 3.28.0-16-g27c9498.27c9498 110 stable canonicalâś“ -
gnome-calculator 3.34.1+git1.d34dc842 544 stable/… canonical✓ -
gnome-characters v3.32.1+git2.3367201 367 stable/… canonical✓ -
gnome-logs 3.34.0 81 stable/… canonical✓ -
gnome-system-monitor 3.32.1-3-g0ea89b4922 111 stable/… canonical✓ -
gtk-common-themes 0.1-25-gcc83164 1353 stable/… canonical✓ -
opera 60.0.3255.56 x1 stable - -
opera-beta 65.0.3467.32 51 edge opera-softwareâś“ -
opera-developer 66.0.3512.0 78 edge opera-softwareâś“ -

Thank you very much today. I have to go now. I will come back to you tomorrow. Please free feel to leave messages.

Hi Marcus,

Sorry I can’t follow up the issue for a long time. I am wondering what do you meant by “permissions issue”? It’s about the user permission to some path or it’s related to snap’s confinement?

We had a look through the apparmor denials and none looked related. The fishy error is:

cp: cannot stat '/snap/opera-developer/78/gnome-platform/usr/share/mime': No such file or directory

Because the directory does exist, my suspicion was lack of user permissions to it.

The real path (bind mounted within your snap) being: /snap/gnome-3-28-1804/current/usr/share/mime

I installed a new 18.04 VM and I can reproduce this issue there.
The folder /snap/gnome-3-28-1804/current/usr/share/mime on VM contains much less data comparing to my working machine.

However, after updating the system through Software Updater and restart, Opera is finally running if I update the system through Software Updater, and manually connect gnome-3-28-1804 interface:

opera@opera-VirtualBox:~$ snap connections opera-developer
Interface                       Plug                                      Slot                                   Notes
audio-playback                  opera-developer:audio-playback            :audio-playback                        -
avahi-observe                   opera-developer:avahi-observe             -                                      -
browser-support                 opera-developer:browser-sandbox           :browser-support                       -
camera                          opera-developer:camera                    -                                      -
content[chromium-ffmpeg-93464]  opera-developer:chromium-ffmpeg-93464     chromium-ffmpeg:chromium-ffmpeg-93464  -
content[gnome-3-28-1804]        opera-developer:gnome-3-28-1804           gnome-3-28-1804:gnome-3-28-1804        manual
content[gtk-3-themes]           opera-developer:gtk-3-themes              gtk-common-themes:gtk-3-themes         manual
content[icon-themes]            opera-developer:icon-themes               gtk-common-themes:icon-themes          manual
content[sound-themes]           opera-developer:sound-themes              gtk-common-themes:sound-themes         manual
cups-control                    opera-developer:cups-control              -                                      -
dbus                            -                                         opera-developer:dbus-daemon            -
desktop                         opera-developer:desktop                   :desktop                               -
desktop-legacy                  opera-developer:desktop-legacy            :desktop-legacy                        -
gsettings                       opera-developer:gsettings                 :gsettings                             -
home                            opera-developer:home                      :home                                  -
mount-observe                   opera-developer:mount-observe             -                                      -
network                         opera-developer:network                   :network                               -
network-control                 opera-developer:network-control           -                                      -
network-manager                 opera-developer:network-manager           -                                      -
opengl                          opera-developer:opengl                    :opengl                                -
password-manager-service        opera-developer:password-manager-service  -                                      -
process-control                 opera-developer:process-control           -                                      -
pulseaudio                      opera-developer:pulseaudio                :pulseaudio                            -
screen-inhibit-control          opera-developer:screen-inhibit-control    :screen-inhibit-control                -
unity7                          opera-developer:unity7                    :unity7                                -
upower-observe                  opera-developer:upower-observe            :upower-observe                        -
wayland                         opera-developer:wayland                   :wayland                               -
x11                             opera-developer:x11                       :x11                                   -

I opened a new post to request auto-connect for gnome-3-28-1804.
Do you have any thoughts about the system update part?