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

error: fsmonitor--daemon failed to start (Unicode chars in workdir path) #3262

Closed
1 task done
hslee2008 opened this issue Jun 9, 2021 · 23 comments · Fixed by #3309
Closed
1 task done

error: fsmonitor--daemon failed to start (Unicode chars in workdir path) #3262

hslee2008 opened this issue Jun 9, 2021 · 23 comments · Fixed by #3309
Labels
Milestone

Comments

@hslee2008
Copy link

hslee2008 commented Jun 9, 2021

  • I was not able to find an open or closed issue matching what I'm seeing

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
$ git --version --build-options

git version 2.32.0.windows.1
cpu: x86_64
built from commit: 4c204998d0e156d13d81abe1d1963051b1418fc0
sizeof-long: 4
sizeof-size_t: 8
shell-path: /bin/sh
feature: fsmonitor--daemon 
  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
$ cmd.exe /c ver

** Microsoft Windows [Version 10.0.19043.1023]**
  • What options did you set as part of the installation? Or did you choose the
    defaults?
# One of the following:
> type "C:\Program Files\Git\etc\install-options.txt"
> type "C:\Program Files (x86)\Git\etc\install-options.txt"
> type "%USERPROFILE%\AppData\Local\Programs\Git\etc\install-options.txt"
$ cat /etc/install-options.txt

** Editor Option: VisualStudioCode    
Custom Editor Path:
Default Branch Option:
Path Option: Cmd
SSH Option: OpenSSH
Tortoise Option: false
CURL Option: OpenSSL
CRLF Option: CRLFAlways
Bash Terminal Option: MinTTY       
Git Pull Behavior Option: Merge    
Use Credential Manager: Core       
Performance Tweaks FSCache: Enabled
Enable Symlinks: Disabled
Enable Pseudo Console Support: Enabled
Enable FSMonitor: Enabled **
  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

Nothing

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

** Bash and CMD**

git add --all
git add <filename>
git status
  • What did you expect to occur after running these commands?

I expected them to work like add files, committing, and more.

  • What actually happened instead?

It returned an error: fsmonitor--daemon failed to start

@hslee2008
Copy link
Author

I redownloaded git and it seems like the option "Add a Git Bash Profile to Windows Terminal" is the problem

@dscho
Copy link
Member

dscho commented Jun 9, 2021

I redownloaded git and it seems like the option "Add a Git Bash Profile to Windows Terminal" is the problem

Thank you for your report.

Just to clarify: you reinstalled Git for Windows, left "Add a Git Bash Profile to Windows Terminal" unchecked and now it works?

@hslee2008
Copy link
Author

It worked fine when the option "add a git bash profile to windows terminal: was left unchecked.

@dscho
Copy link
Member

dscho commented Jun 10, 2021

It worked fine when the option "add a git bash profile to windows terminal: was left unchecked.

Hmm. This is really strange. The only thing that does is to write an XML somewhere, I believe. It should not influence the built-in file system watcher.

Could you try once more, to make sure that it was that checkbox?

@dscho
Copy link
Member

dscho commented Jun 15, 2021

It worked fine when the option "add a git bash profile to windows terminal: was left unchecked.

Hmm. This is really strange. The only thing that does is to write an XML somewhere, I believe. It should not influence the built-in file system watcher.

Could you try once more, to make sure that it was that checkbox?

Could you?

@dscho dscho closed this as completed Jun 16, 2021
@lc6464
Copy link

lc6464 commented Jun 27, 2021

Translated by Google:

I encountered the same problem, Git displayed error: fsmonitor--daemon failed to start.
And no matter whether I check the checkbox added to Terminal, it doesn't work properly.
I use PowerShell and Git-Bash, and neither of them work properly.
When that check box is checked, Git-Bash is indeed added to the Terminal configuration, and it will indeed be deleted after it is closed.
But Git just doesn't work properly anyway.
This phenomenon will definitely reappear after Git is updated to 2.32.0.windows.1 [4c204998d0e156d13d81abe1d1963051b1418fc0].

Original:

我遇到了同样的问题,Git 显示 error: fsmonitor--daemon failed to start
而我无论是否勾选那个添加到 Terminal 的复选框,它都无法正常工作。
我使用的是 PowerShell 和 Git-Bash,都无法正常工作。
当那个复选框勾选后,Git-Bash 确实被加入了 Terminal 配置,关闭后也确实会被删除,
但无论如何 Git 就是无法正常工作。
此现象在 Git 更新至 2.32.0.windows.1 [4c204998d0e156d13d81abe1d1963051b1418fc0] 后必定复现。

@lc6464
Copy link

lc6464 commented Jun 27, 2021

I have to use git version 2.30.2.windows.1 [37f0a4afad027cf030747a1ef45537ba86162960].
My Windows version: 10.0.19043.1081
From 2.31.0 to the latest version has this problem.

@dscho
Copy link
Member

dscho commented Jun 28, 2021

Can you run git fsmonitor--daemon start manually, does that command succeed?

@hslee2008
Copy link
Author

The outcome is the same. It still says

error: fsmonitor--daemon failed to start

@hslee2008
Copy link
Author

Also, it seems like there is no 'e' for the word 'the' in the setup explanation for the 'Override the default branch name for new repositories'.

@dscho
Copy link
Member

dscho commented Jun 29, 2021

The outcome is the same. It still says

error: fsmonitor--daemon failed to start

I cannot reproduce this. Could you run this while Process Monitor is running and then investigate what the precise error is? It would be toward the end of that process' life time.

Also, it seems like there is no 'e' for the word 'the' in the setup explanation for the 'Override the default branch name for new repositories'.

I don't understand. Are you referring to this message? https://github.com/git-for-windows/build-extra/blob/995f6ac120c46ae506d633cd5c6e49c56e28ea5a/installer/install.iss#L2020

If so, please do open a Pull Request to fix the typo.

@dscho
Copy link
Member

dscho commented Jun 29, 2021

The outcome is the same. It still says
error: fsmonitor--daemon failed to start

I cannot reproduce this. Could you run this while Process Monitor is running and then investigate what the precise error is? It would be toward the end of that process' life time.

Before that, because it might give us better insights, could you run git fsmonitor--daemon start after setting GIT_TRACE2_PERF=perf.log and then seeing whether the generated perf.log file says anything obviously suspicious?

@hslee2008
Copy link
Author

I tried GIT_TRACE2_PERF=perf.log command, but I could not find the file perf.log

I also tried process monitor and when I run and I could not find any errors appearing on the screen of process monitor

@derrickstolee
Copy link

I tried GIT_TRACE2_PERF=perf.log command, but I could not find the file perf.log

You need to provide a fully-scoped path, such as GIT_TRACE2_PERF=/c/Users/<name>/perf.log.

@hslee2008
Copy link
Author

04:03:48.679480 usage.c:74 error could not initialize listener thread

@dscho
Copy link
Member

dscho commented Jul 2, 2021

could not initialize listener thread

This error message stems from here: https://github.com/git-for-windows/git/blob/v2.32.0.windows.1/builtin/fsmonitor--daemon.c#L1245

It means that something in the fsmonitor_fs_listen__ctor() function failed: https://github.com/git-for-windows/git/blob/v2.32.0.windows.1/compat/fsmonitor/fsmonitor-fs-listen-win32.c#L495-L537

The only two ways this can fail (at least that I can see) are if either the worktree or the git dir cannot be watched, i.e. that create_watch() fails somehow: https://github.com/git-for-windows/git/blob/v2.32.0.windows.1/compat/fsmonitor/fsmonitor-fs-listen-win32.c#L106-L136

The only way that can fail (again, as far as I can see) is if the file handle cannot be created: https://github.com/git-for-windows/git/blob/v2.32.0.windows.1/compat/fsmonitor/fsmonitor-fs-listen-win32.c#L115-L123

Now, I have a couple of observations there:

  • If create_watch() fails, it prints an error "could not watch". Did you see that, too? (It is not part of your reply.)
  • One thing that immediately jumps out to me is the call to CreateFileA(). We have had tons of encoding problems in the past, until we switched from the *A() Win32 API functions to the *W() ones.
  • Your handle name suggests that you might have non-ASCII characters in your path (either the worktree, the git directory, or most likely both). Is this correct? That could be the reason for this problem. And moving from CreateFileA() to CreateFileW() would potentially solve it.

@hslee2008
Copy link
Author

I tried git commands in paths without any non-ASCII characters and it worked. I think the problem is solved.

Do you have any way for users to work on trees with non-ASCII characters?

@y-k-m
Copy link

y-k-m commented Jul 5, 2021

I have the same problem.
fsmonitor--daemon doesn't seem to support multibyte characters.

@dscho I think, probably correct.

@dscho
Copy link
Member

dscho commented Jul 5, 2021

@HyunseungLee-Travis @y-k-m I just opened a Pull Request to fix this, and kicked off a git-artifacts run that will build an installer for you to verify the fix: https://github.com/dscho/git/actions/runs/1001013617. Please to test, once the artifacts are ready!

[EDIT] Please do test 😄

@dscho
Copy link
Member

dscho commented Jul 5, 2021

Please to test, once the artifacts are ready!

The artifacts are ready:

Please do test.

@y-k-m
Copy link

y-k-m commented Jul 6, 2021

@dscho It worked!
Thank you for fix, I'm looking forward to being merge!

current stable:
image

new build:
image

@dscho
Copy link
Member

dscho commented Jul 6, 2021

@y-k-m Awesome, thank you for testing and sharing the results here!

@dscho dscho added this to the Next release milestone Jul 6, 2021
dscho added a commit to git-for-windows/build-extra that referenced this issue Jul 6, 2021
A bug was fixed where the experimental FSMonitor had
[a problem with worktrees whose paths had non-ASCII
characters](git-for-windows/git#3262).

Signed-off-by: Johannes Schindelin <[email protected]>
@jeffhostetler jeffhostetler changed the title error: fsmonitor--daemon failed to start error: fsmonitor--daemon failed to start (Unicode chars in workdir path) Jul 26, 2021
@jeffhostetler
Copy link

I updated the title with the cause of the problem to help when skimming issues.

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

Successfully merging a pull request may close this issue.

6 participants