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

Bamboo using wrong ssh port for linked Stash

Deleted user July 21, 2014

I configured Stash to use a non-default port for ssh, 8090, instead of 7999. Bamboo insists on using 7999 to clone from the linked Stash server. Naturally I'm getting a connection refused error:

(com.atlassian.bamboo.repository.RepositoryException : java.lang.RuntimeException: com.atlassian.bamboo.plugins.stash.repository.StashRepositoryException: com.atlassian.bamboo.repository.RepositoryException: : ssh://git@xx.xx.xx.xx:7999/xx/xx.git: java.net.ConnectException: Connection refused)

I tried dropping and recreating the application link but it didn't help.

How can I make Bamboo use the configured ssh port in Stash?

2 answers

1 accepted

1 vote
Answer accepted
Krystian Brazulewicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 24, 2014

David

ATM Bamboo stores Stash port information when repository definition is created. So when you changed Stash SSH port setting Bamboo is not aware of that change and will use old data.

The problem is that you're also not able to change that from the UI. There are 2 ways to fix it:

  • for each plan edit the repository and select server/repository/branch again - this should overwrite the port setting
  • modify settings directly in the database (doable if you use external DB engine and some DB management tool)

I've added improvement request on your behalf: https://jira.atlassian.com/browse/BAM-14825please vote on it if you think such feature makes sense.

Deleted user July 24, 2014

This worked like a charm:

UPDATE VCS_LOCATION
SET XML_DEFINITION_DATA = REPLACE(XML_DEFINITION_DATA, '7999', '8090');

I made sure to backup that table, stop Bamboo running, and that the only occurrences of 7999 were in the repositoryUrl. Thanks!

0 votes
ssetayeshfar
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 24, 2014

Hello David,

1. What file did you modify to change your Stash port? Did you edit the "server.xml" file referring to: https://confluence.atlassian.com/display/STASH/Changing+the+port+that+Stash+listens+on?If you navigate to Stash Administration - > Server Settings is "SSH" enabled, what port is listed there?

2. Does the base URL you are using to access both applications matches the values you are using to create application links, and the values saved in each application under Administration - > General Configuration (Administration - > Server Settings for Stash)?

3. What version of Bamboo and Stash are you using? Is Stash modified as a linked repository (https://confluence.atlassian.com/display/BAMBOO/Linking+to+source+code+repositories)?

4. Are Bamboo and Stash on the same machine? If not can you ping your Stash server from the Bamboo machine with no issues?

5. Can you please enable "Basic Access" in addition to OAuth for both incoming and outgoing and check if you notice any difference?

6. Please remove your application links from both Bamboo and Stash and try re-creating them using a "<protocol>://<IP address>:<port>/<context>" pattern instead of the base URL. Do you see any difference?

7. If you select the repository that is giving you the above exception in Stash and click on clone, do you see a correct ssh path? Can you clone this repo from the command line on your bamboo machine?

Hope this information helps David.

If the problem persists, please open a supprt ticket, attach both your Bamboo and Stash logs and provide a link to this question.

Thank you.

Best regards,

Sepideh

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events