jenkinsci / google-compute-engine-plugin

https://plugins.jenkins.io/google-compute-engine/
Apache License 2.0
57 stars 88 forks source link

Project wide enabled OSLogin causing SSH Authentication Failed error #195

Open emmaLP opened 4 years ago

emmaLP commented 4 years ago

Configured the GCE plugin to use the Google Service Account from metadata credentials and have project wide OSLogin enabled.

When I try spin up an node the logs say Using autogenerated keypair but every time it tries to connect via SSH I get Authentication Failed, JenkinsConsole

My GCE Plugin config looks like this: GCEConfigPat1 GCEPluginPart2 GCEPluginPart3

I cannot use a Service Account from a private key credentials as the setup of the service account as well as the credential is all automated so I don't want to be storing keys anywhere.

Jenkins Version: 2.235.1 Google Plugin versions: Google Compute Engine Plugin: 4.3.0 Google Login Plugin: 1.6 Google OAuth Credentials Plugin: 1.0.0

Please can this be investigated and fixed as soon as possible.

emmaLP commented 4 years ago

I have also tried with using a private key credentials and get the same issue with Authentication Failed.

Is it likely OSLogin causing the issue?

emmaLP commented 4 years ago

So I've tested using a instance template with the oslogin disabled in the metadata and the Service account from metadata credential works perfectly.

Feature request would be to allow metadata to be set when an instance template is not specified

harshapic commented 4 years ago

@emmaLP OSLogin disabling in instance template helped me. Thanks