2.54.2+21.10 introduces a call in vendor_conf.d/snapd.fish to fish function `fish_add_path` which requires fish 3.2 or later (Impish only packages fish 3.1)

Bug #1957948 reported by Matias Piipari
170
This bug affects 34 people
Affects Status Importance Assigned to Milestone
snapd
Fix Released
Undecided
Maciej Borzecki
snapd (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

After installing the proposed snapd update 2.54.2+21.10, I see the following when launching a new fish shell session on 21.10:

```
/usr/share/fish/vendor_conf.d/snapd.fish (line 3):
fish_add_path -aP $snap_bin_path
^
from sourcing file /usr/share/fish/vendor_conf.d/snapd.fish
 called on line 294 of file /usr/share/fish/config.fish
from sourcing file /usr/share/fish/config.fish
 called during startup
```

Said line of `/usr/share/fish/vendor_conf.d/snapd.fish` references the fish function `fish_add_path` which seems (*) to have only been made available in fish 3.2 (Ubuntu 21.10 packages 3.1.2 of fish presently).

Upgrading fish by installing 3.2 or later via https://launchpad.net/~fish-shell/+archive/ubuntu/release-3 indeed works around (or modifying above script to `set -gx $PATH ...` (I guess this comes with the downside of duplicate entries that `fish_add_path` removes?)

(*) PR adding `fish_add_path`: https://github.com/fish-shell/fish-shell/pull/7028 was part of the 3.2 milestone

Revision history for this message
Maciej Borzecki (maciek-borzecki) wrote :

This was fixed in https://bugs.launchpad.net/snapd/+bug/1957155 which so far is available only in snapd master.

Changed in snapd (Ubuntu):
status: New → Confirmed
Revision history for this message
Dan Ryan (techalchemy) wrote :

as far as I can see `fish_add_path` is still called from data/env/snapd.fish on master (see https://github.com/snapcore/snapd/blob/master/data/env/snapd.fish.in#L3 for reference) and the mentioned bug and corresponding PR/fix only affect the setting of XDG_DATA_DIRS and not the invalid call to this non-existent function on fish <3.2

Revision history for this message
Maciej Borzecki (maciek-borzecki) wrote :

One more fix for fish https://github.com/snapcore/snapd/pull/11371 seems to work in Focal VM.

Changed in snapd:
status: New → Confirmed
assignee: nobody → Maciej Borzecki (maciek-borzecki)
Revision history for this message
Halvor Lyche Strandvoll (halvors) wrote :

Still experiencing this on Ubuntu 21.10.

Revision history for this message
Martin Vysny (vyzivus) wrote :
Logan Rosen (logan)
tags: added: regression-update
Revision history for this message
Quinn Diggity (quinndiggity) wrote :

Got hit by this, flooded with cron emails, thanks.

For others affected who land here, I've found that the proper fix for the issue is:

```
apt purge snapd
apt-mark hold snapd
```

Good riddance.

Dear, Canonical, no one wants snapd, and it is pushing a large majority of your userbase away. Would love to keep using Ubuntu, but your decisions around snapd (such as discovering security updates aren't being applied at all to Firefox, thanks again for that) are making the Ubuntu ecosystem unusable, particularly for long time users.

Revision history for this message
Niklas Sombert (ytvwld) wrote :

The new snapd release 2.54.3+20.04.1ubuntu0.2 in focal makes this error message go away for me, but it completely broke my (Plasma) desktop session, because XDG_DATA_DIRS was not set before (making something fill it on start; don't know where that happens), but it now contains only /var/lib/snapd/desktop.
The session start adds some paths, but notably /usr/local/share and /usr/share are missing.

I fixed it for me by wrapping the last lines of /usr/share/fish/vendor_conf.d/snapd.fish in an if:

  12 │ if not set -q XDG_DATA_DIRS
  13 │ if not contains $snap_xdg_path $XDG_DATA_DIRS
  14 │ set XDG_DATA_DIRS $XDG_DATA_DIRS $snap_xdg_path
  15 │ end
  16 │ end

Revision history for this message
Maciej Borzecki (maciek-borzecki) wrote :

@ytvwld I have 2.54.3+20.04.1ubuntu0.2 version:

```
guest@ubuntu:~$ dpkg -l snapd
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============-=======================-============-============================================
ii snapd 2.54.3+20.04.1ubuntu0.2 amd64 Daemon and tooling that enable snap packages
```

Which contains this bit in /usr/share/fish/vendor_conf.d/snapd.fish:

```
if not set -q XDG_DATA_DIRS
    set --global --export XDG_DATA_DIRS $XDG_DATA_DIRS
    # XDG_DATA_DIRS is not defined, set it to some reasonable defaults
    set XDG_DATA_DIRS (string join : /usr/local/share /usr/share)
end

if not contains $snap_xdg_path (string split : "$XDG_DATA_DIRS")
    set XDG_DATA_DIRS (string join : -- $XDG_DATA_DIRS $snap_xdg_path)
end
```

Which does not look like what you pasted. Can you double check you have the right version installed?

Revision history for this message
Niklas Sombert (ytvwld) wrote :

Oh, sorry. I had 2.54.3+20.04.1ubuntu0.1 installed, the newer one seems to mostly work.
I can log in and snap apps appear in the menu.
XDG_DATA_DIRS now contains /var/lib/snapd/desktop twice, but that does not seem to be a major problem.

Revision history for this message
Jay Tuckey (jay-tuckey) wrote :

Ok, I can confirm this is fixed now with version 2.54.3+20.04.1ubuntu0.2

Changed in snapd (Ubuntu):
status: Confirmed → Fix Released
Changed in snapd:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.