Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
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

my pipeline keeps spinning with no further response

Edited

i have my .yml file as follows and i added the repository variables and ssh keys and everything seems to be fine however, my pipeline reaches the command step and doesn`t move further , how can i solve this ?

here is the yml file and the step it stops at.

image: node:14.18.1
pipelines:
  branches:
    stage:
        - step:
            name: Installing node_modules & Deploy Stage
            deployment: Staging
            script:
              - pipe: atlassian/ssh-run:0.2.3
                variables:
                  SSH_USER: $SSH_USER
                  SERVER: $SERVER
                  COMMAND: 'cd /var/www/gcs-backend && sudo git pull origin stage && sudo npm i && sudo pm2 restart index'

asdsadasds.PNG

1 answer

0 votes
Caroline R Atlassian Team Nov 03, 2021

Hi, @ali sakr alaraby! Welcome to the community! 

In order to further investigate this issue, could you please follow the next steps and share the output with us?

1. Add 

Debug: "true"  

in the Pipe configuration and check the output. This will help us to get more logs that can help us to investigate the issue further

2. Use 

COMMAND: 'echo "test"'  

as the command and check. This will help us to find out if there is any specific issue with the command that you are using in the Pipe

3. Please run 

'cd /var/www/gcs-backend && sudo git pull origin stage && sudo npm i && sudo pm2 restart index' 

directly on the SSH server (outside the Pipeline) and see what you observe

Looking forward to hearing from you. 

Kind regards,
Caroline 

Hi @Caroline R ,

thank you so much for replying to my problem.

i added the suggested edits, ran the command on the server 

'cd /var/www/gcs-backend && sudo git pull origin stage && sudo npm i && sudo pm2 restart index' 

it asked for my password, i entered it then everything went well with no problem, actually it didn`t take more than a minute to do everything.

However, i`m still facing the same problem. 

points to mention: 

- i added $SERVER and $SSH_USER to the repo variables.

- i also generated ssh key pairs, added the public key to the server authorized_keys and added the host address to the know hosts.

 

also here`s my full output: 

1.PNG2.PNG3.PNG

Caroline R Atlassian Team Nov 04, 2021

Hi, @ali sakr alaraby

Thanks for the additional information. I can see you are using a very old version of Pipe (0.2.3), so could you please: 

  • Update the Pipe version to 0.4.0 and check with that; 
  • Check with a simple command - echo test. 

Please let me know how it goes and feel free to add any additional information here.

Thank you. 

Kind regards,
Caroline 

Hi, @Caroline R , 

thank you again for getting back at me with some hints.

now after some further investigation and playing around with the COMMAND part i found out that all commands run well except for 'sudo git pull origin stage', seems like git commands are the ones that don`t work.

i provide the $SSH_USER and $SERVER variables and i`m sure they`re correct, also i`m using the ssh key pairs correct, i generated them from the bitbucket ssh_keys settings page and i added the public key to the server`s authorized_keys as in the document i was following.

using this command  'sudo git pull origin stage' on the server of course asks for my credentials, i provide it when asked then it continues fine.

 so do you have any recommendations for me of what could i be missing?

and thank you so much again.

Ali Alaraby

  

Caroline R Atlassian Team Nov 08, 2021

Hi, @ali sakr alaraby

Could you please confirm if the credentials you provide are for the sudo or the git command?

Also, could you check which protocol you are using on Git operations, SSH or HTTPS? You can verify that by running the following command in the directory where data is being pulled (cd /var/www/gcs-backend && sudo git remote -v): 

git remote -v

Looking forward to hearing from you.

Kind regards,
Caroline

Suggest an answer

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

📣 Calling Bitbucket Data Center customers to participate in research

Hi everyone, Are you Bitbucket DC customer? If so, we'd love to talk to you! Our team wants to dive deep to understand your long-term plans regarding Bitbucket DC and Atlassian Cloud. Do you plan...

159 views 2 4
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