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

my pipeline keeps spinning with no further response

ali sakr alaraby October 30, 2021

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
Atlassian Team members are employees working across the company in a wide variety of roles.
November 3, 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 

ali sakr alaraby November 4, 2021

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
Atlassian Team members are employees working across the company in a wide variety of roles.
November 4, 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 

ali sakr alaraby November 5, 2021

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
Atlassian Team members are employees working across the company in a wide variety of roles.
November 8, 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
AUG Leaders

Atlassian Community Events