"cannot locate core snap" error

This might be completely unrelated but I noticed in an older version of snapd in the AUR that there is a comment related to version info: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=snapd-confinement#n37

cherry picks in this commit: https://github.com/snapcore/snapd/commit/2840c2a37ef5adf50d93461920f3e2140617bd54

Has anyone managed to solve this error?
I am running version 2.25~14.04, the core installation is visible in /snap/core/2462/ but when I try to run any app (hello included) I keep getting infamous error: cannot locate the core snap: No such file or directory
Is there any environment variable that I might have to setup explicitly to point to the core?

Hey @snisioi,

Did you manage to solve the problem there? If not, can you provide some more details of what is happening there? Note that this error generally happens if there’s no /snap/core/current, which should definitely exist if the core was installed.

If nothing else works, I suggest removing the snapd pacakge and then reinstalling it.

Hey

Can you please try the updated Arch package that is available from the snapd release page

Using that package please try to run the application again.

Hello, first and foremost thank you for putting the time and effort to that ! Really appreciated :slight_smile: I am also a Manjaro user, following the stable repositories with the latest updates. I have a similar issues after installing the suggested package (note that now is looking for ubuntu-core instead or core):

$ snap --version
snap     2.27.5-1
snapd    2.27.5-1
series   16
manjaro  
kernel   4.9.48-1-MANJARO

$ systemctl status snapd
● snapd.service - Snappy daemon
   Loaded: loaded (/usr/lib/systemd/system/snapd.service; disabled; vendor preset: disabled)
   Active: active (running) since Sat 2017-09-09 20:37:36 EDT; 1min 6s ago
 Main PID: 2642 (snapd)
    Tasks: 9 (limit: 4915)
   CGroup: /system.slice/snapd.service
           └─2642 /usr/lib/snapd/snapd

Sep 09 20:37:35 laptop systemd[1]: Starting Snappy daemon...
Sep 09 20:37:36 laptop snapd[2642]: 2017/09/09 20:37:36.612407 daemon.go:252: started snapd/2.27.5-1 (series 16; cl
Sep 09 20:37:36 laptop systemd[1]: Started Snappy daemon.

$ ls -ld /{var/lib/snapd/snap},snap}/{core,ubuntu-core}/*
ls: cannot access '/var/lib/snapd/snap}/core/*': No such file or directory
ls: cannot access '/var/lib/snapd/snap}/ubuntu-core/*': No such file or directory
ls: cannot access '/snap/ubuntu-core/*': No such file or directory
drwxr-xr-x 24 root root 309 30.08.2017 02:32  /snap/core/2774/
lrwxrwxrwx  1 root root   4 06.09.2017 22:22  /snap/core/current -> 2774/

$ snap list
Name   Version    Rev   Developer  Notes
core   16-2.27.5  2774  canonical  core
hello  2.10       20    canonical  -

$ snap run hello
cannot locate the base snap: ubuntu-core: No such file or directory

Thinking about it with fresh eyes I suspect it is caused by the fact that arch moved away from /snap but this decision depends on the distribution identifier. It would seem we need to treat manjaro as a derivative of arch.

Can you please add /etc/os-release to https://github.com/zyga/os-release-zoo - I will prepare a patch for the Arch package that should support Manjaro correctly and give it to you to test.

Question about Manjaro: how can we get snapd into https://github.com/manjaro/packages-community – is it just a pull request? Are you an active developer that could work with us on co-maintenance?

That identifier logic needs to be inverted into a whitelist rather than being a blacklist. It’s too hard to maintain a blacklist sanely. That goes for re-exec and many other features that are enabled/disabled based on the identifier in /etc/os-release.

How is a whitelist easier or harder than a blacklist in this case?

Well, in itself, a whitelist implies where you know this works. You probably also need to support reading ID_LIKE to identify derivative distributions. Provided that we understand distribution families, we can handle this in a much less painful way.

There is no “where this works” place. The identifier tells us of an arbitrary distribution choice. No value is better than other value. The default is what is preferred upstream. I think this cannot be any better by making it a blacklist.

On the other hand we can be smarter and just look for /snap. I think that would be nicer here.

1 Like

Done !

Not sure about that. I guess a pull request will do it. I do not belong to the active developers of Manjaro but I am a long and regular user. Since I find snap packages so interesting I could help you on submitting packages to the Manjaro community repo.

1 Like

Yes, I would love the help. Let’s open a new thread for Manjaro specifically and not discuss this here.

1 Like

The thread is already started @zyga-snapd. And yes, I’m now on board to get this started.

1 Like