Attempt to write a readonly database

When I run “sudo snapcraft cleanbuild”, the snap would be compiled for a decent while. For reasons unknown to me, it fails almost on the first step now, and I am unaware of having done anything that could have caused this. Nevertheless, I am getting the following message:

Creating snapcraft-merely-fast-raptor
    error: Failed container creation:
     - attempt to write a readonly database
    Traceback (most recent call last):
      File "/usr/bin/snapcraft", line 11, in <module>
        load_entry_point('snapcraft==2.34+17.10', 'console_scripts', 'snapcraft')()
      File "/usr/lib/python3/dist-packages/pkg_resources/", line 564, in load_entry_point
        return get_distribution(dist).load_entry_point(group, name)
      File "/usr/lib/python3/dist-packages/pkg_resources/", line 2662, in load_entry_point
        return ep.load()
      File "/usr/lib/python3/dist-packages/pkg_resources/", line 2316, in load
        return self.resolve()
      File "/usr/lib/python3/dist-packages/pkg_resources/", line 2322, in resolve
        module = __import__(self.module_name, fromlist=['__name__'], level=0)
      File "/usr/lib/python3/dist-packages/snapcraft/cli/", line 19, in <module>
      File "/usr/lib/python3/dist-packages/click/", line 722, in __call__
        return self.main(*args, **kwargs)
      File "/usr/lib/python3/dist-packages/click/", line 697, in main
        rv = self.invoke(ctx)
      File "/usr/lib/python3/dist-packages/click/", line 1066, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "/usr/lib/python3/dist-packages/click/", line 895, in invoke
        return ctx.invoke(self.callback, **ctx.params)
      File "/usr/lib/python3/dist-packages/click/", line 535, in invoke
        return callback(*args, **kwargs)
      File "/usr/lib/python3/dist-packages/snapcraft/cli/", line 188, in cleanbuild
        lifecycle.cleanbuild(project_options, remote)
      File "/usr/lib/python3/dist-packages/snapcraft/internal/", line 326, in cleanbuild
        metadata=config.get_metadata(), remote=remote).execute()
      File "/usr/lib/python3/dist-packages/snapcraft/internal/", line 145, in execute
        with self._ensure_started():
      File "/usr/lib/python3.6/", line 81, in __enter__
        return next(self.gen)
      File "/usr/lib/python3/dist-packages/snapcraft/internal/", line 129, in _ensure_started
      File "/usr/lib/python3/dist-packages/snapcraft/internal/", line 117, in _ensure_container
        'lxc', 'launch', '-e', self._image, self._container_name])
      File "/usr/lib/python3.6/", line 291, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['lxc', 'launch', '-e', 'ubuntu:xenial/amd64', 'local:snapcraft-merely-fast-raptor']' returned non-zero exit status 1.

Does anybody know what could have happened to cause this and what an appropriate solution would be?

That’s a problem in LXD not Snapcraft. You’ll need to figure out whether you can launch LXC containers or not, and why not. The error was emitted while running:

lxc launch -e ubuntu:xenial/amd64 local:snapcraft-merely-fast-raptor
1 Like