Score:1

Why was I unable to rebuild jobs?

cn flag

I have a jenkins server which jenkins was upgraded from version 2.220 to 2.387.1, all plugins have been upgraded.

When I rebuilt jobs, it gave me these output:

Started by user abc
Running as SYSTEM
Building in workspace /var/lib/jenkins/workspace/DEF_GW_ENROLL_USER_PREPROD
[DEF_GW_ENROLL_USER_PREPROD] $ /bin/bash -x /tmp/jenkins81696621479514690.sh
+ export SSH_CONF=/var/lib/jenkins/.ssh/config/ssh_config_preprod-ue1
+ SSH_CONF=/var/lib/jenkins/.ssh/config/ssh_config_preprod-ue1
+ echo PREPROD
PREPROD
+ export targets=batch-host
+ targets=batch-host
+ for host in '$targets'
+ ssh -F /var/lib/jenkins/.ssh/config/ssh_config_preprod-ue1 batch-host 'sudo python add_user_pastdated.py web.pre.domain.com abc1234 1 target.internal.domain.com false AUTHSERVER_V1R1 KPREHA_002 8  PST true'
ssh_exchange_identification: Connection closed by remote host
Build step 'Execute shell' marked build as failure
[WS-CLEANUP] Deleting project workspace...[WS-CLEANUP] Skipped based on build state FAILURE
Finished: FAILURE

I've tried to do a manual ssh, by copying the config file from /var/lib/jenkins/.ssh/config/ssh_config_preprod-ue1 to ~/.ssh/, and then run the ssh command, the connection was successfully made, I was able to enter the server.

The jenkins.log is empty, and the ssh plugins show no error message, so I have no clues at the moment.

What possibly could be the root cause?

Score:0
by flag

Few test you can do: Check the file permission /var/lib/jenkins/.ssh/config/ssh_config_preprod-ue1 and the corresponding private keys, then the ownership, it must be owned by the Jenkins user , use chown if necessary

sudo chown jenkins:jenkins /var/lib/jenkins/.ssh/config/ssh_config_preprod-ue1
sudo chown jenkins:jenkins /var/lib/jenkins/.ssh/id_rsa (or the corresponding private key file)

Also check the ssh config /var/lib/jenkins/.ssh/config/ssh_config_preprod-ue1

Try to establish an SSH connection manually as the Jenkins user

sudo su - jenkins
ssh -F /var/lib/jenkins/.ssh/config/ssh_config_preprod-ue1 batch-host

You can also look in the remote host logs /var/log/auth.log (or /var/log/secure

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.