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

NullPointerException on push (jgit update needed) #77

Closed
dmnk89 opened this issue May 4, 2015 · 14 comments
Closed

NullPointerException on push (jgit update needed) #77

dmnk89 opened this issue May 4, 2015 · 14 comments

Comments

@dmnk89
Copy link

dmnk89 commented May 4, 2015

I have a multi-module project and cant't get release to work...

$ ./gradlew release --stacktrace
:verifyRelease
Looking for uncommitted changes.. 
Checking if branch is ahead of remote.. 
:release
Creating tag: project-0.1.0
Pushing all to remote: origin
:release FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':release'.
> java.lang.NullPointerException (no error message)

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

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':release'.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
    at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:42)
    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
    at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
    at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:305)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.executeTask(AbstractTaskPlanExecutor.java:79)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:63)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:51)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:23)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:88)
    at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:29)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:62)
    at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
    at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:68)
    at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:62)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:55)
    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:149)
    at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:106)
    at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:86)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:80)
    at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33)
    at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:36)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
    at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:51)
    at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:171)
    at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:237)
    at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:210)
    at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35)
    at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:206)
    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
    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:33)
    at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
    at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:54)
    at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:35)
    at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
    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: java.lang.NullPointerException
    at com.jcraft.jsch.Session.checkHost(Session.java:802)
    at com.jcraft.jsch.Session.connect(Session.java:342)
    at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:116)
    at org.eclipse.jgit.transport.SshTransport.getSession(SshTransport.java:136)
    at org.eclipse.jgit.transport.TransportGitSsh$SshPushConnection.<init>(TransportGitSsh.java:320)
    at org.eclipse.jgit.transport.TransportGitSsh.openPush(TransportGitSsh.java:166)
    at org.eclipse.jgit.transport.PushProcess.execute(PushProcess.java:154)
    at org.eclipse.jgit.transport.Transport.push(Transport.java:1200)
    at org.eclipse.jgit.api.PushCommand.call(PushCommand.java:156)
    at org.eclipse.jgit.api.PushCommand.call(PushCommand.java:79)
    at java_util_concurrent_Callable$call$0.call(Unknown Source)
    at org.ajoberstar.grgit.operation.PushOp.call(PushOp.groovy:114)
    at org.ajoberstar.grgit.operation.PushOp.call(PushOp.groovy)
    at java_util_concurrent_Callable$call.call(Unknown Source)
    at java_util_concurrent_Callable$call.call(Unknown Source)
    at org.ajoberstar.grgit.util.OpSyntaxUtil.tryOp(OpSyntaxUtil.groovy:45)
    at org.ajoberstar.grgit.Grgit.methodMissing(Grgit.groovy:175)
    at pl.allegro.tech.build.axion.release.infrastructure.git.GitRepository.callPush(GitRepository.groovy:86)
    at pl.allegro.tech.build.axion.release.infrastructure.git.GitRepository.push(GitRepository.groovy:82)
    at pl.allegro.tech.build.axion.release.infrastructure.git.GitRepository.push(GitRepository.groovy:78)
    at pl.allegro.tech.build.axion.release.domain.scm.ScmRepository$push$5.call(Unknown Source)
    at pl.allegro.tech.build.axion.release.infrastructure.GradleAwareScmService.push(GradleAwareScmService.groovy:30)
    at pl.allegro.tech.build.axion.release.domain.scm.ScmService$push$1.call(Unknown Source)
    at pl.allegro.tech.build.axion.release.domain.Releaser.pushRelease(Releaser.groovy:54)
    at pl.allegro.tech.build.axion.release.domain.Releaser$pushRelease$1.call(Unknown Source)
    at pl.allegro.tech.build.axion.release.ReleaseTask.release(ReleaseTask.groovy:16)
    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:218)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:211)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:200)
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:579)
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:562)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
    ... 47 more


BUILD FAILED

Total time: 9.612 secs

build.gradle:

buildscript {
    repositories {
        maven { url "http://our/artifactory/repo" }
        mavenLocal()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.1.1'
    }
}

plugins {
    id 'pl.allegro.tech.build.axion-release' version '1.2.4'
}

scmVersion {
    tag {
        prefix = 'project'
    }
}

allprojects {
    repositories {
        maven { url "http://our/artifactory/repo" }
        mavenLocal()
        jcenter()
    }
    project.version = scmVersion.version
}

$ ./gradlew --version

------------------------------------------------------------
Gradle 2.2.1
------------------------------------------------------------

Build time:   2014-11-24 09:45:35 UTC
Build number: none
Revision:     6fcb59c06f43a4e6b1bcb401f7686a8601a1fb4a

Groovy:       2.3.6
Ant:          Apache Ant(TM) version 1.9.3 compiled on December 23 2013
JVM:          1.8.0_40 (Oracle Corporation 25.40-b25)
OS:           Linux 3.19.0-15-generic amd64
$ git remote -v
origin  ssh://git@stash/project/repo.git (fetch)
origin  ssh://git@stash/project/repo.git (push)

@adamdubiel
Copy link
Collaborator

I assume the stash in repo address ssh://git@stash/project/repo.git is declared in /etc/hosts? Can you try putting "proper" URI there?

@dmnk89
Copy link
Author

dmnk89 commented May 4, 2015

git push works properly so i assume that this is not the issue

@adamdubiel
Copy link
Collaborator

This is not so straightforward - jgit does a lot of stuff on it's own, not by delegating to git executable, so it's not 1:1. Connection negotiation, keys lookup etc is one of those things.

@dmnk89
Copy link
Author

dmnk89 commented May 4, 2015

ok, i added url to /etc/hosts and still same error

@adamdubiel
Copy link
Collaborator

Oh, i meant - can you use "proper" URI in your origin declaration, i.e. instead of ssh://git@stash/project/repo.git put ssh://git@mystash.com/project/repo.git.

@dmnk89
Copy link
Author

dmnk89 commented May 4, 2015

the configuration i copied is not same i am really using... I changed 'sensitive' data...

I found similar problem on: http://dev.eclipse.org/mhonarc/lists/jgit-dev/msg02479.html
and removing entry from known_hosts solved problem...

@adamdubiel
Copy link
Collaborator

Ah, okay, i misunderstood it then :) Issue solved then? I'm keeping up with newest versions of grgit, which in turn uses jgit, but i can possibly force some newer version of jgit to be used.

@dmnk89
Copy link
Author

dmnk89 commented May 4, 2015

this may not be important but real origin address uses ssh on port 2222

@dmnk89 dmnk89 closed this as completed May 4, 2015
@adamdubiel
Copy link
Collaborator

I think it was the keys issue, now i remember troubleshooting this kind of issue few months back.

@dmnk89
Copy link
Author

dmnk89 commented May 4, 2015

Update of jGit should solve this issue... I can wait :)

@adamdubiel
Copy link
Collaborator

Okay, so i'm going to repoen this and change the title accordingly :)

@adamdubiel adamdubiel reopened this May 4, 2015
@adamdubiel adamdubiel changed the title NullPointerException on push NullPointerException on push (jgit update needed) May 4, 2015
@dmnk89
Copy link
Author

dmnk89 commented May 4, 2015

Hmm... according to this http://mvnrepository.com/artifact/org.eclipse.jgit/org.eclipse.jgit/3.7.1.201504261725-r
Newest version of jGit still uses jsch in version 0.1.50. Problem was solved in 0.1.51 so we will have to wailt for upgrade of jGit first :)

@adamdubiel
Copy link
Collaborator

I will just force version via gradle, patch bump should not change the API :)

@adamdubiel
Copy link
Collaborator

At last i had some time to hack axion-release - this is now fixed.

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

No branches or pull requests

2 participants