"The following command failed to run: 'snap ack /run/core_5145.assert' exited with 1" on Debian

Hi,

I’m trying to use snapcraft on Debian sid. Following https://docs.snapcraft.io/build-snaps/get-started-snapcraft, I run “snapcraft cleanbuild” and got this error:

(snip)
Pushing /var/lib/snapd/hostfs/home/mhatta/snap/lxd/common/snapcraftruiy9nm_/core Adding assertion core_5145.assert
error: cannot assert: cannot communicate with server: Post http://localhost/v2/assertions: dial unix /run/snapd.socket: connect: connection refused
Stopping local:snapcraft-propitiatingly-phytosuccivorous-brinda
The following command failed to run: ‘snap ack /run/core_5145.assert’ exited with 1

I’m a newbie of Snap ecosystem, so at a loss. Where should I start to figure this out?

Hi Mhatta,
I had the same issue running with KALI Linux on a Raspberry PI. After some research I realized that this issue was related with the fact that the default LXD profile is running containers unpriveledge.
I Set the object “security.privileged” to true and this issue was solved (used this command: “lxc config profile set default security.privileged false” .
However, i run into another issue. The container created when running “snapcraft cleanbuild” could not reload udev rules. After some research, i build a bash script to work arround this new issue. Here is my bash shell script:

#######################################
Color_Off=’\033[0m’ # Text Reset

Regular Colors

Black=’\033[0;30m’ # Black
Red=’\033[0;31m’ # Red
Green=’\033[0;32m’ # Green
Yellow=’\033[0;33m’ # Yellow
Blue=’\033[0;34m’ # Blue
Purple=’\033[0;35m’ # Purple
Cyan=’\033[0;36m’ # Cyan
White=’\033[0;37m’ # White

Bold

BBlack=’\033[1;30m’ # Black
BRed=’\033[1;31m’ # Red
BGreen=’\033[1;32m’ # Green
BYellow=’\033[1;33m’ # Yellow
BBlue=’\033[1;34m’ # Blue
BPurple=’\033[1;35m’ # Purple
BCyan=’\033[1;36m’ # Cyan
BWhite=’\033[1;37m’ # White

Background

On_Black=’\033[40m’ # Black
On_Red=’\033[41m’ # Red
On_Green=’\033[42m’ # Green
On_Yellow=’\033[43m’ # Yellow
On_Blue=’\033[44m’ # Blue
On_Purple=’\033[45m’ # Purple
On_Cyan=’\033[46m’ # Cyan
On_White=’\033[47m’ # White

SNAPPY_PROJECTS=/home/$USER

if [ -z “$1” ]; then
echo -e “${BRed}Error: ${Yellow}1 Argument missing. Snap project folder is mandatory. $Color_Off”
exit
fi

PROJECT_FOLDER=$1

echo -e “$Cyan”
echo -e “-------------------------------------------------”
echo -e “”
echo -e " Building ${Yellow}$PROJECT_FOLDER $Cyan"
echo -e " Snappy Projects Home: ${Yellow}$SNAPPY_PROJECTS $Cyan"
echo -e “”
echo -e “------------------------------------------------- $Color_Off”

echo -e “${BYellow}Start snaping… $Color_Off”
lxc launch ubuntu:16.04 snapcraft -c security.privileged=true &&
#lxc config profile set default security.privileged true
lxc config device add snapcraft homedir disk source=$SNAPPY_PROJECTS path=/home/ubuntu &&
echo -e “${Yellow}Please wait while container is starting. This action can take 1 or 2 minutes. $Color_Off”
sleep 20
lxc exec snapcraft – snap install snapcraft --classic >/dev/null 2>&1
echo -e “${Yellow}Installing and configuring tools … $Color_Off”
lxc exec snapcraft – snap install snapcraft --classic &&
lxc exec snapcraft – sh -c “cd /home/ubuntu/$PROJECT_FOLDER; snapcraft” &&
echo -e “${Yellow}Cleaning lxd… $Color_Off”
lxc stop snapcraft &&
lxc delete snapcraft &&
echo -e “${BYellow}Done! $Color_Off”

########################################