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

Unable to use VaultSSHUserPrivateKey where SSHUserPrivateKey is required #215

Open
mifitous opened this issue Mar 24, 2022 · 2 comments
Open
Labels

Comments

@mifitous
Copy link

Jenkins and plugins versions report

Environment
Jenkins: 2.332.1
OS: Linux - 5.3.0-40-generic
---
Office-365-Connector:4.15.2
ace-editor:1.1
ansicolor:1.0.1
ant:1.13
antisamy-markup-formatter:2.7
apache-httpcomponents-client-4-api:4.5.13-1.0
artifactory:3.16.1
authentication-tokens:1.4
aws-credentials:191.vcb_f183ce58b_9
aws-java-sdk:1.12.163-315.v2b_716ec8e4df
aws-java-sdk-cloudformation:1.12.163-315.v2b_716ec8e4df
aws-java-sdk-codebuild:1.12.163-315.v2b_716ec8e4df
aws-java-sdk-ec2:1.12.163-315.v2b_716ec8e4df
aws-java-sdk-ecr:1.12.163-315.v2b_716ec8e4df
aws-java-sdk-ecs:1.12.163-315.v2b_716ec8e4df
aws-java-sdk-elasticbeanstalk:1.12.163-315.v2b_716ec8e4df
aws-java-sdk-iam:1.12.163-315.v2b_716ec8e4df
aws-java-sdk-logs:1.12.163-315.v2b_716ec8e4df
aws-java-sdk-minimal:1.12.163-315.v2b_716ec8e4df
aws-java-sdk-ssm:1.12.163-315.v2b_716ec8e4df
blueocean:1.25.3
blueocean-autofavorite:1.2.5
blueocean-bitbucket-pipeline:1.25.3
blueocean-commons:1.25.3
blueocean-config:1.25.3
blueocean-core-js:1.25.3
blueocean-dashboard:1.25.3
blueocean-display-url:2.4.1
blueocean-events:1.25.3
blueocean-git-pipeline:1.25.3
blueocean-github-pipeline:1.25.3
blueocean-i18n:1.25.3
blueocean-jwt:1.25.3
blueocean-personalization:1.25.3
blueocean-pipeline-api-impl:1.25.3
blueocean-pipeline-editor:1.25.3
blueocean-pipeline-scm-api:1.25.3
blueocean-rest:1.25.3
blueocean-rest-impl:1.25.3
blueocean-web:1.25.3
bootstrap4-api:4.6.0-3
bootstrap5-api:5.1.3-6
bouncycastle-api:2.25
branch-api:2.7.0
build-blocker-plugin:1.7.8
build-name-setter:2.2.0
build-timeout:1.20
built-on-column:1.1
caffeine-api:2.9.2-29.v717aac953ff3
checks-api:1.7.2
cloudbees-bitbucket-branch-source:757.vddedc5f2589a_
cloudbees-folder:6.714.v79e858ef76a_2
command-launcher:1.6
conditional-buildstep:1.4.2
config-file-provider:3.9.0
configurationslicing:430.v966357576543
credentials:1074.v60e6c29b_b_44b_
credentials-binding:1.27.1
disk-usage:0.28
display-url-api:2.3.6
docker-commons:1.19
docker-workflow:1.28
durable-task:495.v29cd95ec10f2
echarts-api:5.3.0-2
email-ext:2.87
envinject:2.839.v52c702c10635
envinject-api:1.180.v98d833b_27470
external-monitor-job:191.v363d0d1efdf8
favorite:2.4.1
font-awesome-api:6.0.0-1
git:4.10.3
git-client:3.11.0
git-server:1.10
github:1.34.3
github-api:1.301-378.v9807bd746da5
github-branch-source:1583.v18d333ef7379
github-checks:1.0.18
gitlab-api:1.0.6
gitlab-branch-source:1.5.9
gitlab-logo:1.0.5
gitlab-plugin:1.5.29
gradle:1.38
handlebars:3.0.8
handy-uri-templates-2-api:2.1.8-1.0
hashicorp-vault-plugin:336.v182c0fbaaeb7
htmlpublisher:1.29
http_request:1.14
ivy:2.1
jackson2-api:2.13.2-260.v43d711474c77
javadoc:217.v905b_86277a_2a_
javax-activation-api:1.2.0-2
javax-mail-api:1.6.2-5
jaxb:2.3.0.1
jdk-tool:1.5
jenkins-design-language:1.25.3
jenkins-multijob-plugin:1.36
jersey2-api:2.35-4
jira:3.7
jira-steps:1.6.0
jira-trigger:1.0.1
jjwt-api:0.11.2-9.c8b45b8bb173
jnr-posix-api:3.1.7-3
job-import-plugin:3.5
job-restrictions:0.8
jobConfigHistory:1119.v509e1017356b_
jquery3-api:3.6.0-2
jsch:0.1.55.2
junit:1.56
kubernetes:3568.vde94f6b_41b_c8
kubernetes-client-api:5.12.1-187.v577c3e368fb_6
kubernetes-credentials:0.9.0
ldap:2.8
leastload:3.0.0
lockable-resources:2.14
logfilesizechecker:1.5
mail-watcher-plugin:1.16
mailer:408.vd726a_1130320
matrix-auth:3.1
matrix-project:758.v7a_ea_491852f3
maven-plugin:3.18
metrics:4.1.6.1
momentjs:1.1.1
okhttp-api:4.9.3-105.vb96869f8ac3a
ownership:0.13.0
pam-auth:1.7
parameter-separator:1.3
parameterized-scheduler:1.0
parameterized-trigger:2.44
pipeline-aws:1.43
pipeline-build-step:2.16
pipeline-github-lib:36.v4c01db_ca_ed16
pipeline-graph-analysis:188.v3a01e7973f2c
pipeline-input-step:446.vf27b_0b_83500e
pipeline-milestone-step:100.v60a_03cd446e1
pipeline-model-api:2.2064.v5eef7d0982b_e
pipeline-model-definition:2.2064.v5eef7d0982b_e
pipeline-model-extensions:2.2064.v5eef7d0982b_e
pipeline-rest-api:2.23
pipeline-stage-step:291.vf0a8a7aeeb50
pipeline-stage-tags-metadata:2.2064.v5eef7d0982b_e
pipeline-stage-view:2.23
pipeline-utility-steps:2.12.0
plain-credentials:1.8
plugin-util-api:2.15.0
popper-api:1.16.1-2
popper2-api:2.11.4-1
prometheus:2.0.11
pubsub-light:1.16
rebuild:1.33
resource-disposer:0.17
robot:3.0.1
run-condition:1.5
scm-api:595.vd5a_df5eb_0e39
script-security:1145.vb_cf6cf6ed960
snakeyaml-api:1.29.1
sse-gateway:1.25
ssh:2.6.1
ssh-agent:1.24.1
ssh-credentials:1.19
ssh-slaves:1.806.v2253cedd3295
sshd:3.1.0
structs:308.v852b473a2b8c
throttle-concurrents:2.6
timestamper:1.17
token-macro:280.v97a_82642793c
trilead-api:1.0.13
uno-choice:2.6.1
variant:1.4
windows-slaves:1.8
workflow-aggregator:2.7
workflow-api:1143.v2d42f1e9dea_5
workflow-basic-steps:941.vdfe1b_a_132c64
workflow-cps:2682.va_473dcddc941
workflow-cps-global-lib:564.ve62a_4eb_b_e039
workflow-durable-task-step:1128.v8c259d125340
workflow-job:1174.vdcb_d054cf74a_
workflow-multibranch:711.vdfef37cda_816
workflow-scm-step:2.13
workflow-step-api:622.vb_8e7c15b_c95a_
workflow-support:815.vd60466279fc8
ws-cleanup:0.40
xvfb:1.2

What Operating System are you using (both controller, and any agents involved in the problem)?

Ubuntu 18

Reproduction steps

                    script {
                        remoteConfig = [[url: "${consts.ME_GIT_LAB}:devops/jenkins_shared_lib.git"]]
                        remoteConfig = deployCreds ? [remoteConfig[0] << [credentialsId : 'local_jenkins_access']] : remoteConfig
                        println remoteConfig

                            checkout([  $class: 'GitSCM',
                                branches: [[name: "*/1.3.x"]],
                                userRemoteConfigs: remoteConfig ])

Expected Results

git checkout

Actual Results

java.io.NotSerializableException: com.cloudbees.hudson.plugins.folder.Folder
at java.base/java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1185)
at java.base/java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1553)
at java.base/java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1510)
at java.base/java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1433)
at java.base/java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1179)
at java.base/java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1379)
at java.base/java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1175)
at java.base/java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1553)
at java.base/java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1510)
at java.base/java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1433)
at java.base/java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1179)
at java.base/java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:349)
at hudson.remoting.UserRequest._serialize(UserRequest.java:263)
at hudson.remoting.UserRequest.serialize(UserRequest.java:272)
Caused: java.io.IOException: Unable to serialize UserRPCRequest:org.jenkinsci.plugins.gitclient.GitClient.addCredentialsjava.lang.String,com.cloudbees.plugins.credentials.common.StandardCredentials
at hudson.remoting.UserRequest.serialize(UserRequest.java:274)
at hudson.remoting.UserRequest.(UserRequest.java:101)
at hudson.remoting.Channel.call(Channel.java:998)
at hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:285)
Caused: hudson.remoting.RemotingSystemException
at hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:301)
at com.sun.proxy.$Proxy114.addCredentials(Unknown Source)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl.addCredentials(RemoteGitImpl.java:199)
at hudson.plugins.git.GitSCM.createClient(GitSCM.java:920)
at hudson.plugins.git.GitSCM.createClient(GitSCM.java:838)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1291)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:129)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:97)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:84)
at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
[Checks API] No suitable checks publisher found.
Finished: FAILURE

Anything else?

No response

@mifitous mifitous added the bug label Mar 24, 2022
@mifitous mifitous changed the title Unable to use VaultSSHUserPrivateKey where SSHUserPrivateKey is used Unable to use VaultSSHUserPrivateKey where SSHUserPrivateKey is required Mar 24, 2022
@MuppyCwa
Copy link

MuppyCwa commented Apr 14, 2022

Affected by this bug too. Used Snippet Generator for GitSCM checkout

checkout([$class: 'GitSCM', branches: [[name: '*/master']], extensions: [], userRemoteConfigs: [[credentialsId: 'the_key_id', url: '[email protected]:MyProject/project.git']]])

Where the_key_id is configured as a Vault SSH Username with private key Credential. Key retrieval works fine too.

Running this in a jenkins pipeline job results in an exception

java.io.NotSerializableException: hudson.model.Hudson at java.base/java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1185) at java.base/java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1553) at java.base/java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1510) at java.base/java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1433) at java.base/java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1179) at java.base/java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1379) at java.base/java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1175) at java.base/java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1553) at java.base/java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1510) at java.base/java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1433) at java.base/java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1179) at java.base/java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:349) at hudson.remoting.UserRequest._serialize(UserRequest.java:263) at hudson.remoting.UserRequest.serialize(UserRequest.java:272) 09:51:18 Caused: java.io.IOException: Unable to serialize UserRPCRequest:org.jenkinsci.plugins.gitclient.GitClient.addCredentials[java.lang.String,com.cloudbees.plugins.credentials.common.StandardCredentials](27) at hudson.remoting.UserRequest.serialize(UserRequest.java:274) at hudson.remoting.UserRequest.<init>(UserRequest.java:101) at hudson.remoting.Channel.call(Channel.java:998) at hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:285) 09:51:18 Caused: hudson.remoting.RemotingSystemException at hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:301) at com.sun.proxy.$Proxy91.addCredentials(Unknown Source) at org.jenkinsci.plugins.gitclient.RemoteGitImpl.addCredentials(RemoteGitImpl.java:199) at hudson.plugins.git.GitSCM.createClient(GitSCM.java:920) at hudson.plugins.git.GitSCM.createClient(GitSCM.java:838) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1291) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:129) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:97) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:84) at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829)

@mifitous
Copy link
Author

Hello @jetersen
Do you know who can help with this one please?
Thanks a lot !

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

No branches or pull requests

2 participants