Changing SSH Default Port for Linked Stash

Still need help?

The Atlassian Community is here for you.

Ask the community


Bamboo and Stash are integrated and Stash is added as a linked repository. Trying to configure Stash to use a non-default SSH port now (Ex.:8090, instead of the default 7999) doesn't seem to work. Port 7999 stays in use and following error shows up when trying to clone from the Stash server:

(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: Connection refused)


Bamboo stores Stash port information when repository definition is created. So when changing Stash SSH port settings after having the repository in place, bamboo is not aware of that change and will use old data. It's unfortunately not possible to change this information from the UI. 

We have an open improvement request to change this behavior: Bamboo should not store Stash SSH port in repository definition but rather use the currently configured one.


There are two ways to fix this issue:

  • For each plan edit the repository and re-select server/repository/branch,  this should overwrite the port settings
  • Modify settings directly in the database (Doable if you use external DB engine and some DB management tool). Make sure to back up your Bamboo database, stop Bamboo completely and check for the occurrences of the old/default port in "repositoryUrl". The run a command similar to the following to replace the port:

Last modified on Jul 25, 2014

Was this helpful?

Provide feedback about this article
Powered by Confluence and Scroll Viewport.