New snap warning, unclear user action

Ubuntu Version

Ubuntu 24.04 LTS

Desktop Environment (if applicable)

None (server/headless)

Problem Description

I now get a warning every time I install a snap:

$ snap install ...
...
WARNING: There is 1 new warning. See 'snap warnings'.

Then:

$ snap warnings
last-occurrence:  today at 16:00 CEST
warning: |
  Option value has invalid field name "apiVersion". For core26+ snaps, fields must be dash separated
  lowercase alphanumerics.

but it’s not clear to me what to do with this.

From a non-native English speaking POV I would guess it wants you to use a lower case V in apiVersion…

I mean, of course :slight_smile: but what apiVersion? Who originates this? Is it even on me to change it, or is it a developer issue?

1 Like

Can you tell which app you’ve installed? With it, I will try to reproduce this output on my end aswell just to see whether it’s an isolated incident or something more common.

1 Like

It is most likely an issue with the specific snap you installed (it isn’t fatal so the snap should be there on your disk to inspect it … i.e. run a grep -r against /snap/<snap name>/current )…

It is likely using apiVersion as i.e. a key for a setting in the configure hook or similar …

1 Like

$ grep -r apiVersion -r /snap/ 2>/dev/null | grep snapcraft.yaml gave zero results. I have no way to know what app is it (it has started appearing after a flurry of updates), and crucially, the warning doesn’t say it.

If you enter:

snap list

You’ll see all snaps that are currently installed. Read through them to see which ones you’ve installed, and that will narrow it down.

I wouldn’t expect it to come from a snapcraft.yaml entry, rather some configure hook or some script using snapctl, do you get anything when omitting the filter for snapcraft.yaml ?

1 Like

@astrojuanlu there is another clue in the snapcraft forum, let’s see what the snapd dev team answers there:

(smells like there is a bug TBH, it should not validate values, only key names)

To be clear, my goal isn’t to find the package that is producing this warning, but to flag that (1) the warning is very frugal (what file? what package?) and (2) this looks like something the developer of the snap should care about, not me as a consumer.

1 Like

Yep, fully agreed regarding the error message, but you should really open an issue against snapd for that bit…

what I wanted to point out is that apparently even snap maintainers are caught by this … and I think it is likely the snapcraft forum post will get an answer and cause a discussion with the snapd team where you could express this too …

1 Like

This was a fix for Bug #2072331 “dash-case-subset config on snap set not being vali... : Bugs : snapd - I’ve asked the team see if we can improve the docs and error message at all.

2 Likes

This topic was automatically closed after 30 days. New replies are no longer allowed.

Hi folks,

sorry for reopening the thread. I saw the other thread @ndyer linked but I don’t think it helps resolve the confusion.

In my case, I just installed canonical k8s and got that warning. I think this can be a big deterrent for new users if the first thing they see after installing a snap is a warning, without understanding what they’re being warned about or being able to address it.

I understand the logic mentioned in the other thread about avoiding users setting data that contains invalid field names/keys, but for a user that is just installing a snap for the first time this is a really bad user experience.

1 Like