When the directory in which I run snapcraft has changed compared to the directory in which snapcraft ran the first time, snapcraft.yaml can’t be found.
$ snap version snap 2.42.4 snapd 2.42.4 series 16 ubuntu 18.04 kernel 4.15.0-70-generic $ snapcraft version snapcraft, version 3.9.3 $ snap list | grep snap snapcraft 3.9.3 3792 beta canonical* classic snapd 2.42.4 5643 beta canonical* snapd snappy-debug 0.34-snapd2.39.3+git 414 stable canonical* - $ snapcraft snap --use-lxd The LXD provider is offered as a technology preview for early adopters. The command line interface, container names or lifecycle handling may change in upcoming releases. Launching a container. /snap/snapcraft/3792/lib/python3.6/site-packages/pylxd/models/_model.py:116: UserWarning: Attempted to set unknown attribute "type" on instance of "Container" key, self.__class__.__name__ Waiting for cloud-init ................................................ status: done Could not find snap/snapcraft.yaml. Are you sure you are in the right directory? To start a new project, use `snapcraft init` Run the same command again with --debug to shell into the environment if you wish to introspect this failure. An error occurred when trying to execute 'snapcraft snap' with 'LXD': returned exit code 2. $ lxc config show snapcraft-bitcoind | grep -B2 source: snapcraft-project: path: /root/project source: /root/provision.KFH0uCA8k2/snap-bitcoind $ pwd /root/provision.zv8zgbMFW9/snap-bitcoind
I tar+cz+ssh my snap directory over to my build machine in a different directory every time i run my deployment command.
I tried updating the device ‘source’ key to match the new directory where I’m located when running the snapcraft command on the remote machine, to see if it helps:
$ lxc config device set snapcraft-bitcoind snapcraft-project source=/root/provision.zv8zgbMFW9/snap-bitcoind
But I still get the same error. So I’m confused.