Changing SSH Default Port for Linked Stash
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://email@example.com:7999/xx/xx.git: java.net.ConnectException: 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:
UPDATE VCS_LOCATION SET XML_DEFINITION_DATA = REPLACE(XML_DEFINITION_DATA, '7999', '8090');