Bamboo using wrong ssh port for linked Stash

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
Accepted answer

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.

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!

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
Community showcase
Posted Monday in Confluence

Organizing your space just got easier - Page Tree Drag & Drop is here

Hi Community! I’m Elaine, Confluence Product Manager. You may have read my earlier post about page tree in space navigation sidebar. I'm excited to share another improvement that helps you organize ...

63 views 3 2
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you