"snap find" command cannot find ubuntu-calculator-app. However, it can be installed on 16.04

Bug #1602154 reported by XiaoGuo, Liu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snappy
Fix Released
High
John Lenton

Bug Description

I can install ubuntu-calculator-app via command:

snap install ubuntu-calculator-app

However, I cannot find it using "snap find" command.

According to the document at https://developer.ubuntu.com/en/desktop/get-started/, "snap find" should return all of the available apps for installation.

=============================================

Finding snaps

$ snap find <search-term>
Tip: you can call snap find without a search term to show all apps available to install on your system.

============================================

The following command does not result concise result:

snap find ubuntu-calculator-app

========================================================
liuxg@liuxg:~$ snap find ubuntu-calculator-app
Name Version Developer Notes Summary
apktool 2.1.1 ligboy - A tool for reverse engineering 3rd party, closed, binary Android apps.
audovia 3.3.1 songbuilder - Database application for making music using JFugue MusicStrings
blender-tpaw 2.77a tpaw - Blender is the free and open source 3D creation suite.
bluez 5.37-1 canonical - Bluez for Ubuntu
canonical-pc-linux 4.4.0-18+20160419.13-26 canonical - The ubuntu-core kernel snap
click-parser 3.0.5 bhdouglass - Extract data from Ubuntu's click & snap packages
gdoc-html-cleaner 0.1.2 caldav - Download Google Docs as cleaned HTML files
gtwang-demo 1.0 gtwang - G.T.Wang demo application.
keepassx-elopio 2.0.2 elopio - KeePassX is a cross platform password safe
krita 3.0-snap12 krita - Krita: the free digital painting studio
minecraft-server-jdstrand 16.04.8 jdstrand - Minecraft server packaging for Ubuntu Core
nitrokey-app 0.4snap1 nitrokey - Nitrokey Application
notes 0.9.0~gitb6e3b34 notes-developers - Note-taking application, write down your thoughts
packageproxy 0.1 ogra - approx based package proxy running on port 9999
pen 1.0.0 stephen-stewart-blah - pen is a Markdown previewer written in JavaScript, aiming to just work.
qownnotes 16.07.3 pbek - Plain-text file notepad with markdown support and ownCloud integration
simplenote-jamiebennett 1.0.1 jamiebennett - The simplest way to keep notes. Install with --devmode.
snappy-debug 0.23 canonical - Debug tools for ubuntu-core
snapstore-example 0.3 noise - Minimalist example snap store
systesterpro64 1.6.2-1snap lucast70 3.45USD Stress test and benchmark
teatime-unity 16.04 paroj - Simple egg timer application for the Unity Desktop
test-snapd-tools 1.0 canonical - Tools for testing the snapd application
tio 1.20 lundmar - A simple TTY terminal I/O application
ubuntu-calculator-app 2.1+snap3 ubuntucoredev - Ubuntu Calculator application for the Unity 7 desktop
ubuntu-clock-app 3.6+snap3 ubuntucoredev - Ubuntu Clock application for the Unity 7 desktop
ubuntu-core 16.04+20160531.11-56 canonical - The ubuntu-core OS snap
ufw 0.36pre-16.2 canonical - ufw (Uncomplicated Firewall) for Ubuntu Core
wallpaperdownloader 2.0 egarcia - Download and manage your favorite wallpapers from the Internet
x11-apps 1 chadmiller - x11 apps
======================================================================

Revision history for this message
Daniel Holbach (dholbach) wrote :

<dholbach> seb128, do you know if "snap find" is supposed to show a list of everything?
<seb128> I don't
<seb128> I would expect so though
<dholbach> JamesTait, ^ do you know?
<JamesTait> dholbach, "a list of everything"? As in, every package in the store?
<dholbach> every available snap for that user (arch, release, channel)?
<JamesTait> I don't know if it's *supposed* to, or if it would be a good idea to, especially when we have more than a couple of hundred snaps, but atm I don't think it does anything with result set size or pagination, so it'll be limited to 100 results.

Revision history for this message
Daniel Holbach (dholbach) wrote :

If that's what the store does, it'd be good if snapd would at least inform the user that it only shows 100 results.

Revision history for this message
Daniel Holbach (dholbach) wrote :

<liuxg> dholbach, JamesTait, I think it would be better to expand it so that we can use "grep" command to find the needed apps
<liuxg> dholbach, JamesTait, 100 may not be enough. Anyway, currently, it shows 100 results.
<JamesTait> liuxg, tbh I think I'd prefer it if the user had to explicitly opt in to thousands of results, but there may be precedent with, for example, apt - I don't know if that limits the number of results.
<dholbach> JamesTait, it doesn't

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

What is going to happen in the short term is that "snap find" with no arguments is going to error out:

$ snap find
error: cannot list snaps: empty query

It has *never* been the intent that it would be possible to list all snaps in the store. Requiring a search term will make this more obvious.

In the future instead of erroring out we might show a short list of highlighted snaps, but that is mostly speculation on my part.

Furthermore, the exact search term you're looking for will work:

$ snap find ubuntu-calculator-app
Name Version Developer Notes Summary
ubuntu-calculator-app 2.1+snap3 ubuntucoredev - Ubuntu Calculator application for the Unity 7 desktop

Changed in software-center-agent:
status: New → Invalid
no longer affects: software-center-agent
Changed in snappy:
status: New → In Progress
importance: Undecided → High
assignee: nobody → John Lenton (chipaca)
Revision history for this message
James Tait (jamestait) wrote :

< JamesTait> liuxg, I'm not certain which endpoint snapd is currently using for the search, but the reason for the larger-than-expected result set is that it's tokenising the search term and returning all results that match "ubuntu OR calculator OR app" in the package name.
< ~liuxg> JamesTait, I am thinking it should take "ubuntu-calculator-app" as a whole phrase to search. the searched result is pretty messy now, and make it less useful as it would be.
< JamesTait> liuxg, possibly, yes, there's probably room to tweak how we handle searches. It's a matter of balancing between "I know exactly what package I'm loking for" (in which case why not just use snap install straight off?), "I know roughly what package I'm looking for" (e.g. linux-image-something) and "I don't know what package to install, but I want something that does X" (e.g. snap find vector editor, which would actually probably be a different subcommand and endpoint).

Based on the results I'm seeing, it looks like snapd is already using the snap-focused search endpoing (`api/v1/snaps/search`), which is driven more by package name than description, keywords, title and summary. We could maybe make it a prefix search with no analysis, or do something funky with multiple requests to the backend.

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

@JamesTait the branch off of which I ran the above examples switches to use the backend's `name=foo` query instead of `q=foo` by default, which gives the expected results wrt tokenization. It's a first approach at having a client-side grammar, so you can also do things like

$ snap find name:ubuntu # exact name search (uses snaps/details from CPI)
error: no snaps found for "name:ubuntu"
$ snap find name:ubuntu* # prefix name search; same as "snap find ubuntu" (uses name=x from CPI)
Name Version Developer Notes Summary
ubuntu-calculator-app 2.1+snap3 ubuntucoredev - Ubuntu Calculator application for the Unity 7 desktop
ubuntu-clock-app 3.6+snap3 ubuntucoredev - Ubuntu Clock application for the Unity 7 desktop
ubuntu-core 16.04+20160531.11-56 canonical - The ubuntu-core OS snap
$ snap find text:ubuntu # like old "snap find ubuntu" (uses q=x from CPI)
Name Version Developer Notes Summary
bluez 5.37-1 canonical - Bluez for Ubuntu
canonical-pc-linux 4.4.0-18+20160419.13-26 canonical - The ubuntu-core kernel snap
click-parser 3.0.5 bhdouglass - Extract data from Ubuntu's click & snap packages
krita 3.0-snap12 krita - Krita: the free digital painting studio
minecraft-server-jdstrand 16.04.8 jdstrand - Minecraft server packaging for Ubuntu Core
snappy-debug 0.23 canonical - Debug tools for ubuntu-core
ubuntu-calculator-app 2.1+snap3 ubuntucoredev - Ubuntu Calculator application for the Unity 7 desktop
ubuntu-clock-app 3.6+snap3 ubuntucoredev - Ubuntu Clock application for the Unity 7 desktop
ubuntu-core 16.04+20160531.11-56 canonical - The ubuntu-core OS snap
ufw 0.36pre-16.2 canonical - ufw (Uncomplicated Firewall) for Ubuntu Core

This work is not on master yet, but I expect it to be in the next release (or the one after that if I'm asked to iterate the error messages ;-) )

Revision history for this message
Oliver Grawert (ogra) wrote :

it seems to be the dash in the search term that breaks it:

ogra@styx:~$ snap find calculator
Name Version Developer Notes Summary
ubuntu-calculator-app 2.1+snap3 ubuntucoredev - Ubuntu Calculator application for the Unity 7 desktop

vs:

ogra@styx:~$ snap find ubuntu-calculator-app
Name Version Developer Notes Summary
apktool 2.1.1 ligboy - A tool for reverse engineering 3rd party, closed, binary Android apps.
audovia 3.3.1 songbuilder - Database application for making music using JFugue MusicStrings
blender-tpaw 2.77a tpaw - Blender is the free and open source 3D creation suite.
bluez 5.37-1 canonical - Bluez for Ubuntu
...

vs:

ogra@styx:~$ snap find calculator-app
Name Version Developer Notes Summary
apktool 2.1.1 ligboy - A tool for reverse engineering 3rd party, closed, binary Android apps.
audovia 3.3.1 songbuilder - Database application for making music using JFugue MusicStrings
blender-tpaw 2.77a tpaw - Blender is the free and open source 3D creation suite.
gdoc-html-cleaner 0.1.2 caldav - Download Google Docs as cleaned HTML files
gtwang-demo 1.0 gtwang - G.T.Wang demo application.
...

vs:
ogra@styx:~$ snap find ubuntu-calculator
Name Version Developer Notes Summary
bluez 5.37-1 canonical - Bluez for Ubuntu
canonical-pc-linux 4.4.0-18+20160419.13-26 canonical - The ubuntu-core kernel snap
click-parser 3.0.5 bhdouglass - Extract data from Ubuntu's click & snap packages
krita 3.0-snap12 krita - Krita: the free digital painting studio
...

Revision history for this message
Mark Shuttleworth (sabdfl) wrote : Re: [Bug 1602154] Re: "snap find" command cannot find ubuntu-calculator-app. However, it can be installed on 16.04

On 12/07/16 01:43, John Lenton wrote:
> $ snap find
> error: cannot list snaps: empty query

Please make that an error message for humans, not an error message for
snapd developers.

For example:

 $ snap find
 Please provide a name to search for, and use --broad to search
descriptions as well.

Thanks,
Mark

Revision history for this message
Mark Shuttleworth (sabdfl) wrote :

On 12/07/16 02:07, John Lenton wrote:
> @JamesTait the branch off of which I ran the above examples switches to
> use the backend's `name=foo` query instead of `q=foo` by default, which
> gives the expected results wrt tokenization. It's a first approach at
> having a client-side grammar, so you can also do things like
>
> $ snap find name:ubuntu # exact name search (uses snaps/details from CPI)
> error: no snaps found for "name:ubuntu"
> $ snap find name:ubuntu* # prefix name search; same as "snap find ubuntu" (uses name=x from CPI)
>

I don't think we need this at all - I certainly don't recall any
discussions about nerdy search strings, please don't do this work until
we agree it's not a waste of time.

Mark

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

Oops. Well, let's talk about it next week.

Changed in snappy:
status: In Progress → Fix Committed
Revision history for this message
Gustavo Niemeyer (niemeyer) wrote :

Mark, you mean "snap find text:foo" is nerdy but "snap find --broad foo" is not? :-)

Sure, let's talk next week.

Revision history for this message
Mark Shuttleworth (sabdfl) wrote :

Yes, quite obviously text:foo.*\(r\)) is nerdy ;)

'snap find' is for humans. Developers will see their own snaps and not
have millions of them to search.

We're not going to invest in nerdy search. I would rather invest in
search that is actually useful to our intended audience. That's worth
discussing next week.

Mark

Revision history for this message
Gustavo Niemeyer (niemeyer) wrote :

Nobody suggested that would work.

The distinction between this being for humans:

    snap find --broad foo

but this not:

    snap find text:foo

is not well founded.

Very well known products use prefix-based searches, including all of GMail, both on plain searches and on mail filtering. The search box is merely a template that once filled visibly translates the fields into prefixes in the search box.

The "waste of time" is also untrue. It took the same amount of time to engineer it like this than it would take to have a different query parameter for every search option, with the advantage that this method spans every single search box that will input into that backend with the same language, without preventing alternative ways to fill up the same data (we can easily make "--broad foo" map into "broad:foo" for example).

Revision history for this message
Shuduo Sang (sangshuduo) wrote :

Find clock on my 1604 but show calculator and clock. :)

$ snap find clock
Name Version Developer Notes Summary
ubuntu-calculator-app 2.1+snap3 ubuntucoredev - Ubuntu Calculator application for the Unity 7 desktop
ubuntu-clock-app 3.6+snap3 ubuntucoredev - Ubuntu Clock application for the Unity 7 desktop

John Lenton (chipaca)
Changed in snappy:
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.