canonical / canonical/cloud-init
Permission denied: '/srv/citest' when running cloud tests locally
- Dominant language
- Python
- Stars
- 3.8k
- Forks
- 1.1k
- Avg merge
- 3d 8h
- Merged PRs (30d)
- 22
Description
This bug was originally filed in Launchpad as [LP: #1863792](https://bugs.launchpad.net/cloud-init/+bug/1863792)
Launchpad details
affected_projects = []
assignee = None
assignee_name = None
date_closed = None
date_created = 2020-02-18T18:15:40.400169+00:00
date_fix_committed = None
date_fix_released = None
id = 1863792
importance = wishlist
is_complete = False
lp_url = https://bugs.launchpad.net/cloud-init/+bug/1863792
milestone = None
owner = oddbloke
owner_name = Dan Watkins
private = False
status = triaged
submitter = oddbloke
submitter_name = Dan Watkins
tags = []
duplicates = []
_Launchpad user **Dan Watkins(oddbloke)** wrote on 2020-02-18T18:15:40.400169+00:00_
The default configuration should work for developers, and therefore shouldn't assume write access to a directory that is (a) outside of the cloud-init tree, and (b) generally requires root privs to create in the first place.
The specific error:
2020-02-18 18:11:21,652 - /home/daniel/dev/cloud-init/tests/cloud_tests/stage.py:run_stage:102 [ERROR]: stage: collect for platform: nocloud-kvm encountered error: [Errno 13] Permission denied: '/srv/citest'
2020-02-18 18:11:21,653 - /home/daniel/dev/cloud-init/tests/cloud_tests/stage.py:run_stage:104 [ERROR]: traceback:
File "/home/daniel/dev/cloud-init/tests/cloud_tests/stage.py", line 97, in run_stage
(call_res, call_failed) = call()
File "/home/daniel/dev/cloud-init/tests/cloud_tests/collect.py", line 169, in collect_image
with component as image:
File "/home/daniel/dev/cloud-init/tests/cloud_tests/stage.py", line 27, in __enter__
self.instance = self.get_func()
File "/home/daniel/dev/cloud-init/tests/cloud_tests/platforms/__init__.py", line 20, in get_image
return platform.get_image(config)
File "/home/daniel/dev/cloud-init/tests/cloud_tests/platforms/nocloudkvm/platform.py", line 53, in get_image
tmirror.sync(smirror, path)
File "/home/daniel/dev/cloud-init/.tox/citest/lib/python3.7/site-packages/simplestreams/mirrors/__init__.py", line 91, in sync
return self.sync_index(reader, path, data, content)
File "/home/daniel/dev/cloud-init/.tox/citest/lib/python3.7/site-packages/simplestreams/mirrors/__init__.py", line 254, in sync_index
self.sync(reader, path=epath)
File "/home/daniel/dev/cloud-init/.tox/citest/lib/python3.7/site-packages/simplestreams/mirrors/__init__.py", line 89, in sync
return self.sync_products(reader, path, data, content)
File "/home/daniel/dev/cloud-init/.tox/citest/lib/python3.7/site-packages/simplestreams/mirrors/__init__.py", line 405, in sync_products
self.insert_products(path, target, content)
File "/home/daniel/dev/cloud-init/.tox/citest/lib/python3.7/site-packages/simplestreams/mirrors/__init__.py", line 504, in insert_products
self.store.insert_content(dpath, util.dump_data(target))
File "/home/daniel/dev/cloud-init/.tox/citest/lib/python3.7/site-packages/simplestreams/objectstores/__init__.py", line 40, in insert_content
checksums=checksums, mutable=mutable)
File "/home/daniel/dev/cloud-init/.tox/citest/lib/python3.7/site-packages/simplestreams/objectstores/__init__.py", line 110, in insert
util.mkdir_p(out_d)
File "/home/daniel/dev/cloud-init/.tox/citest/lib/python3.7/site-packages/simplestreams/util.py", line 420, in mkdir_p
os.makedirs(path)
File "/home/daniel/dev/cloud-init/.tox/citest/lib/python3.7/os.py", line 211, in makedirs
makedirs(head, exist_ok=exist_ok)
File "/home/daniel/dev/cloud-init/.tox/citest/lib/python3.7/os.py", line 211, in makedirs
makedirs(head, exist_ok=exist_ok)
File "/home/daniel/dev/cloud-init/.tox/citest/lib/python3.7/os.py", line 221, in makedirs
mkdir(name, mode)
Contributor guide
Research direction
Start with tests/cloud_tests/platforms/nocloudkvm/platform.py:get_image and the cloud-test flow in tests/cloud_tests/stage.py and collect.py. Reproduce the local nocloud-kvm run, then trace where the default configuration selects /srv/citest. Done means the default setup no longer requires write access outside the cloud-init tree and the local cloud test proceeds without this permission error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100