1
Running as SYSTEM
[EnvInject] - Loading node environment variables.
Building in workspace /var/lib/jenkins/workspace/myapp_FrontUAT
using credential 27a4cc0a-d18c-4a8f-bfcd-788d481e12ed
> /usr/bin/git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> /usr/bin/git config remote.origin.url git@repos.mydomain.com:root/myapp_Front.git # timeout=10
Fetching upstream changes from git@repos.mydomain.com:root/myapp_Front.git
> /usr/bin/git --version # timeout=10
> git --version # 'git version 2.18.4'
using GIT_SSH to set credentials 
> /usr/bin/git fetch --tags --progress -- git@repos.mydomain.com:root/myapp_Front.git +refs/heads/*:refs/remotes/origin/* # timeout=10
> /usr/bin/git rev-parse refs/remotes/origin/myapp_Develop^{commit} # timeout=10
> /usr/bin/git rev-parse refs/remotes/origin/origin/myapp_Develop^{commit} # timeout=10
Checking out Revision 30fb4ffa6003e057a053881b7f08a62bd53cb2c1 (refs/remotes/origin/myapp_Develop)
> /usr/bin/git config core.sparsecheckout # timeout=10
> /usr/bin/git checkout -f 30fb4ffa6003e057a053881b7f08a62bd53cb2c1 # timeout=10
Commit message: "update features of ghar naksa."
> /usr/bin/git rev-list --no-walk 30fb4ffa6003e057a053881b7f08a62bd53cb2c1 # timeout=10
Checking for pre-build
Executing pre-build step
Checking if email needs to be generated
No emails were triggered.
[myapp_FrontUAT] $ /bin/sh -xe /tmp/jenkins2383517590544583257.sh
+ sudo git checkout myapp_Develop

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

sudo: a terminal is required to read the password; either use the -S
option to read from standard input or configure an askpass helper
Build step 'Execute shell' marked build as failure Discard old
builds...

#1544 is removed because old than numToKeep
Checking for post-build
Performing post-build step
Checking if email needs to be generated
Email was triggered for: Always
Sending email for trigger: Always
messageContentType = text/plain; charset=UTF-8
Collecting change authors...
    build: 1647
Adding recipients from project recipient list
Analyzing: mymail@mydomain.com
Looking for: mymail@mydomain.com
    starting at: 0
    firstFoundIdx: 0
    firstFoundIdx-substring: mymail@mydomain.com
    => found type: 0
Analyzing: mymail@mydomain.com
Looking for: mymail@mydomain.com
    starting at: 0
    firstFoundIdx: 0
    firstFoundIdx-substring: mymail@mydomain.com
    => found type: 0
Analyzing: mymail@mydomain.com
Looking for: mymail@mydomain.com
    starting at: 0
    firstFoundIdx: 0
    firstFoundIdx-substring: mymail@mydomain.com
    => found type: 0
Adding recipients from trigger recipient list
Setting In-Reply-To since last build was not successful
Successfully created MimeMessage
Sending email to: mymail@mydomain.com
MessagingException message: failed to connect, no password specified?
Finished: FAILURE
Gerald Schneider
  • 19,757
  • 8
  • 52
  • 79
  • 2
    Why on earth do you need to run the git checkout as root? – Gerald Schneider Aug 10 '20 at 08:05
  • ok .. but what difference does it make still i am getting same error without git checkout as root ."sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper Build step 'Execute shell' marked build as failure Discard old builds..." @GeraldSchneider – Bhuwan Bhandari Aug 10 '20 at 18:30
  • If you are using sudo without providing a username you are always switching to root. The point is, why are you using sudo in the first place instead of using the user jenkins is running under? – Gerald Schneider Aug 11 '20 at 06:06
  • user jenkins is not present its installed in root user only . got fixed with -o StrictHostKeyChecking=no .Anyways Thankyou :) – Bhuwan Bhandari Aug 12 '20 at 13:10
  • If you were able to solve your problem please post the solution as an answer and accept it. Otherwise the question will stay in the system as "unanswered" forever. It is perfectly fine to accept your own answers. – Gerald Schneider Aug 12 '20 at 13:18
  • But you should restructure that server. Software should not be run as root unless absolutely necessary. And for Jenkins it definitely isn't. – Gerald Schneider Aug 12 '20 at 13:20

1 Answers1

1

I got it fixed with " -o StrictHostKeyChecking=no " And its a great idea not to run git as sudo @gerald-schneider