Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

ssh command hangs with sudo user executing the command.

Hello , 

 

following is my simple deployment step in pipelines. i have also disabled password prompt for this command in visudo file.

 

- pipe: atlassian/ssh-run:0.1.4

variables:

      SSH_USER: 'appuser'

      SERVER: $DEV_SERVER

      MODE: 'command'

     DEBUG: 'true'

     COMMAND: 'sudo pm2 restart app.js'

this hangs at the following line in the console.

ssh -A -tt -i /root/.ssh/pipelines_id -o StrictHostKeyChecking=no -p 22 appuser@<ip-address> sudo pm2 restart app.js 

 

looks like something going with ==> "sudo" . 

 

thanks

 

 

1 answer

0 votes

Hi @Gangadhar Mamillapalli . I don't thinks running a command with sudo should affect the execution of the pipe. I would suggest checking if there are issues with the pm2, maybe there are to many processes running or something like that. Can you try to login you your server and run the same command manually?

thanks for reply. 

am able to that command successfully by manually logging into the server.

in fact ., we have one more server with root user and the same script runs good ( without that sudo before that command) .

 

thanks

Ok, does your your user requires a sudo password to run sudo commands? If so, this might be the reason the pipe hangs, basically waiting for password input. 

thanks for the reply,

as i mentioned in my first message that i have disable password prompt for running this command ==> pm2 restart app.js in visudo file.  i have verified this manually also.

looks like some other issue.

thanks

Hello atlassian, 

Any clue on this ?

thanks

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket Pipelines

What We Learned When We Researched Open Source Vulnerabilities in 7 Popular Coding Languages

...hey are a part of us, shaping how we interact with the world around us. The same holds true for programming languages when we think about how different kinds of vulnerabilities raise their heads in t...

1,225 views 0 3
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you