Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

west init access denied on windows #684

Closed
lovettchris opened this issue Sep 8, 2023 · 2 comments
Closed

west init access denied on windows #684

lovettchris opened this issue Sep 8, 2023 · 2 comments

Comments

@lovettchris
Copy link

lovettchris commented Sep 8, 2023

Repro:

  1. pip install west (gave me west version 1.1.0, I'm using Python 3.10)
  2. git clone https://github.com/nrfconnect/sdk-nrf.git
  3. cd sdk-nrf
  4. west init
  5. west update

Actual:

=== Initializing in F:\git\nordic\sdk-nrf
--- Cloning manifest repository from https://github.com/zephyrproject-rtos/zephyr
Cloning into 'F:\git\nordic\sdk-nrf.west\manifest-tmp'...
remote: Enumerating objects: 919248, done.
remote: Counting objects: 100% (2/2), done.
remote: Total 919248 (delta 1), reused 1 (delta 1), pack-reused 919246
Receiving objects: 100% (919248/919248), 590.38 MiB | 12.22 MiB/s, done.
Resolving deltas: 100% (698100/698100), done.
Updating files: 100% (28988/28988), done.
Traceback (most recent call last):
File "F:\miniconda3\envs\sr\lib\shutil.py", line 816, in move
os.rename(src, real_dst)
PermissionError: [WinError 5] Access is denied: 'F:\git\nordic\sdk-nrf\.west\manifest-tmp' -> 'F:\git\nordic\sdk-nrf\zephyr\manifest-tmp'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "F:\miniconda3\envs\sr\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "F:\miniconda3\envs\sr\lib\runpy.py", line 86, in run_code
exec(code, run_globals)
File "F:\miniconda3\envs\sr\Scripts\west.exe_main
.py", line 7, in
File "F:\miniconda3\envs\sr\lib\site-packages\west\app\main.py", line 1085, in main
app.run(argv or sys.argv[1:])
File "F:\miniconda3\envs\sr\lib\site-packages\west\app\main.py", line 244, in run
self.run_command(argv, early_args)
File "F:\miniconda3\envs\sr\lib\site-packages\west\app\main.py", line 503, in run_command
self.run_builtin(args, unknown)
File "F:\miniconda3\envs\sr\lib\site-packages\west\app\main.py", line 611, in run_builtin
self.cmd.run(args, unknown, self.topdir,
File "F:\miniconda3\envs\sr\lib\site-packages\west\commands.py", line 194, in run
self.do_run(args, unknown)
File "F:\miniconda3\envs\sr\lib\site-packages\west\app\project.py", line 224, in do_run
topdir = self.bootstrap(args)
File "F:\miniconda3\envs\sr\lib\site-packages\west\app\project.py", line 330, in bootstrap
shutil.move(os.fspath(tempdir), os.fspath(manifest_abspath))
File "F:\miniconda3\envs\sr\lib\shutil.py", line 834, in move
rmtree(src)
File "F:\miniconda3\envs\sr\lib\shutil.py", line 750, in rmtree
return _rmtree_unsafe(path, onerror)
File "F:\miniconda3\envs\sr\lib\shutil.py", line 615, in _rmtree_unsafe
_rmtree_unsafe(fullname, onerror)
File "F:\miniconda3\envs\sr\lib\shutil.py", line 615, in _rmtree_unsafe
_rmtree_unsafe(fullname, onerror)
File "F:\miniconda3\envs\sr\lib\shutil.py", line 615, in _rmtree_unsafe
_rmtree_unsafe(fullname, onerror)
File "F:\miniconda3\envs\sr\lib\shutil.py", line 620, in _rmtree_unsafe
onerror(os.unlink, fullname, sys.exc_info())
File "F:\miniconda3\envs\sr\lib\shutil.py", line 618, in _rmtree_unsafe
os.unlink(fullname)
PermissionError: [WinError 5] Access is denied: 'F:\git\nordic\sdk-nrf\.west\manifest-tmp\.git\objects\pack\pack-409852465dd22b365374e95e4d0eedb41d6856bf.idx'

If I create the "ncs" folder manually it works, but then "west update" fails:

(sr) F:\git\nordic\sdk-nrf>west update
Traceback (most recent call last):
File "F:\miniconda3\envs\sr\lib\site-packages\west\manifest.py", line 1874, in _top_level_init
current_data = current_abspath.read_text(encoding='utf-8')
File "F:\miniconda3\envs\sr\lib\pathlib.py", line 1134, in read_text
with self.open(mode='r', encoding=encoding, errors=errors) as f:
File "F:\miniconda3\envs\sr\lib\pathlib.py", line 1119, in open
return self._accessor.open(self, mode, buffering, encoding, errors,
FileNotFoundError: [Errno 2] No such file or directory: 'F:\git\nordic\sdk-nrf\zephyr\west.yml'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "F:\miniconda3\envs\sr\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "F:\miniconda3\envs\sr\lib\runpy.py", line 86, in run_code
exec(code, run_globals)
File "F:\miniconda3\envs\sr\Scripts\west.exe_main
.py", line 7, in
File "F:\miniconda3\envs\sr\lib\site-packages\west\app\main.py", line 1085, in main
app.run(argv or sys.argv[1:])
File "F:\miniconda3\envs\sr\lib\site-packages\west\app\main.py", line 244, in run
self.run_command(argv, early_args)
File "F:\miniconda3\envs\sr\lib\site-packages\west\app\main.py", line 503, in run_command
self.run_builtin(args, unknown)
File "F:\miniconda3\envs\sr\lib\site-packages\west\app\main.py", line 611, in run_builtin
self.cmd.run(args, unknown, self.topdir,
File "F:\miniconda3\envs\sr\lib\site-packages\west\commands.py", line 194, in run
self.do_run(args, unknown)
File "F:\miniconda3\envs\sr\lib\site-packages\west\app\project.py", line 944, in do_run
self.update_all()
File "F:\miniconda3\envs\sr\lib\site-packages\west\app\project.py", line 996, in update_all
self.manifest = Manifest.from_file(
File "F:\miniconda3\envs\sr\lib\site-packages\west\manifest.py", line 1263, in from_file
return Manifest(topdir=topdir, config=config,
File "F:\miniconda3\envs\sr\lib\site-packages\west\manifest.py", line 1468, in init
self._ctx = self._top_level_init(source_data,
File "F:\miniconda3\envs\sr\lib\site-packages\west\manifest.py", line 1876, in _top_level_init
raise MalformedConfig(
west.configuration.MalformedConfig: file not found: manifest file F:\git\nordic\sdk-nrf\zephyr\west.yml (from configuration options manifest.path="zephyr", manifest.file="west.yml")

@marc-hb
Copy link
Collaborator

marc-hb commented Sep 8, 2023

  1. west init

You meant west init -l ., not west init. See west help init.

Thanks to #676, the next west version will show an error message much shorter and a bit less confusing: FATAL ERROR: target directory already exists

@lovettchris
Copy link
Author

ok, thanks, yeah better errors are always good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants