BUG! exception in phase 'semantic analysis'


(David Resnick) #1

Build with Gradle 1.2 on a CI server just failed with the below output. Rerunning the build succeeded. This happened after another occurrence of bug GRADLE-2249, which looks similar.

Making sure Gradle builds are not flaky would seem to me to be the highest priority, above and beyond all the great features in the roadmap…

Compiling build file '/tmp/hudson/workspace/job/engine/engine.gradle' using BuildScriptTransformer.
  FAILURE: Build failed with an exception.
  * What went wrong:
Could not open no_buildscript class cache for build file '/tmp/hudson/workspace/job/engine/engine.gradle' (/tmp/hudson/workspace/job/gradle/gradle-user-home/caches/1.2/scripts/engine_5gtgf9c5uk6vkddu8mp93f7ur2/ProjectScript/no_buildscript).
> BUG! exception in phase 'semantic analysis' in source unit 'engine_5gtgf9c5uk6vkddu8mp93f7ur2' null
  * Try:
Run with --debug option to get more log output.
  * Exception is:
org.gradle.cache.CacheOpenException: Could not open no_buildscript class cache for build file '/tmp/hudson/workspace/job/engine/engine.gradle' (/tmp/hudson/workspace/job/gradle/gradle-user-home/caches/1.2/scripts/engine_5gtgf9c5uk6vkddu8mp93f7ur2/ProjectScript/no_buildscript).
 at org.gradle.cache.internal.DefaultPersistentDirectoryStore.open(DefaultPersistentDirectoryStore.java:54)
 at org.gradle.cache.internal.DefaultPersistentDirectoryStore.open(DefaultPersistentDirectoryStore.java:26)
 at org.gradle.cache.internal.DefaultCacheFactory$CacheFactoryImpl.doOpenDir(DefaultCacheFactory.java:71)
 at org.gradle.cache.internal.DefaultCacheFactory$CacheFactoryImpl.open(DefaultCacheFactory.java:110)
 at org.gradle.cache.internal.DefaultCacheRepository$PersistentCacheBuilder.doOpen(DefaultCacheRepository.java:183)
 at org.gradle.cache.internal.DefaultCacheRepository$PersistentCacheBuilder.doOpen(DefaultCacheRepository.java:133)
 at org.gradle.cache.internal.DefaultCacheRepository$AbstractCacheBuilder.open(DefaultCacheRepository.java:120)
 at org.gradle.groovy.scripts.internal.FileCacheBackedScriptClassCompiler.compile(FileCacheBackedScriptClassCompiler.java:51)
 at org.gradle.groovy.scripts.internal.ShortCircuitEmptyScriptCompiler.compile(ShortCircuitEmptyScriptCompiler.java:35)
 at org.gradle.groovy.scripts.internal.CachingScriptClassCompiler.compile(CachingScriptClassCompiler.java:36)
 at org.gradle.groovy.scripts.DefaultScriptCompilerFactory$ScriptCompilerImpl.compile(DefaultScriptCompilerFactory.java:60)
 at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:121)
 at org.gradle.configuration.BuildScriptProcessor.evaluate(BuildScriptProcessor.java:38)
 at org.gradle.configuration.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:43)
 at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:463)
 at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:75)
 at org.gradle.configuration.ProjectEvaluationConfigurer.execute(ProjectEvaluationConfigurer.java:23)
 at org.gradle.configuration.ProjectEvaluationConfigurer.execute(ProjectEvaluationConfigurer.java:21)
 at org.gradle.configuration.DefaultBuildConfigurer$1.execute(DefaultBuildConfigurer.java:38)
 at org.gradle.configuration.DefaultBuildConfigurer$1.execute(DefaultBuildConfigurer.java:35)
 at org.gradle.api.internal.project.AbstractProject.configure(AbstractProject.java:439)
 at org.gradle.api.internal.project.AbstractProject.allprojects(AbstractProject.java:434)
 at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:35)
 at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:142)
 at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:113)
 at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:81)
 at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:38)
 at org.gradle.launcher.exec.InProcessGradleLauncherActionExecuter.execute(InProcessGradleLauncherActionExecuter.java:39)
 at org.gradle.launcher.exec.InProcessGradleLauncherActionExecuter.execute(InProcessGradleLauncherActionExecuter.java:25)
 at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:50)
 at org.gradle.launcher.cli.ActionAdapter.execute(ActionAdapter.java:30)
 at org.gradle.launcher.cli.ActionAdapter.execute(ActionAdapter.java:22)
 at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:200)
 at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:173)
 at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
 at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:138)
 at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
 at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
 at org.gradle.launcher.Main.doAction(Main.java:48)
 at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
 at org.gradle.launcher.Main.main(Main.java:39)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:601)
 at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:50)
 at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:32)
 at org.gradle.launcher.GradleMain.main(GradleMain.java:26)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:601)
 at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:33)
 at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:130)
 at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)
Caused by: BUG! exception in phase 'semantic analysis' in source unit 'engine_5gtgf9c5uk6vkddu8mp93f7ur2' null
 at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:847)
 at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:548)
 at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:497)
 at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:306)
 at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:287)
 at org.gradle.groovy.scripts.internal.DefaultScriptCompilationHandler.compileScript(DefaultScriptCompilationHandler.java:118)
 at org.gradle.groovy.scripts.internal.DefaultScriptCompilationHandler.compileToDir(DefaultScriptCompilationHandler.java:67)
 at org.gradle.groovy.scripts.internal.FileCacheBackedScriptClassCompiler$CacheInitializer.execute(FileCacheBackedScriptClassCompiler.java:80)
 at org.gradle.groovy.scripts.internal.FileCacheBackedScriptClassCompiler$CacheInitializer.execute(FileCacheBackedScriptClassCompiler.java:65)
 at org.gradle.cache.internal.DefaultPersistentDirectoryCache.buildCacheDir(DefaultPersistentDirectoryCache.java:100)
 at org.gradle.cache.internal.DefaultPersistentDirectoryCache.access$100(DefaultPersistentDirectoryCache.java:36)
 at org.gradle.cache.internal.DefaultPersistentDirectoryCache$1$1.run(DefaultPersistentDirectoryCache.java:82)
 at org.gradle.cache.internal.DefaultFileLockManager$DefaultFileLock.doWriteAction(DefaultFileLockManager.java:162)
 at org.gradle.cache.internal.DefaultFileLockManager$DefaultFileLock.writeFile(DefaultFileLockManager.java:151)
 at org.gradle.cache.internal.DefaultPersistentDirectoryCache$1.execute(DefaultPersistentDirectoryCache.java:80)
 at org.gradle.cache.internal.DefaultPersistentDirectoryCache$1.execute(DefaultPersistentDirectoryCache.java:70)
 at org.gradle.cache.internal.DefaultPersistentDirectoryStore.withExclusiveLock(DefaultPersistentDirectoryStore.java:73)
 at org.gradle.cache.internal.DefaultPersistentDirectoryCache.init(DefaultPersistentDirectoryCache.java:70)
 at org.gradle.cache.internal.DefaultPersistentDirectoryStore.open(DefaultPersistentDirectoryStore.java:46)
 ... 54 more
Caused by: java.lang.NullPointerException
 at org.codehaus.groovy.control.ResolveVisitor.resolve(ResolveVisitor.java:275)
 at org.codehaus.groovy.control.ResolveVisitor.resolve(ResolveVisitor.java:243)
 at org.codehaus.groovy.control.ResolveVisitor.transformVariableExpression(ResolveVisitor.java:957)
 at org.codehaus.groovy.control.ResolveVisitor.transform(ResolveVisitor.java:742)
 at org.codehaus.groovy.ast.expr.MapEntryExpression.transformExpression(MapEntryExpression.java:41)
 at org.codehaus.groovy.control.ResolveVisitor.transform(ResolveVisitor.java:759)
 at org.codehaus.groovy.ast.expr.Expression.transformExpressions(Expression.java:63)
 at org.codehaus.groovy.ast.expr.MapExpression.transformExpression(MapExpression.java:61)
 at org.codehaus.groovy.control.ResolveVisitor.transform(ResolveVisitor.java:759)
 at org.codehaus.groovy.ast.expr.Expression.transformExpressions(Expression.java:49)
 at org.codehaus.groovy.ast.expr.ArgumentListExpression.transformExpression(ArgumentListExpression.java:67)
 at org.codehaus.groovy.control.ResolveVisitor.transform(ResolveVisitor.java:759)
 at org.codehaus.groovy.control.ResolveVisitor.transformMethodCallExpression(ResolveVisitor.java:1084)
 at org.codehaus.groovy.control.ResolveVisitor.transform(ResolveVisitor.java:750)
 at org.codehaus.groovy.ast.expr.Expression.transformExpressions(Expression.java:49)
 at org.codehaus.groovy.ast.expr.ArgumentListExpression.transformExpression(ArgumentListExpression.java:67)
 at org.codehaus.groovy.control.ResolveVisitor.transform(ResolveVisitor.java:759)
 at org.codehaus.groovy.control.ResolveVisitor.transformMethodCallExpression(ResolveVisitor.java:1084)
 at org.codehaus.groovy.control.ResolveVisitor.transform(ResolveVisitor.java:750)
 at org.codehaus.groovy.ast.ClassCodeExpressionTransformer.visitExpressionStatement(ClassCodeExpressionTransformer.java:139)
 at org.codehaus.groovy.ast.stmt.ExpressionStatement.visit(ExpressionStatement.java:40)
 at org.codehaus.groovy.ast.CodeVisitorSupport.visitBlockStatement(CodeVisitorSupport.java:35)
 at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitBlockStatement(ClassCodeVisitorSupport.java:165)
 at org.codehaus.groovy.control.ResolveVisitor.visitBlockStatement(ResolveVisitor.java:1341)
 at org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:69)
 at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClassCodeContainer(ClassCodeVisitorSupport.java:101)
 at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitConstructorOrMethod(ClassCodeVisitorSupport.java:112)
 at org.codehaus.groovy.ast.ClassCodeExpressionTransformer.visitConstructorOrMethod(ClassCodeExpressionTransformer.java:50)
 at org.codehaus.groovy.control.ResolveVisitor.visitConstructorOrMethod(ResolveVisitor.java:173)
 at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitMethod(ClassCodeVisitorSupport.java:123)
 at org.codehaus.groovy.ast.ClassNode.visitContents(ClassNode.java:1056)
 at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClass(ClassCodeVisitorSupport.java:50)
 at org.codehaus.groovy.control.ResolveVisitor.visitClass(ResolveVisitor.java:1284)
 at org.codehaus.groovy.control.ResolveVisitor.startResolving(ResolveVisitor.java:148)
 at org.codehaus.groovy.control.CompilationUnit$9.call(CompilationUnit.java:605)
 at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:843)
 ... 72 more
    BUILD FAILED