snap info gets confused if there is a directory of the same name

Bug #1845533 reported by Omer Akram
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
snapd
Fix Released
Medium
John Lenton

Bug Description

I have the latest snapd installed and I just found a weird behavior, whenever I try to run `snap info` command while in a location that contains a directory/file of the same name, the command line gets confused

```
om26er@chaotic:~$ ls
Android deskconnd-sock-dir deskconn.keys Desktop Documents Downloads Music Pictures Public scm snap Templates Videos
om26er@chaotic:~$ snap info Desktop
error: no snap found for "Desktop/"
```

om26er@chaotic:~$ apt-cache policy snapd
snapd:
  Installed: 2.41+19.10.1
  Candidate: 2.41+19.10.1
  Version table:
 *** 2.41+19.10.1 500
        500 http://archive.ubuntu.com/ubuntu eoan/main amd64 Packages
        100 /var/lib/dpkg/status

John Lenton (chipaca)
Changed in snapd:
status: New → Fix Committed
importance: Undecided → Medium
assignee: nobody → John Lenton (chipaca)
Revision history for this message
John Lenton (chipaca) wrote :

actually, at first I thought this was the bug I recently fixed in master about 'snap info' getting confused by a directory existing with the same name as a snap in the store.

The issue you seem to be trying to report is different: it's snap info behaving as expected.

You asked it for information about a directory, that isn't a snap. What error did you expect to get?

Changed in snapd:
status: Fix Committed → Incomplete
Revision history for this message
John Lenton (chipaca) wrote :

Right, so this does look like a regression that's slipped in at some point.

How to reproduce:

1. find a snap in the store, see its info:

$ snap info slow-snap
name: slow-snap
...

2. create a directory with the same name as the snap, and try again:

$ mkdir slow-snap
$ snap info slow-snap
error: no snap found for "slow-snap/"

I'll look into it.

Changed in snapd:
status: Incomplete → In Progress
Revision history for this message
John Lenton (chipaca) wrote :

Ok, so this is fixed in 2.42pre already, by https://github.com/snapcore/snapd/pull/7404.

We're not testing for this actual scenario though, so I'll add a test for it.

Revision history for this message
John Lenton (chipaca) wrote :

Hah! We _are_ testing for it, because the test I added in that PR covers this case as well.

All done! Very efficient of me, I must say.

Changed in snapd:
status: In Progress → Fix Committed
John Lenton (chipaca)
Changed in snapd:
status: Fix Committed → 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.