[GRADLE-2130] Gradle fails to initialize on HP-UX Created: 28/Feb/12  Updated: 04/Jan/13  Resolved: 23/Jul/12

Status: Resolved
Project: Gradle
Affects Version/s: 1.0-milestone-8, 1.0-milestone-8a
Fix Version/s: 1.1-rc-1

Type: Bug
Reporter: Stanislav Abadjiev Assignee: Unassigned
Resolution: Fixed Votes: 0


 Description   

1: Installed http://services.gradle.org/distributions/gradle-1.0-milestone-8a-bin.zip on the target server in /var/test_user/gradle-1.0-milestone-8a.
2: Using an empty init.gradle in /var/test_user/.gradle/init.gradle(or not using any init.gradle)
3: export GRADLE_HOME=/var/test_user/gradle-1.0-milestone-8a
4: export PATH=/var/test_user/gradle-1.0-milestone-8a/bin:$PATH
6: execute: gradle -d throws the following exception:

11:56:59.595 [INFO] [org.gradle.BuildLogger] Starting Build
11:56:59.602 [DEBUG] [org.gradle.BuildLogger] Gradle user home: /var/test_user/.gradle
11:56:59.607 [DEBUG] [org.gradle.BuildLogger] Current dir: /var/test_user/systemtest
11:56:59.608 [DEBUG] [org.gradle.BuildLogger] Settings file: null
11:56:59.609 [DEBUG] [org.gradle.BuildLogger] Build file: null
11:56:59.614 [DEBUG] [org.gradle.BuildLogger] Select default project: with project directory '/var/test_user/systemtest'
11:57:00.089 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on initscript class cache for initialization script '/var/test_user/.gradle/init.gradle' (/var/test_user/.gradle/caches/1.0-milestone-8/scripts/init_6fpd3at2dkp71iublolg39inq7/InitScript/initscript).
11:57:00.099 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired.
11:57:00.103 [DEBUG] [org.gradle.cache.internal.DefaultPersistentDirectoryCache] Invalidating initscript class cache for initialization script '/var/test_user/.gradle/init.gradle' (/var/test_user/.gradle/caches/1.0-milestone-8/scripts/init_6fpd3at2dkp71iublolg39inq7/InitScript/initscript) as it was not closed cleanly.
11:57:00.106 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire exclusive lock on initscript class cache for initialization script '/var/test_user/.gradle/init.gradle' (/var/test_user/.gradle/caches/1.0-milestone-8/scripts/init_6fpd3at2dkp71iublolg39inq7/InitScript/initscript).
11:57:00.111 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on initscript class cache for initialization script '/var/test_user/.gradle/init.gradle' (/var/test_user/.gradle/caches/1.0-milestone-8/scripts/init_6fpd3at2dkp71iublolg39inq7/InitScript/initscript).
11:57:00.136 [ERROR] [org.gradle.BuildExceptionReporter]
11:57:00.140 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
11:57:00.142 [ERROR] [org.gradle.BuildExceptionReporter]
11:57:00.144 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
11:57:00.146 [ERROR] [org.gradle.BuildExceptionReporter] Could not open initscript class cache for initialization script '/var/test_user/.gradle/init.gradle' (/var/test_user/.gradle/caches/1.0-milestone-8/scripts/init_6fpd3at2dkp71iublolg39inq7/InitScript/initscript).
11:57:00.151 [ERROR] [org.gradle.BuildExceptionReporter] > java.io.IOException: Invalid argument (errno:22)
11:57:00.153 [ERROR] [org.gradle.BuildExceptionReporter]
11:57:00.155 [ERROR] [org.gradle.BuildExceptionReporter] * Exception is:
11:57:00.158 [ERROR] [org.gradle.BuildExceptionReporter] org.gradle.cache.CacheOpenException: Could not open initscript class cache for initialization script '/var/test_user/.gradle/init.gradle' (/var/test_user/.gradle/caches/1.0-milestone-8/scripts/init_6fpd3at2dkp71iublolg39inq7/InitScript/initscript).
11:57:00.160 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.cache.internal.DefaultPersistentDirectoryStore.open(DefaultPersistentDirectoryStore.java:53)
11:57:00.162 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.cache.internal.DefaultCacheFactory$CacheFactoryImpl.doOpenDir(DefaultCacheFactory.java:62)
11:57:00.164 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.cache.internal.DefaultCacheFactory$CacheFactoryImpl.open(DefaultCacheFactory.java:100)
11:57:00.166 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.cache.internal.DefaultCacheRepository$PersistentCacheBuilder.doOpen(DefaultCacheRepository.java:170)
11:57:00.168 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.cache.internal.DefaultCacheRepository$PersistentCacheBuilder.doOpen(DefaultCacheRepository.java:126)
11:57:00.170 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.cache.internal.DefaultCacheRepository$AbstractCacheBuilder.open(DefaultCacheRepository.java:113)
11:57:00.172 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.groovy.scripts.internal.FileCacheBackedScriptClassCompiler.compile(FileCacheBackedScriptClassCompiler.java:48)
11:57:00.174 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.groovy.scripts.internal.ShortCircuitEmptyScriptCompiler.compile(ShortCircuitEmptyScriptCompiler.java:35)
11:57:00.176 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.groovy.scripts.internal.CachingScriptClassCompiler.compile(CachingScriptClassCompiler.java:36)
11:57:00.178 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.groovy.scripts.DefaultScriptCompilerFactory$ScriptCompilerImpl.compile(DefaultScriptCompilerFactory.java:60)
11:57:00.180 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:114)
11:57:00.182 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.configuration.DefaultInitScriptProcessor.process(DefaultInitScriptProcessor.java:37)
11:57:00.184 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.InitScriptHandler.executeScripts(InitScriptHandler.java:41)
11:57:00.186 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:128)
11:57:00.187 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:110)
11:57:00.189 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:78)
11:57:00.191 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.RunBuildAction.execute(RunBuildAction.java:42)
11:57:00.193 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.RunBuildAction.execute(RunBuildAction.java:28)
11:57:00.194 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.ExceptionReportingAction.execute(ExceptionReportingAction.java:32)
11:57:00.196 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.ExceptionReportingAction.execute(ExceptionReportingAction.java:21)
11:57:00.198 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.CommandLineActionFactory$WithLoggingAction.execute(CommandLineActionFactory.java:238)
11:57:00.199 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.CommandLineActionFactory$WithLoggingAction.execute(CommandLineActionFactory.java:222)
11:57:00.201 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.Main.doAction(Main.java:48)
11:57:00.203 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.EntryPoint$1.execute(EntryPoint.java:53)
11:57:00.204 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.EntryPoint$1.execute(EntryPoint.java:51)
11:57:00.206 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.Execution.execute(Execution.java:28)
11:57:00.207 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.EntryPoint.run(EntryPoint.java:39)
11:57:00.209 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.Main.main(Main.java:39)
11:57:00.210 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.ProcessBootstrap.runNoExit(ProcessBootstrap.java:51)
11:57:00.212 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.ProcessBootstrap.run(ProcessBootstrap.java:33)
11:57:00.213 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.GradleMain.main(GradleMain.java:24)
11:57:00.215 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: org.gradle.internal.UncheckedException: java.io.IOException: Invalid argument (errno:22)
11:57:00.216 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.internal.UncheckedException.asUncheckedException(UncheckedException.java:33)
11:57:00.217 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.cache.internal.DefaultFileLockManager$DefaultFileLock.writeToFile(DefaultFileLockManager.java:154)
11:57:00.218 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.cache.internal.DefaultPersistentDirectoryCache.init(DefaultPersistentDirectoryCache.java:61)
11:57:00.220 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.cache.internal.DefaultPersistentDirectoryStore.open(DefaultPersistentDirectoryStore.java:47)
11:57:00.221 [ERROR] [org.gradle.BuildExceptionReporter] ... 30 more
11:57:00.222 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: java.io.IOException: Invalid argument (errno:22)
11:57:00.223 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.cache.internal.DefaultFileLockManager$DefaultFileLock.lockRegion(DefaultFileLockManager.java:287)
11:57:00.225 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.cache.internal.DefaultFileLockManager$DefaultFileLock.lockInformationRegion(DefaultFileLockManager.java:282)
11:57:00.226 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.cache.internal.DefaultFileLockManager$DefaultFileLock.lock(DefaultFileLockManager.java:254)
11:57:00.227 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.cache.internal.DefaultFileLockManager$DefaultFileLock.writeToFile(DefaultFileLockManager.java:141)
11:57:00.229 [ERROR] [org.gradle.BuildExceptionReporter] ... 32 more
11:57:00.230 [ERROR] [org.gradle.BuildExceptionReporter]
11:57:00.231 [LIFECYCLE] [org.gradle.BuildResultLogger]
11:57:00.232 [LIFECYCLE] [org.gradle.BuildResultLogger] BUILD FAILED
11:57:00.234 [LIFECYCLE] [org.gradle.BuildResultLogger]
11:57:00.235 [LIFECYCLE] [org.gradle.BuildResultLogger] Total time: 2.157 secs

*Note: Removing the /var/test_user/.gradle/caches directory and executing gradle do not change the situation. The exception is still in place.



 Comments   
Comment by Detelin Yordanov [ 29/Feb/12 ]

This bug may have something to do with this issue:
http://bugs.sun.com/view_bug.do?bug_id=6628575
As it seems that DefaultFileLockManager.lockInformationRegion uses lock region size of 'Long.MAX_VALUE - INFORMATION_REGION_POS' which might be too much.

Comment by Hao Sun [ 29/Mar/12 ]

Is there any follow-up for this issue?
I replaced Long.MAX_VALUE to Integer.MAX_VALUE to fix it.
Will that cause any issue?

Comment by Adam Murdoch [ 03/May/12 ]

This should be fixed now. Can you try a recent snapshot build from http://gradle.org/nightly and let us know if it works?

Comment by Hao Sun [ 04/May/12 ]

just took a quick test and yes, it seems working on the HPUX but there still have the warning message pop out as :
o.g.l.i.TerminalDetectorFactory - Unable to initialise the native integration for current platform: HP-UX B.11.31 IA64N. Details: Could not locate JNA native library resource '/com/sun/jna/hp-ux-IA64N/libjnidispatch.so'.

The version I tested is gradle-1.1-rc-1-20120504000032+0200

Thanks a lot!

Generated at Wed Jun 30 12:13:36 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.