Build kernel fail using snapcraft after some days

i have built kernel successful using snapcraft before. but today when i rebuild it , it block at priming kernel and report :

Priming kernel
Sorry, an error occurred in Snapcraft:
Traceback (most recent call last):
File “/usr/bin/snapcraft”, line 9, in
load_entry_point(‘snapcraft==2.43.1’, ‘console_scripts’, ‘snapcraft’)()
File “/usr/lib/python3/dist-packages/click/”, line 716, in call
return self.main(*args, **kwargs)
File “/usr/lib/python3/dist-packages/click/”, line 696, in main
rv = self.invoke(ctx)
File “/usr/lib/python3/dist-packages/click/”, line 1037, in invoke
return Command.invoke(self, ctx)
File “/usr/lib/python3/dist-packages/click/”, line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/lib/python3/dist-packages/click/”, line 534, in invoke
return callback(*args, **kwargs)
File “/usr/lib/python3/dist-packages/click/”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/usr/lib/python3/dist-packages/snapcraft/cli/”, line 93, in run
File “/usr/lib/python3/dist-packages/click/”, line 552, in forward
return self.invoke(cmd, **kwargs)
File “/usr/lib/python3/dist-packages/click/”, line 534, in invoke
return callback(*args, **kwargs)
File “/usr/lib/python3/dist-packages/snapcraft/cli/”, line 136, in snap
project = _execute(steps.PRIME, parts=[], **kwargs)
File “/usr/lib/python3/dist-packages/snapcraft/cli/”, line 35, in _execute
lifecycle.execute(step, project_config, parts)
File “/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle/”, line 90, in execute, part_names)
File “/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle/”, line 194, in run
self._handle_step(part_names, part, step, current_step, cli_config)
File “/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle/”, line 208, in _handle_step
getattr(self, “run{}”.format(
File “/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle/”, line 283, in _run_prime
self._run_step(step=steps.PRIME, part=part, progress=“Priming”)
File “/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle/”, line 327, in _run_step
File “/usr/lib/python3/dist-packages/snapcraft/internal/pluginhandler/”, line 737, in prime
File “/usr/lib/python3/dist-packages/snapcraft/internal/pluginhandler/”, line 116, in prime
“override-prime”, self._override_prime_scriptlet, self._primedir
File “/usr/lib/python3/dist-packages/snapcraft/internal/pluginhandler/”, line 162, in _run_scriptlet
scriptlet_name, function_call.strip()
File “/usr/lib/python3/dist-packages/snapcraft/internal/pluginhandler/”, line 218, in _handle_builtin_function
File “/usr/lib/python3/dist-packages/snapcraft/internal/pluginhandler/”, line 746, in _do_prime
_migrate_files(snap_files, snap_dirs, self.stagedir, self.primedir)
File “/usr/lib/python3/dist-packages/snapcraft/internal/pluginhandler/”, line 1055, in _migrate_files
snapcraft.file_utils.create_similar_directory(src, dst)
File “/usr/lib/python3/dist-packages/snapcraft/”, line 268, in create_similar_directory
os.makedirs(destination, exist_ok=True)
File “/usr/lib/python3.5/”, line 241, in makedirs
mkdir(name, mode)
We would appreciate it if you created a bug report at with the above text included.

and i notice that the version of snapcraft seem change to 3.1 instead of 2.4.1.
How can i make it work again? Thanks!

did you by chance not run snapcraft clean before building ?

Yes…always…just build kernel and move the image and dtb to prime folder to save time.
but i run snapcraft clean kernel -s build, it still report error…
should i run snapcraft clean for a complete building?