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

Nullsafe operator required #445

Open
ilmenshik opened this issue Feb 26, 2024 · 0 comments
Open

Nullsafe operator required #445

ilmenshik opened this issue Feb 26, 2024 · 0 comments

Comments

@ilmenshik
Copy link

I'm using windows agents with password auth. And it does not work if I use JCasC. Because privateKeyCredentialsId is empty for an instance configuration in the exported yaml file.

And that's why I got NPE:

2024-02-26 17:19:11.011+0000 [id=787]   WARNING c.g.j.p.c.ComputeEngineCloud#log: Failed to authenticate with exception: 
java.lang.NullPointerException
        at com.google.jenkins.plugins.computeengine.ComputeEngineWindowsLauncher.authenticateSSH(ComputeEngineWindowsLauncher.java:66)
        at com.google.jenkins.plugins.computeengine.ComputeEngineWindowsLauncher.bootstrap(ComputeEngineWindowsLauncher.java:95)

So in that line:
https://github.com/jenkinsci/google-compute-engine-plugin/blob/5ed247be6b4264cbc33f7d2a4cabf399fb59b75d/src/main/java/com/google/jenkins/plugins/computeengine/ComputeEngineWindowsLauncher.java#L66C13-L66C66

it should be like this: getPrivateKeyCredentialsId()?.isEmpty()

Workaround: add to your yaml privateKeyCredentialsId: "" even if you need to use only passwordCredentialsId

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

1 participant