[JIRA] (JENKINS-58991) Getting NullPointerException com.bettercloud.vault.api.Logical.read after upgrade to 2.3.0

18 views
Skip to first unread message

vaclav.adamec@suchy-zleb.cz (JIRA)

unread,
Aug 19, 2019, 5:17:01 AM8/19/19
to jenkinsc...@googlegroups.com
Vaclav Adamec created an issue
 
Jenkins / Bug JENKINS-58991
Getting NullPointerException com.bettercloud.vault.api.Logical.read after upgrade to 2.3.0
Issue Type: Bug Bug
Assignee: Peter Tierno
Components: hashicorp-vault-plugin
Created: 2019-08-19 09:16
Environment: Plugin: 2.3.0
Java: 1.8.0_202
Jenkins: 2.187-1.1
EL7
Priority: Blocker Blocker
Reporter: Vaclav Adamec

Getting this after upgrade to 2.3.0

java.lang.NullPointerException
	at com.bettercloud.vault.api.Logical.read(Logical.java:73)
	at com.datapipe.jenkins.vault.VaultAccessor.read(VaultAccessor.java:52)
	at com.datapipe.jenkins.vault.VaultBuildWrapper.provideEnvironmentVariablesFromVault(VaultBuildWrapper.java:137)
	at com.datapipe.jenkins.vault.VaultBuildWrapper.setUp(VaultBuildWrapper.java:90)
	at jenkins.tasks.SimpleBuildWrapper.setUp(SimpleBuildWrapper.java:146)
	at hudson.model.Build$BuildExecution.doRun(Build.java:157)
	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
	at hudson.model.Run.execute(Run.java:1815)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
	at hudson.model.ResourceController.execute(ResourceController.java:97)
	at hudson.model.Executor.run(Executor.java:429)

using Vault app role and Vault Plugin to get secrets to shell build step. Downgrade back to 2.2.0 helps.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

josephp90@gmail.com (JIRA)

unread,
Aug 19, 2019, 5:56:02 PM8/19/19
to jenkinsc...@googlegroups.com
Joseph Petersen commented on Bug JENKINS-58991
 
Re: Getting NullPointerException com.bettercloud.vault.api.Logical.read after upgrade to 2.3.0

Vaclav Adamec if you could share your pipeline step or UI step.

What most likely is the case is you have not set `engineVersion`

josephp90@gmail.com (JIRA)

unread,
Aug 20, 2019, 12:44:02 AM8/20/19
to jenkinsc...@googlegroups.com

Upgrading to v2.3.1 allows you to set your vault engine on the Vault Configuration.
It will default to version 2 so if it still fails you will most likely have to set it to version 1.

If you want to know more about engine version read here: https://www.vaultproject.io/docs/secrets/kv/index.html

josephp90@gmail.com (JIRA)

unread,
Aug 20, 2019, 12:44:02 AM8/20/19
to jenkinsc...@googlegroups.com

vaclav.adamec@suchy-zleb.cz (JIRA)

unread,
Aug 20, 2019, 1:53:01 AM8/20/19
to jenkinsc...@googlegroups.com
Vaclav Adamec commented on Bug JENKINS-58991
 
Re: Getting NullPointerException com.bettercloud.vault.api.Logical.read after upgrade to 2.3.0

2.3.1 seems to be ok, maybe it will be better to have engine in global setup, what do you think ?

josephp90@gmail.com (JIRA)

unread,
Aug 20, 2019, 1:56:02 AM8/20/19
to jenkinsc...@googlegroups.com

in 2.3.1 engine version can be set on secret, job, folder, and on global check under advanced

vaclav.adamec@suchy-zleb.cz (JIRA)

unread,
Aug 20, 2019, 2:00:02 AM8/20/19
to jenkinsc...@googlegroups.com

ecliptik@gmail.com (JIRA)

unread,
Feb 21, 2020, 3:30:02 PM2/21/20
to jenkinsc...@googlegroups.com

We just started getting this issue again after updating to Jenkins 2.204.2 and the Hashicorp Vault Plugin (https://github.com/jenkinsci/hashicorp-vault-plugin) from 2.5.0 to 3.1.1. Error is,

FATAL: nulljava.lang.NullPointerException	at com.datapipe.jenkins.vault.VaultBuildWrapper.provideEnvironmentVariablesFromVault(VaultBuildWrapper.java:139)	at com.datapipe.jenkins.vault.VaultBuildWrapper.setUp(VaultBuildWrapper.java:94)	at jenkins.tasks.SimpleBuildWrapper.setUp(SimpleBuildWrapper.java:146)	at hudson.model.Build$BuildExecution.doRun(Build.java:157)	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)	at hudson.model.Run.execute(Run.java:1853)	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)	at hudson.model.ResourceController.execute(ResourceController.java:97)	at hudson.model.Executor.run(Executor.java:427) 

We've rolledback the plugin to 2.5.0 but it still occurs. Verified the Global jenkins-plugin is set to KV Engine Version 1, and all the jobs are set to 1 as well. Vault server version is 1.0.2 and KV 2 is not enabled.

Oddly this only happens with triggered jobs: timer, github push/PR, triggered from another job. Running or re-building a job manually will not have this error. I will to open an issue in the hashicorp-vault-plugin Github repo as well for this and will update this issue with the corresponding issue ID.

Other information:

  • Jenkins Master OS: Ubuntu 18.04.4
  • Jenkins Version: 2.204.2
  • Vault Plugin Version: 2.5.0 and 3.1.1
  • Java version: OpenJDK Runtime Environment (build 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08)
  • Vault Server version: 1.0.2
  • Jenkins jobs all run on remote jenkins agents using swarm plugin version 3.18 and Java 1.8.0-8u242 on Ubuntu 18.04

 

This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

ecliptik@gmail.com (JIRA)

unread,
Feb 21, 2020, 3:38:02 PM2/21/20
to jenkinsc...@googlegroups.com
Micheal Waltz edited a comment on Bug JENKINS-58991
We just started getting this issue again after updating to Jenkins 2.204.2 and the Hashicorp Vault Plugin ( [ https://github.com/jenkinsci/hashicorp-vault-plugin ] ) from 2.5.0 to 3.1.1. Error is,
{code:java}
FATAL: nulljava.lang.NullPointerException at com.datapipe.jenkins.vault.VaultBuildWrapper.provideEnvironmentVariablesFromVault(VaultBuildWrapper.java:139) at com.datapipe.jenkins.vault.VaultBuildWrapper.setUp(VaultBuildWrapper.java:94) at jenkins.tasks.SimpleBuildWrapper.setUp(SimpleBuildWrapper.java:146) at hudson.model.Build$BuildExecution.doRun(Build.java:157) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504) at hudson.model.Run.execute(Run.java:1853) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:427) {code}

We've rolledback the plugin to 2.5.0 but it still occurs. Verified the Global jenkins-plugin is set to KV Engine Version 1, and all the jobs are set to 1 as well. Vault server version is 1.0.2 and KV 2 is not enabled.

Oddly this only happens with triggered jobs: timer, github push/PR, triggered from another job. Running or re-building a job manually will not have this error. I will to open opened an issue in the hashicorp-vault-plugin Github repo as well for this and will update this issue with the corresponding issue ID : https://github . com/jenkinsci/hashicorp-vault-plugin/issues/81

Other information:
* Jenkins Master OS: Ubuntu 18.04.4
* Jenkins Version: 2.204.2
* Vault Plugin Version: 2.5.0 and 3.1.1
* Java version: OpenJDK Runtime Environment (build 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08)
* Vault Server version: 1.0.2
* Jenkins jobs all run on remote jenkins agents using swarm plugin version 3.18 and Java 1.8.0-8u242 on Ubuntu 18.04

 

josephp90@gmail.com (JIRA)

unread,
Mar 7, 2020, 1:07:27 AM3/7/20
to jenkinsc...@googlegroups.com
Joseph Petersen assigned an issue to Joseph Petersen
 
Change By: Joseph Petersen
Assignee: Joseph Petersen (old)
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages