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

AccessDeniedException in MinGW/ GitBash #410

Closed
onkobu opened this issue Jun 24, 2019 · 5 comments
Closed

AccessDeniedException in MinGW/ GitBash #410

onkobu opened this issue Jun 24, 2019 · 5 comments
Labels

Comments

@onkobu
Copy link

onkobu commented Jun 24, 2019

When running gradle build/ spotlessCheck an AccessDeniedException occurs with 3.23.1:

:spotlessJava
C:\Program Files\Git\mingw64\etc\.probe-e9199215-f81c-4f84-9663-aa00bd58a3f4
java.nio.file.AccessDeniedException: C:\Program Files\Git\mingw64\etc\.probe-e9199215-f81c-4f84-9663-aa00bd58a3f4
        at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:83)
        at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
        at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102)
        at sun.nio.fs.WindowsFileSystemProvider.newByteChannel(WindowsFileSystemProvider.java:230)
        at java.nio.file.Files.newByteChannel(Files.java:361)
        at java.nio.file.Files.createFile(Files.java:632)
        at org.eclipse.jgit.util.FS$FileStoreAttributeCache.<init>(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.<init>(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 com.diffplug.common.base.Errors.lambda$wrap$5(Errors.java:218)
        at com.diffplug.common.base.Errors.run(Errors.java:210)
        at com.diffplug.spotless.extra.GitAttributesLineEndings$FileState.<init>(GitAttributesLineEndings.java:136)
        at com.diffplug.spotless.extra.GitAttributesLineEndings$Policy.calculateState(GitAttributesLineEndings.java:92)
        at com.diffplug.spotless.extra.GitAttributesLineEndings$Policy.calculateState(GitAttributesLineEndings.java:79)
        at com.diffplug.spotless.LazyForwardingEquality.state(LazyForwardingEquality.java:56)
        at com.diffplug.spotless.LazyForwardingEquality.writeObject(LazyForwardingEquality.java:68)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:1128)
        at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1496)
        at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
        at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
        at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
        at org.gradle.api.internal.changedetection.state.ValueSnapshotter.serialize(ValueSnapshotter.java:123)
        at org.gradle.api.internal.changedetection.state.ValueSnapshotter.snapshot(ValueSnapshotter.java:115)
        at org.gradle.api.internal.changedetection.state.SerializedValueSnapshot.snapshot(SerializedValueSnapshot.java:50)
        at org.gradle.api.internal.changedetection.state.ValueSnapshotter.snapshot(ValueSnapshotter.java:136)
        at org.gradle.api.internal.changedetection.rules.InputPropertiesTaskStateChanges.<init>(InputPropertiesTaskStateChanges.java:54)
        at org.gradle.api.internal.changedetection.rules.TaskUpToDateState.<init>(TaskUpToDateState.java:54)
        at org.gradle.api.internal.changedetection.changes.DefaultTaskArtifactStateRepository$TaskArtifactStateImpl.getStates(DefaultTaskArtifactStateRepository.java:178)
        at org.gradle.api.internal.changedetection.changes.DefaultTaskArtifactStateRepository$TaskArtifactStateImpl.isUpToDate(DefaultTaskArtifactStateRepository.java:88)
        at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:53)
        at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:88)
        at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
        at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
        at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:242)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:317)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:309)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:185)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:95)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:235)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:224)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:121)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:77)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:102)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:96)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:612)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:567)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:96)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
        at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:46)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
        at java.lang.Thread.run(Thread.java:748)
:spotlessJavaCheck

It does not occur with 3.22.0

gradle version: Gradle 4.0
operating system and version Windows 10 amd64
special feature: running from MinGW/ GitBash

@nedtwigg
Copy link
Member

I'm sure this was caused by #407. Upgrading jgit fixed some problems, but created this one. Fixing this will probably require a fix in the upstream jgit.

@nedtwigg nedtwigg added the bug label Jun 24, 2019
@onkobu
Copy link
Author

onkobu commented Jun 25, 2019

@nedtwigg nedtwigg mentioned this issue Jul 24, 2019
3 tasks
@nedtwigg
Copy link
Member

The bug above has a fix which has been merged, but not released. @basil also encountered a jgit bug on NFS (linked above), and that bug has also been fixed but not yet in a released version.

The workaround that @basil found is this:

buildscript {
  configurations.classpath {
    resolutionStrategy {
      force 'org.eclipse.jgit:org.eclipse.jgit:5.3.1.201904271842-r'
    }
  }
}

To go back to the jgit from spotless 3.22.0, try jgit 4.9.0.201710071750-r.

@onkobu
Copy link
Author

onkobu commented Aug 10, 2019

I'll give it a try. Thanks in advance.

pacphi added a commit to cf-toolsuite/cf-butler that referenced this issue Aug 19, 2019
* Spring Boot forward to 2.2.0.M5
* Drop back to jgit 5.3.2 b/c of unresolved conflict that appears on startup only due to Git bash issue on Windows; see diffplug/spotless#410 (comment)
marco-schmidt added a commit to marco-schmidt/am that referenced this issue Aug 20, 2019
@nedtwigg nedtwigg mentioned this issue Aug 26, 2019
3 tasks
@nedtwigg
Copy link
Member

Fixed in 3.24.3

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

No branches or pull requests

2 participants