tried to ssh in but apart from realising that I am root and do not require the “sudo”, I have managed to apt install docker and snapd, but have been unable to launch “snap” for the installation of snapcraft, and also any possible docker commands
Edit: Included errors ourput from my job:
/bin/bash: snapcraft: command not found
Exited with code 127
Error output from SSH:
root@365c6f:~ apt install snapd
Reading package lists... Done
Building dependency tree
Reading state information... Done
snapd is already the newest version (2.21-2+b1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@365c:6f~ snap install snapcraft
2018/08/30 12:47:29.86 main.go:220: WARNING: cannot create syslog logger
error: cannot communicate with server: Post http://localhost/v2/snaps/snapcraft: dial unix /run/snapd-snap.socket: connect: no such file or directory
We’re getting there! (Friendly tip: errors and log files should be in the first post).
Is the binary snapcraft a different installation to the snapd? I wonder if it’s worth SSHing into the server and using apt-cache search for a bit to see what other things are available for install.
The edit is fine, but I perhaps could have been clearer with my point. I mean that errors are the most important thing readers need to know, and they should be put in the first post when you make the first post, rather than adding it in post 7 after several rounds of questions
Don’t worry about it too much though - learning how to ask questions is a learning curve in itself!
Thanks!!
I have tried a clean docker instance on my laptop to build the snap based on the instructions from my original post, it works. I tried SSH-ing in again after that. The issue I am facing with the instance in CircleCI is that I dont have a docker executable after “apt install docker”.
Turns out, CircleCI wasnt getting my latest commits. Not sure why. So I redid the setup and with the instructions from the same blog post, I got more things working. I run into this error now after the priming stage.
Sorry, Snapcraft ran into an error when trying to running through its lifecycle that generated a trace that has been put in '/tmp/tmpnuapz_10/trace.txt'.
You need an SSH session in CircleCI to examine this log file
Snapcraft is running its own Docker inside your Docker container, and you need to look into that (exited) container to find the log file
I wonder if it is worth trying to get Snapcraft working on your local machine first, to get an understanding of how it works. I haven’t used it, but I wonder if it is not a trivial undertaking, and is going to be a a bit of a battle if you are new to CI or Linux.
You could try a few more things in your CircleCI machine via SSH, but this eats build minutes, which is worth bearing in mind if you are on the free tier.
Yea, the snapcraft runs well on my local machine, which led me to thinking it was my circleci configuration. But now, maybe it’s a snapcraft issue. I’ll head over to the snapcraft forums to see if someone could help.
I’ll heed your advice and run it in a Docker or LXC first before going anywhere else. Thanks alot for your help!