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

File locking fails on ExFAT SD card #4329

Open
lankesh87 opened this issue Feb 12, 2018 · 42 comments
Open

File locking fails on ExFAT SD card #4329

lankesh87 opened this issue Feb 12, 2018 · 42 comments

Comments

@lankesh87
Copy link

lankesh87 commented Feb 12, 2018

Expected Behavior

:help

Welcome to Gradle 4.5.

To run a build, run gradle <task> ...

To see a list of available tasks, run gradle tasks

To see a list of command-line options, run gradle --help

BUILD SUCCESSFUL

Total time: 2.675 secs

Current Behavior

Starting a Gradle Daemon (subsequent builds will be faster)

FAILURE: Build failed with an exception.

* What went wrong:
Could not create service of type TaskHistoryRepository using TaskExecutionServices.createTaskHistoryRepository().
> Timeout waiting to lock task history cache (/Volumes/Mac User/macbook/lab/aws/training/gradle_student_mgmt/.gradle/4.5.1/taskHistory). It is currently in use by another Gradle instance.
  Owner PID: unknown
  Our PID: 8438
  Owner Operation: unknown
  Our operation: 
  Lock file: /Volumes/Mac User/macbook/lab/aws/training/gradle_student_mgmt/.gradle/4.5.1/taskHistory/taskHistory.lock

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1m 4s

Context

I installed gradle using brew. Then I tried running gradle command in my project directory:
$>gradle
But it resulted in above error exactly after 1 minute.
I also stopped gradle daemon using:
$>gradle --stop
It says daemon stopped. But I still get the error.
My project directory has following structure:

$> pwd
/Volumes/Mac User/macbook/lab/aws/training/gradle_student_mgmt
$> tree
.
└── src
    └── main
        └── java
            └── hello
                ├── Greeter.java
                └── HelloWorld.java

4 directories, 2 files
$>

Steps to Reproduce (for bugs)

Upgrade Macbook Pro to macOS HighSierra (10.13.3).
Freshly install gradle. Create project with two java files in ./src/main/java/hello.
Then run gradle command
$>gradle

Your Environment

Java:

$> java -version
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)
 * Build scan URL: 

Gradle:

$> gradle -v
Gradle 4.5.1
Build time:   2018-02-05 13:22:49 UTC
Revision:     37007e1c012001ff09973e0bd095139239ecd3b3
Groovy:       2.4.12
Ant:          Apache Ant(TM) version 1.9.9 compiled on February 2 2017
JVM:          1.8.0_60 (Oracle Corporation 25.60-b23)
OS:           Mac OS X 10.13.3 x86_64

MacOS:

macOS HighSierra (10.13.3)

Stack Trace:

BTPL-BYOD-050:gradle_student_mgmt lankeshzade$ gradle --stacktrace
Starting a Gradle Daemon (subsequent builds will be faster)

FAILURE: Build failed with an exception.

* What went wrong:
Could not create service of type TaskHistoryRepository using TaskExecutionServices.createTaskHistoryRepository().
> Timeout waiting to lock task history cache (/Volumes/Mac User/macbook/lab/aws/training/gradle_student_mgmt/.gradle/4.5.1/taskHistory). It is currently in use by another Gradle instance.
  Owner PID: unknown
  Our PID: 9014
  Owner Operation: unknown
  Our operation: 
  Lock file: /Volumes/Mac User/macbook/lab/aws/training/gradle_student_mgmt/.gradle/4.5.1/taskHistory/taskHistory.lock

* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Exception is:
org.gradle.internal.service.ServiceCreationException: Could not create service of type TaskHistoryRepository using TaskExecutionServices.createTaskHistoryRepository().
        at org.gradle.internal.service.DefaultServiceRegistry$FactoryMethodService.invokeMethod(DefaultServiceRegistry.java:857)
        at org.gradle.internal.service.DefaultServiceRegistry$FactoryService.create(DefaultServiceRegistry.java:808)
        at org.gradle.internal.service.DefaultServiceRegistry$ManagedObjectServiceProvider.getInstance(DefaultServiceRegistry.java:612)
        at org.gradle.internal.service.DefaultServiceRegistry$SingletonService.get(DefaultServiceRegistry.java:669)
        at org.gradle.internal.service.DefaultServiceRegistry$FactoryService.assembleParameters(DefaultServiceRegistry.java:821)
        at org.gradle.internal.service.DefaultServiceRegistry$FactoryService.create(DefaultServiceRegistry.java:807)
        at org.gradle.internal.service.DefaultServiceRegistry$ManagedObjectServiceProvider.getInstance(DefaultServiceRegistry.java:612)
        at org.gradle.internal.service.DefaultServiceRegistry$SingletonService.get(DefaultServiceRegistry.java:669)
        at org.gradle.internal.service.DefaultServiceRegistry$FactoryService.assembleParameters(DefaultServiceRegistry.java:821)
        at org.gradle.internal.service.DefaultServiceRegistry$FactoryService.create(DefaultServiceRegistry.java:807)
        at org.gradle.internal.service.DefaultServiceRegistry$ManagedObjectServiceProvider.getInstance(DefaultServiceRegistry.java:612)
        at org.gradle.internal.service.DefaultServiceRegistry$SingletonService.get(DefaultServiceRegistry.java:669)
        at org.gradle.internal.service.DefaultServiceRegistry.get(DefaultServiceRegistry.java:322)
        at org.gradle.internal.service.DefaultServiceRegistry.get(DefaultServiceRegistry.java:316)
        at org.gradle.internal.service.scopes.GradleScopeServices$4.create(GradleScopeServices.java:158)
        at org.gradle.internal.service.scopes.GradleScopeServices$4.create(GradleScopeServices.java:155)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:128)
        at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
        at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)
        at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)
        at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:46)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)
        at org.gradle.initialization.DefaultGradleLauncher$ExecuteTasks.run(DefaultGradleLauncher.java:318)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
        at org.gradle.initialization.DefaultGradleLauncher.runTasks(DefaultGradleLauncher.java:204)
        at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:134)
        at org.gradle.initialization.DefaultGradleLauncher.executeTasks(DefaultGradleLauncher.java:109)
        at org.gradle.internal.invocation.GradleBuildController$1.call(GradleBuildController.java:78)
        at org.gradle.internal.invocation.GradleBuildController$1.call(GradleBuildController.java:75)
        at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:152)
        at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:100)
        at org.gradle.internal.invocation.GradleBuildController.run(GradleBuildController.java:75)
        at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
        at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
        at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32)
        at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$1.run(RunAsBuildOperationBuildActionRunner.java:43)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
        at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:40)
        at org.gradle.tooling.internal.provider.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.java:51)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:49)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:32)
        at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:39)
        at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:25)
        at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:80)
        at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:53)
        at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:57)
        at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:32)
        at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:36)
        at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:25)
        at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:43)
        at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:29)
        at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:64)
        at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:29)
        at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:59)
        at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:44)
        at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:45)
        at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:30)
        at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
        at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
        at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
        at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
        at org.gradle.util.Swapper.swap(Swapper.java:38)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
        at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
        at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:62)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
        at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:82)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
        at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
        at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:295)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
Caused by: org.gradle.cache.LockTimeoutException: Timeout waiting to lock task history cache (/Volumes/Mac User/macbook/lab/aws/training/gradle_student_mgmt/.gradle/4.5.1/taskHistory). It is currently in use by another Gradle instance.
Owner PID: unknown
Our PID: 9014
Owner Operation: unknown
Our operation: 
Lock file: /Volumes/Mac User/macbook/lab/aws/training/gradle_student_mgmt/.gradle/4.5.1/taskHistory/taskHistory.lock
        at org.gradle.cache.internal.DefaultFileLockManager$DefaultFileLock.lock(DefaultFileLockManager.java:284)
        at org.gradle.cache.internal.DefaultFileLockManager$DefaultFileLock.<init>(DefaultFileLockManager.java:154)
        at org.gradle.cache.internal.DefaultFileLockManager.lock(DefaultFileLockManager.java:100)
        at org.gradle.cache.internal.LockOnDemandCrossProcessCacheAccess.incrementLockCount(LockOnDemandCrossProcessCacheAccess.java:105)
        at org.gradle.cache.internal.LockOnDemandCrossProcessCacheAccess.acquireFileLock(LockOnDemandCrossProcessCacheAccess.java:161)
        at org.gradle.cache.internal.DefaultCacheAccess.onStartWork(DefaultCacheAccess.java:368)
        at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:213)
        at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:203)
        at org.gradle.cache.internal.DefaultCacheAccess.newCache(DefaultCacheAccess.java:298)
        at org.gradle.cache.internal.DefaultCacheAccess.newCache(DefaultCacheAccess.java:57)
        at org.gradle.cache.internal.DefaultPersistentDirectoryStore.createCache(DefaultPersistentDirectoryStore.java:148)
        at org.gradle.cache.internal.DefaultCacheFactory$ReferenceTrackingCache.createCache(DefaultCacheFactory.java:177)
        at org.gradle.api.internal.changedetection.state.DefaultTaskHistoryStore.createCache(DefaultTaskHistoryStore.java:51)
        at org.gradle.api.internal.changedetection.state.CacheBackedTaskHistoryRepository.<init>(CacheBackedTaskHistoryRepository.java:87)
        at org.gradle.internal.service.scopes.TaskExecutionServices.createTaskHistoryRepository(TaskExecutionServices.java:173)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
        at org.gradle.internal.service.ReflectionBasedServiceMethod.invoke(ReflectionBasedServiceMethod.java:35)
        at org.gradle.internal.service.DefaultServiceRegistry$FactoryMethodService.invokeMethod(DefaultServiceRegistry.java:855)
        ... 91 more


* Get more help at https://help.gradle.org

BUILD FAILED in 1m 5s
$>
@oehme
Copy link
Contributor

oehme commented Feb 12, 2018

Did you share this Gradle user home across a network share?

@lankesh87
Copy link
Author

@oehme I did not share this over network. It's on my local machine.
Didn't configure anything.
Did following steps:

  1. Install gradle
  2. Go to project directory
  3. Run this command gradle

@blindpirate
Copy link
Collaborator

Could you try to kill all existing gradle daemons and retry? You can kill gradle daemon processes by one of the following:

  • gradle --stop or
  • ps aux | grep gradle then kill -9 ${gradle_daemon_process_id}

@lankesh87
Copy link
Author

lankesh87 commented Feb 13, 2018

@blindpirate I also tried it several times.

I ran following command:
gradle --stop

Still getting same error.

No luck there either

One point I would like to note here is that I am using an SD card as my secondary storage in macbook.
Which is always connected and mounted.
My java project resides in this SD card.

I don't know if this has anything to do with the issue.
Just wanted to point it out

@blindpirate
Copy link
Collaborator

@lankesh87 Try delete Volumes/Mac User/macbook/lab/aws/training/gradle_student_mgmt/.gradle manually please.

@lankesh87
Copy link
Author

lankesh87 commented Feb 13, 2018

@blindpirate Yup did that too.

Deleted .gradle with rm -rvf
Deleted ~/.gradle with rm -rvf

Still no luck :(

@oehme
Copy link
Contributor

oehme commented Feb 13, 2018

@lankesh87

  • Does building other projects work?
  • Does it work if you put your project directory on a different storage?

@lankesh87
Copy link
Author

@oehme Haven't tried that yet.

I'll try straightaway and let you know. Give me 10 min :)

@lankesh87
Copy link
Author

lankesh87 commented Feb 13, 2018

I do not have any build.gradle file present in my source code by the way. If that helps

@lankesh87
Copy link
Author

lankesh87 commented Feb 13, 2018

So building project on mac's primary storage worked.

Seems like gradle is having issues with secondary storage like SD cards.
I'm not sure as to why though

@oehme
Copy link
Contributor

oehme commented Feb 13, 2018

What file system do you use on that SD card? It might not fully support file locking.

@lankesh87
Copy link
Author

lankesh87 commented Feb 13, 2018

The file system on SD Card is ExFAT

USB Internal Physical Volume • ExFAT

@oehme
Copy link
Contributor

oehme commented Feb 13, 2018

The card may be write-protected or ExFAT may not support file locking. In any case our error message should be much clearer here.

@lankesh87
Copy link
Author

Can you guide me to generate logs for this particular action.
So that I can paste those here.

Cause I could write to the SD Card via File Explorer

@lankesh87
Copy link
Author

lankesh87 commented Feb 13, 2018

This is the current info of SD Card:

Volume name : Mac User
Volume type : Unknown
BSD device node : disk2s1
Mount point : /Volumes/Mac User
File system : ExFAT
Connection : USB
Device tree path : IODeviceTree:/PCI0@0/XHC1@14
Writable : Yes
Is case-sensitive : No
File system UUID : C0062FDE-935A-32F1-80C0-18BEB154967A
Volume capacity : 1,28,02,69,35,296
Available space (Purgeable + Free) : 50,55,84,02,560
Purgeable space : 0
Free space : 50,55,84,02,560
Used space : 77,46,85,32,736
Owners enabled : No
Is encrypted : No
System Integrity Protection supported : No
Can be verified : Yes
Can be repaired : Yes
Bootable : No
Journaled : No
Disk number : 2
Partition number : 1
Media name : 
Media type : Generic
Ejectable : Yes
Solid state : No
Parent disks : disk2

Permissions

$>ll /Volumes/
total 256
drwxrwxrwx  1 macone  staff  131072 Jan  1  1980 Mac User/

@oehme
Copy link
Contributor

oehme commented Feb 13, 2018

@lankesh87 Attaching the --debug log would help in this case, because then we could see any previous locking attempts.

@oehme oehme changed the title Failed to build project on macOS High Sierra with Gradle v4.5.1, Java 1.8.60_60 File locking fails on ExFAT SD card Feb 13, 2018
@oehme oehme added in:core DO NOT USE a:bug labels Feb 13, 2018
@lankesh87
Copy link
Author

lankesh87 commented Feb 13, 2018

Command Run

gradle --debug > debug.log

CLI Output

15:41:20.464 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
15:41:20.465 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception.
15:41:20.465 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
15:41:20.465 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
15:41:20.465 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Could not create service of type TaskHistoryRepository using TaskExecutionServices.createTaskHistoryRepository().
15:41:20.465 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Timeout waiting to lock task history cache (/Volumes/Mac User/macbook/lab/aws/training/docker/spring/.gradle/4.5.1/taskHistory). It is currently in use by another Gradle instance.
15:41:20.465 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   Owner PID: unknown
15:41:20.465 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   Our PID: 3720
15:41:20.465 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   Owner Operation: unknown
15:41:20.466 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   Our operation: 
15:41:20.466 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   Lock file: /Volumes/Mac User/macbook/lab/aws/training/docker/spring/.gradle/4.5.1/taskHistory/taskHistory.lock
15:41:20.466 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
15:41:20.466 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Try:
15:41:20.466 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Run with --stacktrace option to get the stack trace.  Run with --scan to get full insights.
15:41:20.467 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
15:41:20.467 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Get more help at https://help.gradle.org
15:41:20.468 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger] 
15:41:20.468 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger] BUILD FAILED in 1m 6s

Debug Logs

Attaching logs generated by gradle --debug

debug.log

@lankesh87
Copy link
Author

Do let me know what the issue was if at all there is one

I am curious :)

@oehme
Copy link
Contributor

oehme commented Feb 13, 2018

Seems very much like the file system doesn't support locking. You might want to experiment with different file systems for your SD card, e.g. try out APFS. That way we can rule out any other factors.

@lankesh87
Copy link
Author

@oehme Unfortunately I cannot format my current drive.
I'll experiment on this when I buy new drive though :)
You may also try to reproduce this in ur free time

@skovtunenko
Copy link

@oehme I also have external SSD with ExFAT. And my gradle cache directory pointed to this external SSD:
export GRADLE_USER_HOME=/Volumes/SSD480Gb/Dev/.gradle

I have the same error, same console output as @lankesh87 has.
Tried with 2 different versions with the same result:
Gradle 4.5.1
Gradle 4.7

Thank you.

@gcstang
Copy link

gcstang commented Oct 1, 2018

same issue on 4.10.2

@pkrajanand
Copy link

I did have the same issue with taskHistoryLock while running gradle init with Gradle 4.10.2 on MacOS 10.3.6 under JDK 8. I was creating project in my second hard disk with ExFAT setup. Eventually it got fixed once I restarted the machine. Some of the observations I made throughout the exercise, if that is any help:-

  1. It was working fine until yesterday without any problem with the very same setup and versions.
  2. Today, I had a mounting issue with the disk once after it got shutdown. I run a couple of unmount/mount commands to get it mounted again. I am not sure, if its a just a coincidence for the gradle issue to start showing up after that. However, I made sure that I could make modifications to the contents of the file system(creating file, folder, etc..) to ensure that its not totally due to an issue with disk-write permissions.
  3. I was using SpringSource Tool Suite 3.9.4 to create the gradle project at the time it was running into the lock issue. I noticed then that, create-project wizard some how picks up Gradle 4.3 to create it right my Gradle home is pointed to 4.10.2. By the time I got it working, I made sure that I point to the correct distribution version in the wizard. So I wonder if this also played a role in the issue. I could see two folders(4.3 and 4.10.2) under .gradle folder.

Finally, as I said, I got rid of that issue with one or combinations of all those attempts I made. However, I still get one another error/warning during the project creation at times(not a blocking issue, though)

  • What went wrong:
    Could not create service of type ScriptPluginFactory using BuildScopeServices.createScriptPluginFactory().

Could not create service of type FileHasher using BuildSessionScopeServices.createFileSnapshotter().

Hope it helps.

@mustafakemal16
Copy link

same issue on 4.6 && 5.0 ,macos 10.13.6, usb 3.0 external hdd with exfat

gradle -v


Gradle 5.0

Build time: 2018-11-26 11:48:43 UTC
Revision: 7fc6e5a

Kotlin DSL: 1.0.4
Kotlin: 1.3.10
Groovy: 2.5.4
Ant: Apache Ant(TM) version 1.9.13 compiled on July 10 2018
JVM: 1.8.0_101 (Oracle Corporation 25.101-b13)
OS: Mac OS X 10.13.6 x86_64

@betweenstrap
Copy link

betweenstrap commented Jan 25, 2019

same issue macos 10.14.3, gradle 4.10.2, external SSD exFat.

@sboss
Copy link

sboss commented Nov 21, 2019

same here with MacOS 10.14.6, java 1.8.0_202-release, with source code on ExFat partition on a directly connected Drobo. partition is less than 10% used. moved the code over to a HFS+ partition and ran like a charm.

@3792274
Copy link

3792274 commented Jan 13, 2020

yes ,the system file exfat don't support.
i try use change the location of $GRADLE_USER_HOME to APFS
It's worked!

@ichenhe
Copy link

ichenhe commented Jan 3, 2021

Is there any other ways to solve this issue? I want to share my files between windows and mac os, so exfat is the best format for me.

@HaasJona
Copy link

HaasJona commented Feb 3, 2021

I also have this problem with my project files on a ext4 partition, which I access using Paragon LinuxFS. If Gradle can't properly create lock files, it should either not use them and synchronize in some other way (maybe loopback network connections) or automatically store them in another location (for example somewhere in the home directory).

@manueljordan
Copy link

manueljordan commented Aug 3, 2021

I had this situation in two machines MacOS and Windows due the following: I used for each laptop a pendrive it with the purpose to save space in the main hard disk about the repository content (the same case applies for an external HDD/SSD connected how a secondary drive).

Scenario

Exits a Secondary Drive that is used how repository for Gradle

Solution

Format the secondary device with the same format type as the main hard disk has and problem solved!. I am not sure why this situation or behavior. Otherwise an error message about a .lock file exists arises and the daemon remains hanged

Remember

I had this situation in 2 PC and the format types for each OS is different. I think it should be documented in Gradle documentation. I am going to create an issue for this.

@manueljordan
Copy link

Did you share this Gradle user home across a network share?

Hello @oehme - I did realize that for network it is locked. Is there an official documentation to solve this?

Thanks in advance

@levarberry
Copy link

Is there any new solution to this situation without having to reformat the Ext HD to match the primary?

@naturecodevoid
Copy link

naturecodevoid commented Apr 12, 2022

I've also been experiencing this with an exFAT SSD for months, more details can be found at the closed issue above

Is there any hope for a fix such as an alternative to file locking or something similar?

@Jungle68
Copy link

So building project on mac's primary storage worked.

Seems like gradle is having issues with secondary storage like SD cards. I'm not sure as to why though

me too

@mangost
Copy link

mangost commented Sep 3, 2022

I've also been experiencing this with an exFAT SSD for months, more details can be found at the closed issue above

Is there any hope for a fix such as an alternative to file locking or something similar?

+1
Looking for a solution.

@sporkl
Copy link

sporkl commented Sep 29, 2022

I was able to build on exFAT using Android Studio gradle plugin version 7.0.0, but for some reason older and newer versions did not work (did not spend time investigating why). Putting this here in case it can be useful for someone.

@sonvirgo
Copy link

sonvirgo commented Feb 2, 2023

D*mn it takes me 2 days to come to this thread. I have .gradle folder on external usb exfat driver, shared between Windows and Mac. While the former works, the latter fails on locking, bla, bla,.. what was even misleading is VPN alike log, 'I don't know which port to listen to'.

@rayanmestiri
Copy link

Same exact issue here, same stacktrace. It works when gradle home is on an APFS drive but not on exFAT.
It would be very useful to be able to offload gradle's cache to an external drive with this filesystem.

@naturecodevoid
Copy link

I may be wrong about this, but I think exFAT is unsupported due to file locking being unsupported. But since the cache doesn't use file locking (as far as I know), maybe a configuration option can be added to change only the cache directory.

@rayanmestiri
Copy link

rayanmestiri commented Jun 29, 2023

I have had the issue throwing an error on .gradle/cache/7.6.1/fileHashes/fileHashes.lock so it seems that the cache directory does use file locking. I can also see .lock files in every single directory inside the cache directory.

@bir-d
Copy link

bir-d commented Oct 4, 2023

Hi all, passed through this issue while working on something with similar symptoms. This is quite possibly JDK-8205404.

@Ridwan226
Copy link

image

With this format I can do it normally

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

No branches or pull requests