Snap does not show list of channels

I have one server where snap info lxd does not show list of available snap channels.
snap info core works as expected, snap at all other servers works as expected.

Ubuntu 18.04.3 LTS

apt show snapd
Package: snapd
Version: 2.40+18.04

reboot does not help.

How to trace the problem?

Can you paste the actual issue? Also snap version

# snap version
snap    2.40+18.04
snapd   2.40+18.04
series  16
ubuntu  18.04
kernel  5.0.0-25-generic

Original problem described on LXC forum - https://discuss.linuxcontainers.org/t/fixed-snap-do-not-show-channels-for-lxd/5565/2

# snap info lxd
name:      lxd
summary:   System container manager and API
publisher: Canonical✓
contact:   https://github.com/lxc/lxd/issues
license:   unset
description: |
  **LXD is a system container manager**

...

commands:
  - lxd.benchmark
  - lxd.buginfo
  - lxd.check-kernel
  - lxd.lxc
  - lxd
  - lxd.migrate
services:
  lxd.activate: oneshot, enabled, inactive
  lxd.daemon:   simple, enabled, active
snap-id:      J60k4JY0HppjwOjW8dZdYc8obXKxujRu
tracking:     stable
refresh-date: 10 days ago, at 15:26 MSK
installed:    3.16 (11727) 57MB -

The channels part is missing. It looks like

channels:
  stable:         3.16        2019-08-22 (11727) 57MB -
  candidate:      3.16        2019-08-22 (11727) 57MB -
  beta:           ↑                                   
  edge:           git-8cae4ea 2019-08-22 (11721) 57MB -
  3.16/stable:    3.16        2019-08-22 (11727) 57MB -
  3.16/candidate: 3.16        2019-08-22 (11727) 57MB -
  3.16/beta:      ↑                                   
  3.16/edge:      ↑                                   
  3.0/stable:     3.0.4       2019-07-23 (11348) 55MB -
  3.0/candidate:  3.0.4       2019-07-23 (11348) 55MB -
  3.0/beta:       ↑                                   
  3.0/edge:       git-81b81b9 2019-07-23 (11362) 55MB -
  2.0/stable:     2.0.11      2018-07-30  (8023) 28MB -
  2.0/candidate:  2.0.11      2018-07-27  (8023) 28MB -
  2.0/beta:       ↑                                   
  2.0/edge:       git-c7c4cc8 2018-10-19  (9257) 26MB -

I can see this part on other servers and for other snap packages (like snap info core) but not on this server.

I suppose this is not correct and something is wrong.

If you snap refresh lxd --channel=edge then snap refresh lxd --channel=stable does it reset the snap info lxd view?

Before doing the double refresh, I’d like to enable debug to see what’s going on…

how to enable debug?

drop the following in /etc/systemd/system/snapd.service.d/debug.conf (you might need to create the directory first):

[Service]
Environment=SNAPD_DEBUG=1 SNAPD_DEBUG_HTTP=7

followed by systemctl daemon-reload && systemctl restart snapd.service. Run snap info lxd again, and then journalctl --system --unit=snapd > snapd.log, and either pass that file through delog.py and paste it here, or send me the contents to chipaca@canonical.com (they’ll be quite long and might contain stuff you don’t want on a forum – delog cleans 'em up).

# ./delog.py
Traceback (most recent call last):
  File "./delog.py", line 15, in <module>
    from pygments import highlight, formatters
ModuleNotFoundError: No module named 'pygments'

Have no idea how to fix it.

https://transfer.sh/FaqTN/snapd.log

Hmm, that’s strange, that has DEBUG logs, but it’s as if the SNAPD_DEBUG_HTTP=7 bit didn’t take. Could you double-check that?

# ll  /etc/systemd/system/snapd.service.d/debug.conf
-rw-r--r-- 1 root root 56 Sep  4 01:00 /etc/systemd/system/snapd.service.d/debug.conf

# cat  /etc/systemd/system/snapd.service.d/debug.conf
[Service]
Environment=SNAPD_DEBUG=1 SNAPD_DEBUG_HTTP=7

systemctl daemon-reload
systemctl restart snapd.service
snap info lxd
journalctl --system --unit=snapd > snapd.log
curl --upload-file snapd.log https://transfer.sh/snapd.log

https://transfer.sh/CsgEn/snapd.log

What’s the output of snap debug connectivity?

# snap debug connectivity
Connectivity status:
 * PASS

In the directory where you’re running snap info lxd, would you happen to have a directory lxd that contains an unpacked lxd snap?

1 Like

I noticed something like this too, when using snap info in a directory containing subdirs matching snap names. It doesn’t seem to require that the subdir contain an unpacked snap. Starting in an empty directory:

$ ls
$ snap info core
name:      core
summary:   snapd runtime environment
publisher: Canonical✓
contact:   snaps@canonical.com
license:   unset
description: |
  The core runtime environment for snapd
type:         core
snap-id:      99T7MUlRhtI3U0QFgl5mXXESAiSwt776
tracking:     stable
refresh-date: 23 days ago, at 22:34 AWST
channels:
  stable:    16-2.40                 2019-08-12 (7396) 92MB -
  candidate: 16-2.41                 2019-09-03 (7713) 93MB -
  beta:      16-2.41                 2019-08-30 (7713) 93MB -
  edge:      16-2.41+git1466.1d14c09 2019-09-04 (7742) 93MB -
installed:   16-2.40                            (7396) 92MB core
$ mkdir core
$ snap info core
name:      core
summary:   snapd runtime environment
publisher: Canonical✓
contact:   snaps@canonical.com
license:   unset
description: |
  The core runtime environment for snapd
type:         core
snap-id:      99T7MUlRhtI3U0QFgl5mXXESAiSwt776
tracking:     stable
refresh-date: 23 days ago, at 22:34 AWST
installed:    16-2.40 (7396) 92MB core
$ 
2 Likes

yes, indeed, I have the directory named lxd at my $HOME and I’m usually run snap info from my $HOME.

cd /tmp && snap info lxd works fine.

It looks like usability bug, should I create issue somewhere?

on it already, thanks.

Oh, I ran into this today as well. It was very confusing!

1 Like