So having solved the snap 777 problem (or rather worked around it).
I did another build but this time I’m getting a new file permission error:
Mounting /home/bsutton/git/tomcat-with-ssl-snap into container
Device /root/build_tomcat-with-ssl added to snapcraft-tomcat-with-ssl
Traceback (most recent call last):
File “/snap/snapcraft/1094/bin/snapcraft”, line 11, in
load_entry_point(‘snapcraft==2.39’, ‘console_scripts’, ‘snapcraft’)()
File “/snap/snapcraft/1094/usr/lib/python3.6/site-packages/pkg_resources/init.py”, line 565, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File “/snap/snapcraft/1094/usr/lib/python3.6/site-packages/pkg_resources/init.py”, line 2631, in load_entry_point
return ep.load()
File “/snap/snapcraft/1094/usr/lib/python3.6/site-packages/pkg_resources/init.py”, line 2291, in load
return self.resolve()
File “/snap/snapcraft/1094/usr/lib/python3.6/site-packages/pkg_resources/init.py”, line 2297, in resolve
module = import(self.module_name, fromlist=[‘name’], level=0)
File “/snap/snapcraft/1094/lib/python3.6/site-packages/snapcraft/cli/main.py”, line 43, in
run(prog_name=‘snapcraft’)
File “/snap/snapcraft/1094/lib/python3.6/site-packages/click/core.py”, line 722, in call
return self.main(*args, **kwargs)
File “/snap/snapcraft/1094/lib/python3.6/site-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/snap/snapcraft/1094/lib/python3.6/site-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/snap/snapcraft/1094/lib/python3.6/site-packages/click/core.py”, line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/snap/snapcraft/1094/lib/python3.6/site-packages/click/core.py”, line 535, in invoke
return callback(*args, **kwargs)
File “/snap/snapcraft/1094/lib/python3.6/site-packages/snapcraft/cli/lifecycle.py”, line 139, in snap
project_options, directory=directory, output=output)
File “/snap/snapcraft/1094/lib/python3.6/site-packages/snapcraft/internal/lifecycle/_packer.py”, line 46, in snap
execute(‘prime’, project_options)
File “/snap/snapcraft/1094/lib/python3.6/site-packages/snapcraft/internal/lifecycle/_runner.py”, line 79, in execute
_Executor(config, project_options).run(step, part_names)
File “/snap/snapcraft/1094/lib/python3.6/site-packages/snapcraft/internal/lifecycle/_runner.py”, line 185, in run
self._run_step(step, part, part_names)
File “/snap/snapcraft/1094/lib/python3.6/site-packages/snapcraft/internal/lifecycle/_runner.py”, line 215, in run_step
getattr(part, 'prepare{}’.format(step))()
File “/snap/snapcraft/1094/lib/python3.6/site-packages/snapcraft/internal/pluginhandler/init.py”, line 263, in prepare_pull
self.makedirs()
File “/snap/snapcraft/1094/lib/python3.6/site-packages/snapcraft/internal/pluginhandler/init.py”, line 144, in makedirs
os.makedirs(d, exist_ok=True)
File “/snap/snapcraft/1094/usr/lib/python3.6/os.py”, line 210, in makedirs
makedirs(head, mode, exist_ok)
File “/snap/snapcraft/1094/usr/lib/python3.6/os.py”, line 210, in makedirs
makedirs(head, mode, exist_ok)
File “/snap/snapcraft/1094/usr/lib/python3.6/os.py”, line 220, in makedirs
mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: ‘/root/build_tomcat-with-ssl/parts’
I tried setting the parts directory permissions to 777 (on the host) to get around this problem. However the error persisted:
ll /root
total 36
drwxrwxrwx 6 root root 4096 Feb 23 03:53 ./
drwxr-xr-x 24 root root 4096 Feb 23 01:21 …/
drwxrwxrwx 3 bsutton lxd 4096 Feb 23 03:53 build_tomcat-with-ssl/
drwxr-xr-x 4 root root 4096 Feb 23 03:12 snap/
ll /root/build_tomcat-with-ssl/
drwxrwxrwx 2 bsutton lxd 4096 Feb 23 03:53 parts/
ll /root/build_tomcat-with-ssl/parts/
drwxrwxrwx 2 bsutton lxd 4096 Feb 23 03:53 ./
drwxrwxrwx 3 bsutton lxd 4096 Feb 23 03:53 …/