-
Notifications
You must be signed in to change notification settings - Fork 127
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 completes but leaves everything in zephyr/manifest-tmp #558
Comments
Can you remember any error message, even vaguely? Going forward, can you use |
There is no error message until I run update as the init command doesn't fail, it just leaves everything in the wrong place. I'll try the new command. |
It could fail without a visible error message. It's extremely rare with |
Running |
|
Hi everyone, I have same problem when run
|
Can you reproduce every time? If yes then please follow the instructions above. |
yes, it can reproduce. you mean use |
I think he's asking you to post what it says when you do. |
This is all display when you did, it relates permission access folder when run os.rename
|
What happens if you try to rename this yourself from a command window?
Even stranger: is this imported from another manifest? This is not the same problem as originally reported in the description BTW |
|
I don't understand what you mean, sorry. It looks like you have edited the logs. This makes it hard to understand them since I cannot know for sure how the output comes from the input, or even if the output is accurate. Maybe you are using a private repository. I understand if you cannot share that. But do you maybe have some way to make a manifest you can share which reproduces the issue for you? That would be really helpful, thank you. |
yep. because some private information, i cannot post, so edited somethings in logs. but basically it is also same |
If you cannot reproduce with the open-source Zephyr manifest (did you try?), it means something in your manifest(s) is triggering the problem. To identify what triggers the issue, remove the private elements one by one until the problem disappears. Now you found what triggers the issue. Finally, to reproduce the issue without any confidential information, add something similar (and not confidential) to the open source manifest. Now you have a bug report that you can fully share and something in common we can all work on. |
With community source Zephyr, I have same problem. I try with other machines, some can work but some cannt
|
What happens when you try this after the failure:
Please also share the output of |
I tried delete that, but have access error although I grant permission
when run |
Thanks! Can you please try this and report any error?
|
here is result when I run that
|
Great, so now we know you don't have a west problem. I think you have a problem with your git client and/or the way Windows permissions are set up in your home directory. Can you try the same thing with a USB stick or just in a different directory? It seems normal for git to create read only pack files but somehow this is not a problem for most people. Windows permissions can be very complicated and I'm no expert https://www.ntfs.com/ntfs-permissions-file-effective.htm |
yes, I think too and I granted permissions, reinstall git with chocolatey many times. but it can not work |
I'm getting the same error invoking Full command is:
Here's the output.
Quite bizarre since For context, I was using |
Diff of the environment. Works in a stand alone cmd but not within VSCode 1d0
< !::=::\
3d1
< !ExitCode=00000000
9a8
> CHROME_CRASHPAD_PIPE_NAME=\\.\pipe\crashpad_9232_XCMYRGDVZKPZBDFN
24a24
> ORIGINAL_XDG_CURRENT_DESKTOP=undefined
26c26,27
< PATH=/cygdrive/c/Python39/Scripts:/cygdrive/c/Windows/system32:/cygdrive/c/Windows:/cygdrive/c/Windows/System32/Wbem:/cygdrive/c/Windows/System32/WindowsPowerShell/v1.0:/usr/bin:/cygdrive/c/Windows/System32/OpenSSH:/cygdrive/c/Program Files/Wireshark:/cygdrive/c/Program Files/PuTTY:/cygdrive/c/ProgramData/chocolatey/bin:/cygdrive/c/Program Files/Git/cmd:/cygdrive/c/bin:/cygdrive/c/Python39:/cygdrive/c/Program Files (x86)/Nordic Semiconductor/nrf-command-line-tools/bin:/cygdrive/c/Program Files (x86)/SEGGER/JLink:/cygdrive/c/Program Files (x86)/ZeroTier/One:/cygdrive/c/Program Files/Microsoft SQL Server/120/Tools/Binn:/cygdrive/c/Program Files/Microsoft SQL Server/Client SDK/ODBC/110/Tools/Binn:/cygdrive/c/Program Files (x86)/Microsoft SQL Server/120/Tools/Binn:/cygdrive/c/Program Files/Microsoft SQL Server/120/DTS/Binn:/cygdrive/c/Program Files (x86)/nodejs:/cygdrive/c/Users/Jared Wolff/AppData/Local/Microsoft/WindowsApps:/cygdrive/c/Users/Jared Wolff/AppData/Local/Programs/Microsoft VS Code/bin:/cygdrive/c/bin:/cygdrive/c/Python39:/cygdrive/c/Users/Jared Wolff/AppData/Roaming/npm
---
> PATH=/cygdrive/c/Python39/Scripts:/cygdrive/c/Windows/system32:/cygdrive/c/Windows:/cygdrive/c/Windows/System32/Wbem:/cygdrive/c/Windows/System32/WindowsPowerShell/v1.0:/usr/bin:/cygdrive/c/Windows/System32/OpenSSH:/cygdrive/c/Program Files/Wireshark:/cygdrive/c/Program Files/PuTTY:/cygdrive/c/ProgramData/chocolatey/bin:/cygdrive/c/Program Files/Git/cmd:/cygdrive/c/bin:/cygdrive/c/Python39:/cygdrive/c/Program Files (x86)/Nordic Semiconductor/nrf-command-line-tools/bin:/cygdrive/c/Program Files (x86)/SEGGER/JLink:/cygdrive/c/Program Files (x86)/ZeroTier/One:/cygdrive/c/Program Files/Microsoft SQL Server/120/Tools/Binn:/cygdrive/c/Program Files/Microsoft SQL Server/Client SDK/ODBC/110/Tools/Binn:/cygdrive/c/Program Files (x86)/Microsoft SQL
> Server/120/Tools/Binn:/cygdrive/c/Program Files/Microsoft SQL Server/120/DTS/Binn:/cygdrive/c/Program Files (x86)/nodejs:/cygdrive/c/Users/Jared Wolff/AppData/Local/Microsoft/WindowsApps:/cygdrive/c/Users/Jared Wolff/AppData/Local/Programs/Microsoft VS Code/bin:/cygdrive/c/bin:/cygdrive/c/Python39:/cygdrive/c/Users/Jared Wolff/AppData/Roaming/npm
49a51,59
> TERM_PROGRAM=vscode
> TERM_PROGRAM_VERSION=1.63.2
> LANG=en_US.UTF-8
> COLORTERM=truecolor
> VSCODE_GIT_IPC_HANDLE=\\.\pipe\vscode-git-35da2a6a1e-sock
> GIT_ASKPASS=c:\Users\Jared Wolff\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\git\dist\askpass.sh
> VSCODE_GIT_ASKPASS_NODE=C:\Users\Jared Wolff\AppData\Local\Programs\Microsoft VS Code\Code.exe
> VSCODE_GIT_ASKPASS_EXTRA_ARGS=--ms-enable-electron-run-as-node
> VSCODE_GIT_ASKPASS_MAIN=c:\Users\Jared Wolff\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\git\dist\askpass-main.js
|
The plot thickens. After lots of testing. I've narrowed it down to whether or not VSCode has the folder open. It appears to be scanning the files inside the When I close VSCode and run it in a terminal with same environment, it runs perfectly fine. Hope this helps people that may come across the same problem! |
@wbober @trond-snekvik I was thinking about the VS code extension and I wanted to let you know about this to see if you've ever observed random issues like this. Some of the above discussion looks like random permissions problems that unfortunately I have no idea how to triage right now, but this particular issue reported by @jaredwolff might be something you are running into more often. |
It would help if Windows could delete files in use like Linux filesystems can (it would also save a lot of Windows reboots, I digress) However similar issues could happen on Linux too: a few years ago, it came as a big surprise to me that some operations like "git diff" appear to be read-only but in fact they have some side effects because they can cause git to update some of its internal data: https://public-inbox.org/git/20160331140515.GA31116@sigill.intra.peff.net/ So, @mbolivar-nordic should west switch to some OS-dependent and "standard" /tmp locations to escape this sort of concurrency? Even if the interactions with IDEs ends up being harmless, it's not "nice" to confuse them. |
I thought about that, but then you're inviting issues with cross-filesystem moves, which are a can of worms of their own. If you have a strategy for accomplishing this ask, I'm open to ideas, though. |
OMG, I referenced something from 2016 but now you're bringing back memories from 2010!! How about |
My work around with this, from what I remember, was disabling the Git functionality in VSCode temporarily while |
I don't think this is the problem because
It really looks like something concurrent is holding a reference at the same time because this looks exactly like the (solved) issues with VS above... some unusual antivirus maybe? An unusual one because renaming directories would fail for all Windows users all the time otherwise... As already mentioned briefly before, a workaround:
|
@marc-hb, you may be right. Trying in an alternate path did not help. This is what I get: Updating files: 100% (38630/38630), done. I will try the workaround. Thank You. |
Or some backup program? Any background scanner really. Also, could you please make a backup of the following file, make the following change and try again: C:\zephyrproject.venv\Lib\site-packages\west\app\project.py @@ -339,6 +339,10 @@ finalize the deletion until there is no concurrent user left.
manifest_abspath = topdir / manifest_path
+ self.wrn("wait 5 minutes for any file scanner to complete")
+ import time
+ time.sleep(5 * 60)
+
self.dbg('moving', tempdir, 'to', manifest_abspath,
level=Verbosity.DBG_EXTREME)
|
@marc-hb , documenting for sake of completeness: cd zephyrproject Did not work since west does not work due to the above error. There is a method documented for installing zephyr without west in https://docs.zephyrproject.org/latest/develop/west/without-west.html However, it appears very complicated and unlikely to work since it has many dependencies that have to be manually kept track of. It appears to me that west is sine qua non for zephyr. |
Which error? Not the error discussed in this bug because that workaround completely avoids running the corresponding code and directory rename. You made me doubt so I just tested and made sure myself.
Agreed, almost everyone uses PS: did you try my other, "sleep" workaround? |
Side note: it is quite extraordinary that simply... renaming a directory fails on the "most popular OS". In fact, it is indeed "extraordinary" in the sense that the vast majority of Windows users do NOT experience this issue or extremely rarely. That's why I very strongly suspect the only cause to be some sort of background scanner. Kudos to @jaredwolff for root-causing this first. |
@marc-hb I tried the sleep patch. Unfortunately, it did not help. (There was a delay, so the sleep worked). This is the log: During handling of the above exception, another exception occurred: Traceback (most recent call last): (.venv) C:\Workspace> |
@marc-hb I looked in the directory: (.venv) C:\Workspace\zephyrproject>dir Directory of C:\Workspace\zephyrproject 10/18/2024 01:32 PM .10/18/2024 01:32 PM .. 10/18/2024 11:47 AM .venv 10/18/2024 01:24 PM .west 10/18/2024 01:27 PM zephyr And I see there are already a zephyr directory. Hence, File "C:\Python311\Lib\shutil.py", line 853, in move Should fail since there is already a zephyr directory. Should it not? |
Yes, that could well be the problem. I didn't expect to fail like that but why not. You really want to delete |
Actually, no: it shouldn't fail like that. There is a check for that in
Unless you want to help stress-test west error handling (thanks!), it's still best practice to clean up before starting again though. |
@marc-hb Based on https://stackoverflow.com/questions/26091530/permissionerror-winerror-5-access-is-denied-python-using-moviepy-to-write-gif I ran >west init zephyrproject as Administrator. However, the problem persists. |
@marc-hb Just observed that .west, .west > manifest-temp and zephyr are all marked Read-only in Windows File Explorer. Same with Zephyrproject too. Rename will fail on Read-only objects. |
Thanks, great find! So you have a problem with how permissions are configured on your You should set Zephyr and west aside temporarily and experiment with creating and moving directories and inspecting their permissions from your shell directly. Closing this again. BTW why don't you just use your home directory? |
@marc-hp, this seems to be a Windows10 peculiarity (creating Read-only files and folders). I checked and found on my machine, files in Downloads and Documents folders are not marked Read-only. |
@marc-hp Success! west init zephyrproject completes without error in Downloads folder. So, all the problems seem to be Windows 10 file/folder creation permission issues. |
This will be useful as both a diagnostic tool and as a workaround; see October 2024 comments in west issue zephyrproject-rtos#558 for examples and details. Signed-off-by: Marc Herbert <marc.herbert@intel.com>
In October 2024, a problem reported in zephyrproject-rtos#558 showed that some Windows systems can be configured to allow directory and file creations but not renames. Test this _before_ git cloning to "fail fast" and remove git from the very confusing picture. Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Thanks @BettaSharma for your efforts and the great communication! I just submitted some additional checks in #756 based on your experience; this should save time for others in the same situation. |
This will be useful as both a diagnostic tool and as a workaround; see October 2024 comments in west issue zephyrproject-rtos#558 for examples and details. Signed-off-by: Marc Herbert <marc.herbert@intel.com>
In October 2024, a problem reported in zephyrproject-rtos#558 showed that some Windows systems can be configured to allow directory and file creations but not renames. Test this _before_ git cloning to "fail fast" and remove git from the very confusing picture. Signed-off-by: Marc Herbert <marc.herbert@intel.com>
This will be useful as both a diagnostic tool and as a workaround; see October 2024 comments in west issue #558 for examples and details. Signed-off-by: Marc Herbert <marc.herbert@intel.com>
In October 2024, a problem reported in #558 showed that some Windows systems can be configured to allow directory and file creations but not renames. Test this _before_ git cloning to "fail fast" and remove git from the very confusing picture. Signed-off-by: Marc Herbert <marc.herbert@intel.com>
This will be useful as both a diagnostic tool and as a workaround; see October 2024 comments in west issue zephyrproject-rtos#558 for examples and details. Signed-off-by: Marc Herbert <marc.herbert@intel.com>
In October 2024, a problem reported in zephyrproject-rtos#558 showed that some Windows systems can be configured to allow directory and file creations but not renames. Test this _before_ git cloning to "fail fast" and remove git from the very confusing picture. Signed-off-by: Marc Herbert <marc.herbert@intel.com>
This will be useful as both a diagnostic tool and as a workaround; see October 2024 comments in west issue #558 for examples and details. Signed-off-by: Marc Herbert <marc.herbert@intel.com>
In October 2024, a problem reported in #558 showed that some Windows systems can be configured to allow directory and file creations but not renames. Test this _before_ git cloning to "fail fast" and remove git from the very confusing picture. Signed-off-by: Marc Herbert <marc.herbert@intel.com>
New west version 1.3 just released; it includes a @BettaSharma (and others when applicable), it would be great if you could upgrade and try again in the "wrong" folder (or in any condition that helps reproduce) and share how 1.3 now behaves. Thanks! |
I have no idea what causes this or how to reliably reproduce it, but running
west init
on windows occasionally leaves everything in thezephyr/manifest-tmp
folder upon "successful" completion.west update
subsequently fails because everything is in the wrong place.cc:
The text was updated successfully, but these errors were encountered: