cannot run west update if manifest does not belong to user
See original GitHub issueHello,
I’m using a container image with the tools to build a zephyr application from github action (https://github.com/SiemaApplications/zephyr-action/)
I use this action alongside actions/cache
.
I (recently) noticed that when running west update
(or other commands parsing the manifest) the command fails with the following message:
root@30c604986fc5:/src# west list
Traceback (most recent call last):
File "/usr/local/bin/west", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.8/dist-packages/west/app/main.py", line 786, in main
app.run(argv or sys.argv[1:])
File "/usr/local/lib/python3.8/dist-packages/west/app/main.py", line 109, in run
self.run_command(argv)
File "/usr/local/lib/python3.8/dist-packages/west/app/main.py", line 337, in run_command
self.handle_builtin_manifest_load_err(args)
File "/usr/local/lib/python3.8/dist-packages/west/app/main.py", line 195, in handle_builtin_manifest_load_err
p, f = self.mle.project, self.mle.filename
AttributeError: 'ManifestImportFailed' object has no attribute 'filename'
I tracked the issue, and here is what I found:
- does not happen with
West version: v0.12.0
- happens with
West version: v0.13.1
- happens if user running
west list
command does not own the manifest.
In my case, when running github action, the cache files (mainly west modules, including zephyr) restored belongs to docker user (id 1001), however in my container image I am running with the user root (id 0).
If i launch my container manually with -u $(id -u):$(id -g)
then everything belongs to the user running the west list
command and that works fine.
I don’t really know if this behavior is intended or not.
As far as I am concerned, I don’t really like the idea of having part of the files belonging to a user (docker) and another part belonging to another one (root) so I’ll run a pre-entrypoint
so the user running west from the container will own everything.
Best regards, Nicolas.
Issue Analytics
- State:
- Created a year ago
- Comments:10 (2 by maintainers)
No matter what,
west list
should definitely not be bombing out with an exception like that. We’ll need to fix that at least. I will need to think about the larger issue about ownership, though.This is looking good on my side, thanks.