'cannot read revision of base snap'

I’m working on porting Prometheus (and node_exporter) to Core. It’s a very straight forward Snap and the source is available here.

When I install it however, I get the following error:

Apr 29 09:08:43 localhost prometheus-lab.prometheus[8392]: cannot read revision of base snap /snap/core/current: No such file or directory

Here’s the snapcraft.yaml file:

name: prometheus-lab
version: 0.1
summary: Prometheus
description: |
  Prometheus is a system monitoring tool.
architectures: [armhf]
confinement: devmode

    plugin: python
    python-version: python3
    source: config-builder
    plugin: dump
    source: https://github.com/prometheus/prometheus/releases/download/v2.2.1/prometheus-2.2.1.linux-armv7.tar.gz
    prepare: rm NOTICE
    plugin: dump
    source: https://github.com/prometheus/node_exporter/releases/download/v0.15.2/node_exporter-0.15.2.linux-armv7.tar.gz
    prepare: rm NOTICE
    command: python config-builder.py
  #  daemon: oneshot
    command: node_exporter
    daemon: simple
    - network
    command: prometheus --config.file="$SNAP_COMMON/prometheus.yml"
    daemon: simple
    - network

Anyone got any ideas?

as usual a snap version would be the first debug info thats helpful here :slight_smile:

Sure thing, @ogra.

$ snap version
snap    2.32.5
snapd   2.32.5
series  16
kernel  4.4.0-1087-raspi2

the error mesage comes from


this was merged long ago it seems, is /snap/core/current a proper symlink on your system … ? also pinging @zyga-snapd

is /snap/core/current a proper symlink on your system

I’d say no.

vpetersson@localhost:~$ ls -lah /snap/core/
total 8.0K
drwxr-xr-x  3 root root 4.0K Jan 10 21:23 .
drwxr-xr-x  7 root root 4.0K Apr 29 09:05 ..
drwxr-xr-x 23 root root  308 Dec 18 15:21 3750

After resolving that issue (i.e. creating the symlink), I got the following error instead:

Apr 29 16:50:45 localhost prometheus-lab.prometheus[8681]: cannot find device backing the base snap core

the snap changes output might reveal what went wrong with setting up your core snap here …

$ snap changes
ID   Status  Spawn                 Ready                 Summary
4    Error   2018-04-28T17:12:45Z  2018-04-28T17:12:48Z  Install "prometheus-lab" snap from file "prometheus-lab_2.2.1_armhf.snap"
5    Done    2018-04-28T17:13:06Z  2018-04-28T17:15:21Z  Install "prometheus-lab" snap from file "prometheus-lab_2.2.1_armhf.snap"
6    Done    2018-04-28T17:28:34Z  2018-04-28T17:28:58Z  Install "prometheus-lab" snap from file "prometheus-lab_2.2.1_armhf.snap"
7    Done    2018-04-28T17:31:29Z  2018-04-28T17:31:39Z  Remove "prometheus-lab" snap
8    Done    2018-04-28T17:31:43Z  2018-04-28T17:31:58Z  Install "prometheus-lab" snap from file "prometheus-lab_2.2.1_armhf.snap"
9    Done    2018-04-28T17:39:55Z  2018-04-28T17:40:03Z  Remove "prometheus-lab" snap
10   Done    2018-04-28T17:40:14Z  2018-04-28T17:40:35Z  Install "prometheus-lab" snap from file "prometheus-lab_2.2.1_armhf.snap"
11   Done    2018-04-28T17:42:19Z  2018-04-28T17:42:19Z  Running service command
12   Done    2018-04-28T17:43:25Z  2018-04-28T17:43:44Z  Install "prometheus-lab" snap from file "prometheus-lab_2.2.1_armhf.snap"
13   Error   2018-04-28T18:05:59Z  2018-04-28T18:06:57Z  Install "prometheus-lab" snap from file "prometheus-lab_2.2.1_armhf.snap"
14   Done    2018-04-28T18:08:32Z  2018-04-28T18:08:33Z  Running service command
15   Done    2018-04-28T18:10:12Z  2018-04-28T18:10:23Z  Remove "prometheus-lab" snap
16   Error   2018-04-28T18:10:36Z  2018-04-28T18:11:12Z  Install "prometheus-lab" snap from file "prometheus-lab_2.2.1_armhf.snap"
17   Done    2018-04-28T18:15:25Z  2018-04-28T18:15:56Z  Install "prometheus-lab" snap from file "prometheus-lab_2.2.1_armhf.snap"
18   Done    2018-04-28T18:17:57Z  2018-04-28T18:18:31Z  Install "prometheus-lab" snap from file "prometheus-lab_2.2.1_armhf.snap"
19   Done    2018-04-28T18:24:15Z  2018-04-28T18:24:55Z  Install "prometheus-lab" snap from file "prometheus-lab_2.2.1_armhf.snap"
20   Done    2018-04-28T18:28:37Z  2018-04-28T18:29:09Z  Install "prometheus-lab" snap from file "prometheus-lab_2.2.1_armhf.snap"
21   Done    2018-04-28T19:06:03Z  2018-04-28T19:06:48Z  Install "prometheus-lab" snap from file "prometheus-lab_2.2.1_armhf.snap"
22   Done    2018-04-29T08:34:09Z  2018-04-29T08:34:45Z  Install "prometheus-lab" snap from file "prometheus-lab_2.2.1_armhf.snap"
23   Done    2018-04-29T09:03:11Z  2018-04-29T09:03:28Z  Remove "prometheus-lab" snap
24   Done    2018-04-29T09:04:38Z  2018-04-29T09:05:36Z  Install "prometheus-lab" snap from "edge" channel
25   Done    2018-04-29T09:08:40Z  2018-04-29T09:08:42Z  Running service command
26   Done    2018-04-29T16:50:44Z  2018-04-29T16:50:45Z  Running service command
27   Done    2018-04-29T16:54:03Z  2018-04-29T16:54:03Z  Refresh all snaps: no updates

I did install this package from a locally built .snap file initially. Is there any way to do a “hard reset” so to speak? I’ve already tried running a regular uninstall.

well, there is nothing interesting in it … but the missing symlink definitely points to some issue with snapd not mangaing the core snap correctly …