gradle-git-version icon indicating copy to clipboard operation
gradle-git-version copied to clipboard

Access violation when run as normal user

Open stayleen opened this issue 4 years ago • 3 comments

What happened?

When the plugin is run without Administrator privileges, it tries to access C:\Program Files\Git\etc to create a file called

.probe-<some UUID>

This results in an access violation. The UUID is different for each run, so it does not help to create the directory by hand, which I tried as a workaround. I am running gradle within IntelliJ. When I run IntelliJ as Administrator, this exception does not occur.

Is there a way to tell the plugin where to create its probe files to get around this?

Git for Windows version: 2.31.1.windows.1 Plugin version: 0.12.3

Configure project : C:\Program Files\Git\etc.probe-8705efe9-59ab-42a8-acc2-545b02b5b940 java.nio.file.AccessDeniedException: C:\Program Files\Git\etc.probe-8705efe9-59ab-42a8-acc2-545b02b5b940 at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:89) at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103) at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108) at java.base/sun.nio.fs.WindowsFileSystemProvider.newByteChannel(WindowsFileSystemProvider.java:235) at java.base/java.nio.file.Files.newByteChannel(Files.java:371) at java.base/java.nio.file.Files.createFile(Files.java:648) at org.eclipse.jgit.util.FS$FileStoreAttributeCache.(FS.java:234) at org.eclipse.jgit.util.FS$FileStoreAttributeCache.getFsTimestampResolution(FS.java:211) at org.eclipse.jgit.util.FS.getFsTimerResolution(FS.java:321) at org.eclipse.jgit.internal.storage.file.FileSnapshot.(FileSnapshot.java:186) at org.eclipse.jgit.internal.storage.file.FileSnapshot.save(FileSnapshot.java:122) at org.eclipse.jgit.storage.file.FileBasedConfig.load(FileBasedConfig.java:155) at org.eclipse.jgit.internal.storage.file.FileRepository.loadSystemConfig(FileRepository.java:252) at org.eclipse.jgit.internal.storage.file.FileRepository.(FileRepository.java:205) at org.eclipse.jgit.internal.storage.file.FileRepository.(FileRepository.java:153) at com.palantir.gradle.gitversion.GitVersionPlugin.gitRepo(GitVersionPlugin.java:73) at com.palantir.gradle.gitversion.GitVersionPlugin.apply(GitVersionPlugin.java:36) at com.palantir.gradle.gitversion.GitVersionPlugin.apply(GitVersionPlugin.java:29) at org.gradle.api.internal.plugins.ImperativeOnlyPluginTarget.applyImperative(ImperativeOnlyPluginTarget.java:42) at org.gradle.api.internal.plugins.RuleBasedPluginTarget.applyImperative(RuleBasedPluginTarget.java:50) at org.gradle.api.internal.plugins.DefaultPluginManager.addPlugin(DefaultPluginManager.java:177) at org.gradle.api.internal.plugins.DefaultPluginManager.access$300(DefaultPluginManager.java:51) at org.gradle.api.internal.plugins.DefaultPluginManager$AddPluginBuildOperation.run(DefaultPluginManager.java:267) ....

stayleen avatar May 17 '21 08:05 stayleen

could not reproduce on GNU/Linux (Debian 10 x86_64)

ilka-schulz avatar Jul 15 '21 08:07 ilka-schulz

This seems to be an issue in JGit: https://bugs.eclipse.org/bugs/show_bug.cgi?id=548648, updating to > 5.4.2 should fix it. It doesn't seem to stop the plugin from working but does throw an error everytime a gradle task is executed.

suppergerrie2 avatar Aug 22 '21 09:08 suppergerrie2

I have the same issue. What about the initial question: "Is there a way to tell the plugin where to create its probe files to get around this?"

wsdng avatar Mar 23 '22 08:03 wsdng