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

Nullpointer exception when making a call to the plugin #13

Open
khuga94 opened this issue Nov 24, 2021 · 1 comment
Open

Nullpointer exception when making a call to the plugin #13

khuga94 opened this issue Nov 24, 2021 · 1 comment

Comments

@khuga94
Copy link

khuga94 commented Nov 24, 2021

Hi.

I have an AKS cluster with 3 Jenkins running, same version (2.263.4) in two of them, and the last version (2.303.3) for the other.

Same version of the plugin in the three of them (1.0.10).

Same plugin config in all Jenkins:
image

I also have the same pipeline in all of them.


pipeline {
    options {
        timestamps ()
    }
    agent {
        kubernetes {
            yaml '''
        apiVersion: v1
        kind: Pod
        spec:
          containers:
          - name: amazonlinux
            image: amazonlinux:latest
            command:
            - sleep
            args:
            - infinity
        '''
        defaultContainer 'amazonlinux'
        }
    }
    stages {
       stage('Terraform init and plan main Data infrastructure')
        {
            options {
                timeout(time: 1, unit: 'HOURS')
            }
            steps
            {
                script{
                        def terraform_home = tool "Terraform"
                }
            }
        }
    }
}

So in two of the Jenkins, one in version 2.263.4 and the other in version 2.303.3, the Pipeline works perfectly, but in the third one i get this:

java.lang.NullPointerException
	at org.jenkinsci.plugins.workflow.steps.ToolStep$Execution.run(ToolStep.java:153)
	at org.jenkinsci.plugins.workflow.steps.ToolStep$Execution.run(ToolStep.java:136)
	at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Finished: FAILURE

The log in the other Jenkins looks like this:

16:56:41  Unpacking https://releases.hashicorp.com/terraform/1.0.7/terraform_1.0.7_linux_amd64.zip to /home/jenkins/agent/tools/org.jenkinsci.plugins.terraform.TerraformInstallation/Terraform on tests-testterraform-4-jlgk9-0261g-dcx1g
[Pipeline] }
[Pipeline] // script
[Pipeline] }
[Pipeline] // timeout
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // timestamps
[Pipeline] }
[Pipeline] // container
[Pipeline] }
[Pipeline] // node
[Pipeline] }
[Pipeline] // podTemplate
[Pipeline] End of Pipeline
Finished: SUCCESS

I've checked every configuration in jenkins and they're all the same, the plugin config is all the same in the three of them.

Do you have any insight of what could be happening?

@bhagirathgudi
Copy link

Hello,

I am experiencing the same issue. Did you find the root cause for this issue? did you resolve it?

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