my pipeline keeps spinning with no further response
Asked by ali sakr alaraby:

**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](https://community.atlassian.com/t5/image/serverpage/image-id/167291iD7DBECE7D270A0BE/image-size/large?v=v2&px=999 "asdsadasds.PNG")


Answers:
author: Caroline R
body: Hi, [@ali sakr alaraby](/t5/user/viewprofilepage/user-id/4617244)! 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

comments: author: ali sakr alaraby
body: Hi [@Caroline R](/t5/user/viewprofilepage/user-id/3934006) ,

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.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/167907iD1CEF011F547631C/image-size/large?v=v2&px=999 "1.PNG")![2.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/167908iE1DFBA579A47A1F1/image-size/large?v=v2&px=999 "2.PNG")![3.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/167906i76C25DA2485370C0/image-size/large?v=v2&px=999 "3.PNG")


author: Caroline R
body: Hi, [@ali sakr alaraby](/t5/user/viewprofilepage/user-id/4617244)!

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


author: ali sakr alaraby
body: Hi, [@Caroline R](/t5/user/viewprofilepage/user-id/3934006) ,

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


author: Caroline R
body: Hi, [@ali sakr alaraby](/t5/user/viewprofilepage/user-id/4617244),

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


Tags: bitbucket-pipelines

cloud

ssh