VCS error on WSL
Answered
Since last git update, there is an error on the VCS when using WSL. Some change they did throws a warning:
warning: safe.directory ''%(prefix)///wsl$/path/to/code' not absolute
I've already tried to add the safe.directory to git, witch absolute path, relative path, wildcard… but it doesn't to work. Anyway, this is a warning, so PhpStorm should not be affected, but this warning and should ignore this and continue working.
Please sign in to leave a comment.
Hi,
Please reproduce the issue and share the entire logs folder zipped as per https://intellij-support.jetbrains.com/hc/en-us/articles/207241085-Locating-IDE-log-files
Can you also share the content of your git config file?
Hi Dino,
The log file is very big, even compressed. I'm not sure how to send you privatelly, but the relevant lines are this:
"C:\Program Files (x86)\JetBrains\PhpStorm 2024.2.1\bin\runnerw.exe" "C:\Program Files\Git\cmd\git.exe" -c core.quotepath=false -c log.showSignature=false status --porcelain -z --no-renames --untracked-files=all --ignored=matching --
2024-09-19 11:32:30,403 [7148403] WARN - #git4idea.repo.GitUntrackedFilesHolder - warning: safe.directory ''%(prefix)///wsl$/Ubuntu/path/to/code'' not absolute
short read while indexing file1.php
com.intellij.openapi.vcs.VcsException: warning: safe.directory ''%(prefix)///wsl$/Ubuntu/path/to/code'' not absolute
short read while indexing file1.php
at git4idea.commands.GitCommandResult.throwOnError(GitCommandResult.java:172)
at git4idea.commands.GitCommandResult.getOutputOrThrow(GitCommandResult.java:156)
at git4idea.index.GitIndexStatusUtilKt.getFileStatus(GitIndexStatusUtil.kt:83)
at git4idea.repo.GitUntrackedFilesHolder.refreshFiles(GitUntrackedFilesHolder.java:348)
at git4idea.repo.GitUntrackedFilesHolder.update(GitUntrackedFilesHolder.java:244)
at com.intellij.util.ui.update.DisposableUpdate$1.doRun(DisposableUpdate.java:31)
at com.intellij.openapi.progress.util.BackgroundTaskUtil.lambda$runUnderDisposeAwareIndicator$15(BackgroundTaskUtil.java:371)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:217)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:660)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:735)
at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:691)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:659)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:79)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:202)
at com.intellij.openapi.progress.util.BackgroundTaskUtil.runUnderDisposeAwareIndicator(BackgroundTaskUtil.java:366)
at com.intellij.openapi.progress.util.BackgroundTaskUtil.runUnderDisposeAwareIndicator(BackgroundTaskUtil.java:349)
at com.intellij.util.ui.update.DisposableUpdate.run(DisposableUpdate.java:19)
at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:366)
at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:356)
at com.intellij.util.ui.update.MergingUpdateQueue.doFlush(MergingUpdateQueue.java:313)
at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:295)
at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:262)
at com.intellij.util.Alarm$Request.lambda$runSafely$0(Alarm.java:371)
at com.intellij.util.concurrency.ChildContext$runAsCoroutine$1.invoke(propagation.kt:92)
at com.intellij.util.concurrency.ChildContext$runAsCoroutine$1.invoke(propagation.kt:92)
at com.intellij.util.concurrency.ChildContext.runAsCoroutine(propagation.kt:97)
at com.intellij.util.concurrency.ChildContext.runAsCoroutine(propagation.kt:92)
at com.intellij.util.Alarm$Request.lambda$runSafely$1(Alarm.java:369)
at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:255)
at com.intellij.util.Alarm$Request.runSafely(Alarm.java:368)
at com.intellij.util.Alarm$Request.run(Alarm.java:356)
at com.intellij.util.concurrency.Propagation.contextAwareCallable$lambda$2(propagation.kt:383)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
at com.intellij.util.concurrency.SchedulingWrapper$MyScheduledFutureTask.run(SchedulingWrapper.java:272)
at com.intellij.util.concurrency.BoundedTaskExecutor.doRun(BoundedTaskExecutor.java:249)
at com.intellij.util.concurrency.BoundedTaskExecutor.access$200(BoundedTaskExecutor.java:30)
at com.intellij.util.concurrency.BoundedTaskExecutor$1.executeFirstTaskAndHelpQueue(BoundedTaskExecutor.java:227)
at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:218)
at com.intellij.util.concurrency.BoundedTaskExecutor$1.run(BoundedTaskExecutor.java:212)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:735)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:732)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:732)
at java.base/java.lang.Thread.run(Thread.java:1583)
The content of my .gitconfig file is this:
[safe]
directory = '%(prefix)///wsl$/Ubuntu/path/to/code'
Can you try with
[safe]
directory = ‘/wsl$/Ubuntu/path/to/code’
Why is prefix there?
Hi!
I'm not sure. It's the git client itself who recomends it:
By the way, I just resolved removing the quotes on .gitconfig file. Seems that last git version doesn't like those quotes.
Happy that you solved! I will note it down, too. Thanks.