bash hashed paths fail across updates

Bug #2032583 reported by Seth Arnold
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
snapd (Ubuntu)
New
Undecided
Unassigned

Bug Description

Hello, bash stores paths to executables as it learns them, to avoid spending the time searching PATH for executables all the time.

Recently I've had to tell bash to forget this list of hashed executables because the path to a snap-packaged matterhorn snap had changed:

[sarnold:~] 6d23h47m4s $ sudo snap refresh
[sudo] password for sarnold:
All snaps up to date.
[sarnold:~] 3s $ matterhorn
bash: /snap/bin/matterhorn: No such file or directory
[sarnold:~] 127 $ hash -d
hits command
   2 /snap/bin/matterhorn
   4 /usr/bin/sudo
[sarnold:~] $ hash -f
bash: hash: -f: invalid option
hash: usage: hash [-lr] [-p pathname] [-dt] [name ...]
[sarnold:~] 2 $ man hash
[sarnold:~] $ man bash
[sarnold:~] 25s $ hash -r
[sarnold:~] $ matterhorn
[sarnold:~] 7d7h11m4s $ sudo snap refresh
[sudo] password for sarnold:
All snaps up to date.
[sarnold:~] 4s $ matterhorn
bash: /snap/bin/matterhorn: No such file or directory
[sarnold:~] 127 $ hash -r
[sarnold:~] $ matterhorn

Command 'matterhorn' not found, but can be installed with:

sudo snap install matterhorn

[sarnold:~] 127 $ /snap/matterhorn/
399/ 400/ current/
[sarnold:~] 127 $ /snap/matterhorn/current/
app/ bin/ etc/ meta/ snap/ usr/ var/
[sarnold:~] 127 $ /snap/matterhorn/current/bin/matterhorn
A default configuration file has been created at
  /home/sarnold/.config//config.ini

Use with your $EDITOR to customize it

Call this command to setup an access token:
  snap run --shell matterhorn -c \
    'secret-tool store --label="$SNAP_NAME" $SNAP_NAME <token>'

Press any key to run ...
 /snap/matterhorn/current/bin/matterhorn: line 37: /app/matterhorn: No such file or directory

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.