Weird error message whenever I run the "snap" command

Hi,

So whenever I run the snap command in the bash window, I always get the following message:

Schermafdruk%20van%202018-07-17%2016-29-27

translation of error message:

2018/07/17 16:28:59.419520 main.go:150: description of sign’s “k” is lowercase: “name of the key to use, or use the default key instead”

2018/07/17 16:28:59.419646 main.go:150: description of install’s “dangerous” is lowercase: “install the given snapfile yourself when there is no predefined signature for it, which means that it’s not verified and could be dangerous (–devmode implies this)”

The command executes just fine, but it’s kinda annoying to see this message pop up everytime. It even happens when I press tab to complete a snap command… Does anyone know how I can fix this?

1 Like

Anyone having the same issue?

I think that is a specific translation issue: the code as written seems to require that translated strings used for the description of command-line options must begin with an upper-case character.

References:

How are translations handled in Snap? I could try to update the language files to make sure they start with an uppercase letter, if someone explains what the protocol is for language translations in Snap :slight_smile:

Yes, same problem here. Ubuntu 18.04. Snaps installed:

$ snap list
2018/09/26 11:52:12.662080 main.go:150: description of sign's "k" is lowercase: "naam van de te gebruiken sleutel, gebruik anders de standaardsleutel"
2018/09/26 11:52:12.662214 main.go:150: description of install's "dangerous" is lowercase: "installeer het opgegeven snapbestand zelfs indien er geen vooraf erkende handtekeningen voor zijn, hetgeen betekent dat het niet werd geverifieerd en dus gevaarlijk zou kunnen zijn (--devmode impliceert dit)"
Name                  Version      Rev   Tracking   Publisher         Notes
atom                  1.30.0       198   stable     snapcrafters      classic
bitwarden             1.8.0        10    stable     bitwarden✓        -
core                  16-2.35      5328  stable     canonical✓        core
gnome-3-26-1604       3.26.0       70    stable/…   canonical✓        -
gnome-calculator      3.30.0       238   stable/…   canonical✓        -
gnome-characters      3.29.91      124   stable/…   canonical✓        -
gnome-logs            3.30.0       43    stable/…   canonical✓        -
gnome-system-monitor  3.30.0       57    stable/…   canonical✓        -
gtk-common-themes     0.1          701   stable     canonical✓        -
libreoffice           6.1.1.2      83    candidate  canonical✓        -
telegram-desktop      1.3.14       274   stable     telegram.desktop  -
ubports-installer     0.1.20-beta  170   stable     mariogrip         -

$ snap version
2018/09/26 11:54:00.517959 main.go:150: description of sign's "k" is lowercase: "naam van de te gebruiken sleutel, gebruik anders de standaardsleutel"
2018/09/26 11:54:00.518096 main.go:150: description of install's "dangerous" is lowercase: "installeer het opgegeven snapbestand zelfs indien er geen vooraf erkende handtekeningen voor zijn, hetgeen betekent dat het niet werd geverifieerd en dus gevaarlijk zou kunnen zijn (--devmode impliceert dit)"
snap    2.35
snapd   2.35
series  16
ubuntu  18.04
kernel  4.15.0-23-generic

The translations are on launchpad somewhere, but I can’t figure out where. (I’m pinging the IRC to find out if anyone knows…)

Heh. I’m so glad we changed it from throwing a panic, which is what it did before… :slight_smile:

Also! Thank you for reporting this: it’s a silly thing, but we really care how the help output looks, and having the wrong case in these descriptions is part of that.

Looks like it was reported in launchpad a while ago and we somehow missed it:

I am getting the same on apt. I guess it’s calling snap. Any idea’s how to get rid of the message?

@OoooohhSnap could you post a screenshot of that?

Yes, apt calls snap in some situations but it’s supposed to have its stderr redirected so you don’t see things like this (or any errors really).

@mvo ^ probably of interest to you (but very low priority, given what you’re on right now)

1 Like

@mvo @chipaca 2018-10-24_20-53
I am on 18.10. I am just running ‘sudo apt autoremove’ or any other apt command.

Ouch, that’s nasty. Sorry.

What 's the output of snap version? I’m trying to reproduce this in 18.10 and failing.

Edit: never mind, figured it out: needed to install language-back-nl-base.

Ok, so the bug is in the file /etc/apt/apt.conf.d/20snapd.conf. It isn’t redirecting standard error as it should.
It looks like this:

AptCli::Hooks::Install { "[ ! -f /usr/bin/snap ] || /usr/bin/snap advise-snap || true"; };

and you want it to look like this:

AptCli::Hooks::Install { "[ ! -f /usr/bin/snap ] || /usr/bin/snap advise-snap --from-apt 2>/dev/null || true"; };

the best way would be to just edit that file and add the needed redirection. If that seems too arcane, you could also run

sudo perl -pi~ -we 's|from-apt|from-apt 2>/dev/null|' /etc/apt/apt.conf.d/20snapd.conf

which should do the edit for you (and leave a backup of the old file in /etc/apt/apt.conf.d/20snapd.conf~ just in case). But you probably shouldn’t be running arbitrary commands from some rando on an internet forum. I hear it’s bad for your teeth.

2 Likes

diddledan is trolling again…

and then we get

… a few minutes later …

@chipaca I’ll try running your shady commands tonight! :smiley:

@chipaca Thanks for the fix! it works! No more irritating garbage in the output!

1 Like