The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Tunneling SSH in pipeline error: Bind: Cannot assign requested address

Cesare Vairetti
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 14, 2019

Hi,

 my pipeline is this:

image: redwolfgang20/grails:latest

pipelines:
default:
- step:
name: Build war Tunneling and Pushing
script:
- grails prod war
- ssh -t -L 18081:localhost:8080 root@IP -fN
- cd build/libs/
- INPUT=$(ls -t *".war" | head -n 1)
- name=$(echo "$INPUT" | cut -f 1 -d '.')
- curl -v -u $TOMCAT_USER:$TOMCAT_PASSWORD -T build/libs/$name.war http://localhost:18081/manager/text/deploy?path=/'$name'&update=true

the first time I run it it worked, even if the curl line was a bit different. After everytime I run it I got this:

+ ssh -t -L 18081:localhost:8080 root@IP -fN
bind: Cannot assign requested address

 

I have no idea how to fix it, please advice

 

thanks

cesare

 

UPDATE

 

I change ssh tunnel command with this and it seems to work:

ssh -fN root@IP -L *:18080:localhost:8080

but now my curl command does not return nothing it seems it does anything at all even wtih --trace parameter

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Graham Gatus
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 7, 2019

@Cesare Vairetti I did some research and tried to reproduce that bind error locally, and it seems it is due to ssh trying to bind to an IPv6 address. Even with this warning however, I could still tunnel successfully.

I was able to stop this warning by passing the '-4' arg to ssh, and added the '-v' flag to enable additional debugging information.

ssh -v -4 -t -L 18081:localhost:8080 <user>@<my-host> -

I was able to tunnel through to a remote instance running nginx multiple times without any issue from pipelines.

It might be worth checking after deploying your .war file that port 8080 is still listening on the remote server?

TAGS
AUG Leaders

Atlassian Community Events