Trouble with ppa:ubuntu-desktop/gnome-3-26

The storage-explorer snap has recently been experiencing errors when building the snap. To my knowledge, nothing has changed in our snapcraft.yaml file or build process.

Sorry, an error occurred in Snapcraft:
'NoneType' object has no attribute 'priority'
...

We thought perhaps we should try updating our base to core18, but that generates another error:

Pulling desktop-gnome-platform 
+ snapcraftctl pull
Cloning into '/home/vsts/work/1/s/parts/desktop-gnome-platform/src'...
+ add-apt-repository -y ppa:ubuntu-desktop/gnome-3-26
Hit:1 http://azure.archive.ubuntu.com/ubuntu bionic InRelease
Hit:2 http://azure.archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:3 http://azure.archive.ubuntu.com/ubuntu bionic-backports InRelease
Hit:4 https://download.mono-project.com/repo/ubuntu stable-bionic InRelease
Hit:5 http://security.ubuntu.com/ubuntu bionic-security InRelease
Hit:6 https://packages.microsoft.com/ubuntu/18.04/prod bionic InRelease
Hit:7 http://ppa.launchpad.net/ondrej/php/ubuntu bionic InRelease
Ign:8 http://ppa.launchpad.net/ubuntu-desktop/gnome-3-26/ubuntu bionic InRelease
Hit:9 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu bionic InRelease
Err:10 http://ppa.launchpad.net/ubuntu-desktop/gnome-3-26/ubuntu bionic Release
  404  Not Found [IP: 91.189.95.85 80]
Reading package lists...
E: The repository 'http://ppa.launchpad.net/ubuntu-desktop/gnome-3-26/ubuntu bionic Release' does not have a Release file.
Failed to run 'override-pull': Exit code was 100.
##[error]Bash exited with code '2'.

I get this same error on our build machines (running Ubuntu 16.04 or 18.04) as well as my local Linux machine (running Ubuntu 20.04), so I doubt it’s a specific machine or environment error.

At this point, we’re at a loss as what could be the problem. We’re hoping we can get some help.

For reference, here’s what our snapcraft.yaml file looks like:

name: storage-explorer
version: "1.20.0"
summary: Optimize your Azure storage management
description: |
  Upload, download, and manage Azure blobs, files, queues, and tables, as well
  as Azure Cosmos DB and Azure Data Lake Storage entities. Easily access virtual
  machine disks, and work with either Azure Resource Manager or classic storage
  accounts. Manage and configure cross-origin resource sharing rules.
# Core base maps to Ubuntu 16.04 LTS. If you want to change this, you should probably
# change our linux CI/CD build to run on the same version of Linux. For base -> ubuntu version
# mappings, see here: https://snapcraft.io/docs/base-snaps
base: core
grade: stable
confinement: strict

architectures:
  - build-on: amd64

plugs:
  gnome-3-26-1604:
    interface: content
    target: $SNAP/gnome-platform
    default-provider: gnome-3-26-1604
  gtk-3-themes:
    interface: content
    target: $SNAP/data-dir/themes
    default-provider: gtk-common-themes
  icon-themes:
    interface: content
    target: $SNAP/data-dir/icons
    default-provider: gtk-common-themes
  sound-themes:
    interface: content
    target: $SNAP/data-dir/sounds
    default-provider: gtk-common-themes

parts:
  desktop-gnome-platform:
    source: https://github.com/ubuntu/snapcraft-desktop-helpers.git
    source-subdir: gtk
    plugin: make
    make-parameters: ["FLAVOR=gtk3"]
    build-packages:
      - gcc
      - software-properties-common
    override-pull: |
      snapcraftctl pull
      add-apt-repository -y ppa:ubuntu-desktop/gnome-3-26
      apt-get -y update
    override-build: |
      snapcraftctl build
      mkdir -pv $SNAPCRAFT_PART_INSTALL/gnome-platform

  # Add the dotnet runtime apt repository to the build environment.
  dotnet-repo:
    plugin: nil
    build-packages:
      - apt-transport-https
      - wget
    override-build: |
      wget -q https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb
      dpkg -i packages-microsoft-prod.deb
      apt-get -y update

  # Stage the dotnet runtime, and it's requirements, inside the snap.
  #  - https://docs.microsoft.com/en-gb/dotnet/core/linux-prerequisites?tabs=netcore2x
  dotnet-core:
    after:
      - dotnet-repo
    plugin: nil
    stage-packages:
      - dotnet-runtime-2.1
      - libcurl3
      - libicu55
      - libkrb5-3
      - liblttng-ust0
      - libssl1.0.0
      - zlib1g

  storage-explorer:
    after:
      - desktop-gnome-platform
      - dotnet-core
    plugin: dump
    source: ./src/Standalone/bin/StorageExplorer-linux-x64.tar.gz
    stage-packages:
      - iproute2
      - libasound2
      - libatm1
      - libgconf2-4
      - libgnome-keyring0
      - libnspr4
      - libnss3
      - libpulse0
      - libsecret-1-0
      - libx11-xcb1
      - libxss1
      - libxtables11
      - libxtst6
      - xdg-utils
    prime:
      - -usr/bin/xdg-open

apps:
  storage-explorer:
    command: desktop-launch $SNAP/StorageExplorerSnap
    environment:
      # Correct the TMPDIR path for Chromium Framework/Electron to
      # ensure libappindicator has readable resources
      TMPDIR: $XDG_RUNTIME_DIR
      # Fallback to XWayland if running in a Wayland session.
      DISABLE_WAYLAND: 1
      # Make sure .NET Core knows the install location in the Snap.
      DOTNET_ROOT: $SNAP/usr/share/dotnet

    plugs:
      - browser-support
      - desktop
      - desktop-legacy
      - gsettings
      - home
      - mount-observe
      - network
      - opengl
      - password-manager-service
      - pulseaudio
      - removable-media
      - unity7
      - wayland
      - x11

@jdstrand @degville @roadmr @ijohnson @Wimpress Just tagging for some visibility. Apologies for any spam, as I’m not sure how else to find assistance.

This might be the root cause https://snapcraft.io/docs/snapcraft-esm, the PPA might not be published anymore due to this. I believe both @Igor and @kenvandine are on holidays, but could assist as soon as they are back tomorrow.

2 Likes

@craxal Might be worth also looking at moving storage-explorer to newer cores, e.g.: core18 or core20. That would also help with the GNOME packages that the snap is using from the ppa. I’ll try to build something, see where I get.

@craxal I have successfully rebuilt storage-explorer using core20 and the GNOME 3.38 extension. I’ve updated the YAML to include the necessary stage packages. The snap runs and works fine - it does however require that GNOME keyring (gnome-keyring) be installed on the system (as per this old bug report).

Here’s the updated YAML. Let me know what you think.

name: storage-explorer
version: "1.20.0"
summary: Optimize your Azure storage management
description: |
  Upload, download, and manage Azure blobs, files, queues, and tables, as well
  as Azure Cosmos DB and Azure Data Lake Storage entities. Easily access virtual
  machine disks, and work with either Azure Resource Manager or classic storage
  accounts. Manage and configure cross-origin resource sharing rules.

base: core20
grade: stable
confinement: strict

architectures:
  - build-on: amd64

parts:
  # Add the dotnet runtime apt repository to the build environment.
  dotnet-repo:
    plugin: nil
    build-packages:
      - apt-transport-https
      - wget
    override-build: |
      wget -q https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb
      dpkg -i packages-microsoft-prod.deb
      apt-get -y update

  # Stage the dotnet runtime, and its requirements, inside the snap.
  #  - https://docs.microsoft.com/en-gb/dotnet/core/linux-prerequisites?tabs=netcore2x
  dotnet-core:
    after:
      - dotnet-repo
    plugin: nil
    stage-packages:
      - dotnet-runtime-2.1
      - libcurl4
      - libicu66
      - libkrb5-3
      - liblttng-ust0
      - libssl1.1
      - zlib1g

  storage-explorer:
    after:
      - dotnet-core
    plugin: dump
    source: ./src/StorageExplorer-linux-x64.tar.gz
    stage-packages:
      - iproute2
      - libasound2
      - libatm1
      - libgconf-2-4
      - gnome-keyring
      - libnspr4
      - libnss3
      - libpulse0
      - libsecret-1-0
      - libx11-xcb1
      - libxss1
      - libxtables12
      - libxtst6
      - xdg-utils
      - libxcb-dri3-0
      - libdrm2
      - libgbm1
    prime:
      - -usr/bin/xdg-open

apps:
  storage-explorer:
    command: StorageExplorerSnap
    extensions: [gnome-3-38]
    environment:
      # Correct the TMPDIR path for Chromium Framework/Electron to
      # ensure libappindicator has readable resources
      TMPDIR: $XDG_RUNTIME_DIR
      # Fallback to XWayland if running in a Wayland session.
      DISABLE_WAYLAND: 1
      # Make sure .NET Core knows the install location in the Snap.
      DOTNET_ROOT: $SNAP/usr/share/dotnet
    plugs:
      - browser-support
      - home
      - mount-observe
      - network
      - password-manager-service
      - pulseaudio
      - removable-media
      - unity7

1 Like

Thanks @Igor. I’ll give it a whirl and let you know how it goes.

@Igor I’ve run some tests, and it looks like things are running smoothly so far.

I do have some questions, and I’m hoping you can talk through some of your changes in more detail. A number of plugs are no longer there when I thought they were required. For example, I noticed you removed several plugs from the storage-explorer app. We have a native module that explicitly uses X11, and I think Electron’s Chromium uses Wayland for some things. My guess is some of your additions are more comprehensive?

The inclusion of extensions defaults certain attributes, effectively transforming the snapcraft.yaml prior to using it. You can see exactly what gets added by running snapcraft expand-extensions, and notice how it plugs X11 and Wayland by default.

As an addition to Igor’s changes, you might want to use the new (more accurately, marked stable) package repositories feature in 4.8, e.g

package-repositories:
  - type: apt
    url: https://packages.microsoft.com/ubuntu/20.04/prod
    components: [main]
    suites: [focal]
    key-id: BC528686B50D79E339D3721CEB3E94ADBE1229CF

You could then remove the dotnet-repo part.

2 Likes

@craxal, as @James-Carroll said, my code above references the GNOME extension.

This is a snapcraft component that lets you slim down your snapcraft.yaml significantly, as it uses a lot of common definitions, parts, interfaces, environment variables, etc that you would normally set manually. This makes the final snapcraft.yaml smaller and more consistent, and you also benefit from the latest development in the snapcraft space.