I can't create a snap on Ubuntu

29 Views Asked by At

Sorry for my bad english. I'm trying to create a snap package on Ubuntu 23.10 from the binary file of one of my applications that I developed. To do this, following the guide on Ubuntu, I create a lamiavideoteca/usr/bin folder in which I put my executable, while I put the libraries necessary for the software to function inside lamiavideoteca/usr/lib. I compile the snapcraft.yaml file like this:

name: lamiavideoteca
base: core22
version: "2.40"
summary: Program for cataloging Films
description: Program that allows you to catalog your collection of Films and/or Video/Audio.
grade: stable
confinement: strict

apps:
   lamiavideoteca:
     command: MyVideo Library

parts:
   lamiavideoteca:
     plugin: dump
     source: .
     organize:
       bin/: usr/bin/
       lib/: usr/lib/

I start the compilation with the snapcraft command but it fails.

I would like to point out that the libraries are all there as I did some operational tests on a virtual machine on which I installed a clean version of Ubuntu.

I get a log file like this (I can't put it all in, it's too long):

2024-03-23 14:08:23.511 :: 2024-03-23 14:08:23.066 pack_snap: output=None, compression='xz'
2024-03-23 14:08:23.511 :: 2024-03-23 14:08:23.066 pack_snap: check skeleton
2024-03-23 14:08:23.511 :: 2024-03-23 14:08:23.084 Creating snap package...
2024-03-23 14:08:23.511 :: 2024-03-23 14:08:23.084 Pack command: ['snap', 'pack', '--filename', 'lamiavideoteca_2.40_amd64.snap', '--compression', 'xz', PosixPath('/root/prime'), PosixPath('/root/project')]
2024-03-23 14:08:23.511 :: 2024-03-23 14:08:23.099 Command '['snap', 'pack', '--filename', 'lamiavideoteca_2.40_amd64.snap', '--compression', 'xz', PosixPath('/root/prime'), PosixPath('/root/project')]' returned non-zero exit status 1.
2024-03-23 14:08:23.511 :: 2024-03-23 14:08:23.100 Detailed information: 2024/03/23 14:08:23.098647 container.go:215: in snap "lamiavideoteca": path "LaMiaVideoteca" does not exist
2024-03-23 14:08:23.511 :: error: cannot pack "/root/prime": snap is unusable due to missing files
2024-03-23 14:08:23.511 :: 2024-03-23 14:08:23.102 Traceback (most recent call last):
2024-03-23 14:08:23.511 :: 2024-03-23 14:08:23.102   File "/snap/snapcraft/11040/lib/python3.10/site-packages/snapcraft/pack.py", line 137, in pack_snap
2024-03-23 14:08:23.511 :: 2024-03-23 14:08:23.102     proc = subprocess.run(
2024-03-23 14:08:23.511 :: 2024-03-23 14:08:23.102   File "/snap/snapcraft/11040/usr/lib/python3.10/subprocess.py", line 526, in run
2024-03-23 14:08:23.511 :: 2024-03-23 14:08:23.102     raise CalledProcessError(retcode, process.args,
2024-03-23 14:08:23.511 :: 2024-03-23 14:08:23.102 subprocess.CalledProcessError: Command '['snap', 'pack', '--filename', 'lamiavideoteca_2.40_amd64.snap', '--compression', 'xz', PosixPath('/root/prime'), PosixPath('/root/project')]' returned non-zero exit status 1.
2024-03-23 14:08:23.512 Executing on host: lxc --project snapcraft config device show local:snapcraft-lamiavideoteca-on-amd64-for-amd64-1008412
2024-03-23 14:08:23.582 Executing on host: lxc --project snapcraft config device remove local:snapcraft-lamiavideoteca-on-amd64-for-amd64-1008412 disk-/root/project
2024-03-23 14:08:23.684 Executing on host: lxc --project snapcraft stop local:snapcraft-lamiavideoteca-on-amd64-for-amd64-1008412
2024-03-23 14:08:27.857 Failed to execute pack in instance.
2024-03-23 14:08:27.858 Traceback (most recent call last):
2024-03-23 14:08:27.858   File "/snap/snapcraft/11040/lib/python3.10/site-packages/snapcraft/parts/lifecycle.py", line 482, in _run_in_provider
2024-03-23 14:08:27.858     instance.execute_run(cmd, check=True, cwd=output_dir)
2024-03-23 14:08:27.858   File "/snap/snapcraft/11040/lib/python3.10/site-packages/craft_providers/lxd/lxd_instance.py", line 293, in execute_run
2024-03-23 14:08:27.858     return self.lxc.exec(
2024-03-23 14:08:27.858   File "/snap/snapcraft/11040/lib/python3.10/site-packages/craft_providers/lxd/lxc.py", line 387, in exec
2024-03-23 14:08:27.858     return runner(final_cmd, timeout=timeout, check=check, **kwargs)
2024-03-23 14:08:27.858   File "/snap/snapcraft/11040/usr/lib/python3.10/subprocess.py", line 526, in run
2024-03-23 14:08:27.858     raise CalledProcessError(retcode, process.args,
2024-03-23 14:08:27.858 subprocess.CalledProcessError: Command '['lxc', '--project', 'snapcraft', 'exec', 'local:snapcraft-lamiavideoteca-on-amd64-for-amd64-1008412', '--cwd', '/root/project', '--', 'env', 'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin', 'SNAPCRAFT_MANAGED_MODE=1', 'DEBIAN_FRONTEND=noninteractive', 'DEBCONF_NONINTERACTIVE_SEEN=true', 'DEBIAN_PRIORITY=critical', 'snapcraft', 'pack', '--verbosity=brief', '--build-for', 'amd64']' returned non-zero exit status 1.
2024-03-23 14:08:27.858 Recommended resolution: Run the same command again with --debug to shell into the environment if you wish to introspect this failure.
2024-03-23 14:08:27.858 Full execution log: '/root/.local/state/snapcraft/log/snapcraft-20240323-140803.154662.log'

I looked in the Ubuntu guide. I tried creating /root/prime and /root/project folder. But I can't figure it out. This is the first time I've attempted to create a snap. I know how to create debs and AppImages and I would like to be able to create snap packages.

0

There are 0 best solutions below