youngmon/atlassian-qna huggingface dataset:
Builds are failing intermittently in Bamboo with code 128
Asked by Mafaz Udayar:

Our organization has a bamboo server setup in Amazon EC2 environment and we are getting the below "HTTP request failed" error intermittently. Below is the screen shot of the error log

bamboo.PNG

Any help on this would be really appreciated.  
[](https://community.atlassian.com/t5/Bamboo-questions/Builds-are-failing-intermittently-in-Bamboo-with-code-128/qaq-p/364693?attachment-id=4095){#link_116854c10700a4}  
[](/tnckb94959/attachments/tnckb94959/bamboo-questions/11579/1/bamboo.PNG){#display_116854c10700a4_0}


Answers:
author: pradhyumna shrestha
body: The intermittent issue you are seeing might have been caused by network issues when git took long time to checkout the source code. Usually happens when network is crappy or the repo you are trying to clone is really big one.

**Possible solutions you should try:**

1\> **Better to use ssh than https** to checkout the source code from git.

For more details on using ssh with git checkout : <https://confluence.atlassian.com/display/BAMBOO/Git>

2\>**Use shallow clones** in checkout source task, ( if you don't need the tags it better to use shallow clones they are faster)

A snapshot on where : <https://confluence.atlassian.com/display/BAMBOO/Bitbucket?focusedCommentId=600867102#comment-600867102>

|------------------------|---|---|
| **Use shallow clones** | Allows Bamboo to perform shallow clones (i.e. history truncated to a specified number of revisions). This should increase the speed of the initial code checkouts, however if your build depends on the full repository history, we recommend that you do not use this option. Shallow clones are enabled by default. ||

3\> **set up linked source repositories**

Details : <https://confluence.atlassian.com/display/BAMBOO/Linking+to+source+code+repositories>

Specific to bit bucket : <https://confluence.atlassian.com/display/BAMBOO/Bitbucket>


Tags: cloud
Deploy Branch to Production
Asked by paul strachan:

Hi,

The bamboo documentation states that branches should never be deployed into production. We are using subversion with recommended structure as /trunk, /branches, /tags.

We are working on new features and have reached a point where some of the new features have been merged from feature branch to trunk.

However a problem has been found in current production version and we need to deploy a "patch". What we are thinking we need to do is:

a) create a branch from the existing production tag

b) commit the fix into the branch

c) also merge the fix into trunk

d) deploy the branch (patch) into production

Can someone please advise if this approach is wrong, and why does the Bamboo documentation say branches should not be released into production. I certainly agree that *feature* branches should never be deployed into production - but what about patches (i.e. release branch)? Is this approach wrong?

At some point we *have* to merge our features branches into trunk, but there always exists a window where an urgent production bug could be discovered and we need to deploy a branch.

My 2nd question is what is the best practice for managing feature branches with deployment projects in non production config - should we be creating a new deployment project for every branch, or should we use the same deployment project and create releases from different branches and/or trunk depending on whcih environment we are going to? What is Bamboo best practice for this i.e. 1 deployment project with many releases on different branches + trunk OR 1 deployment project per branch/feature or business project?

Look forward to your response

Cheers,

Paul


Answers:
author: Mike Friedrich
body: I am not deploying yet with bamboo, but your process sounds right.

We use the same with git. The use the prefix "release/" for those branches and keep them forever. We also give them the name of the major release number.

comments: author: Mike Friedrich
body: The process of this basically depends on the projects/products needs. Not all products allow bugfixings on trunks/masters only.
Is there plugins available for Ant and Maven in Bamboo and how to integrate them..?
Asked by Ishan Thapa:

Integration of Ant and Bamboo

Integration of Maven and Bamboo


Answers:
author: Steffen Opel _Utoolity_
body: Bamboo has built-in support for various [builder tasks](https://confluence.atlassian.com/display/BAMBOO/Configuring+a+builder+task), including Ant and Maven (and can be extended with additional ones via add-ons available on the [Atlassian Marketplace](https://marketplace.atlassian.com/plugins/app/bamboo/popular)):
> A builder task allows you to connect your Bamboo plan (or job) to a build tool such as Ant, Maven or MSBuild. The build tool uses its existing configuration when the plan (or job) is built.

Please refer to the dedicated [Ant](https://confluence.atlassian.com/display/BAMBOO/Ant) and [Maven](https://confluence.atlassian.com/display/BAMBOO/Maven) task documentation for details.
How can I fix "Cannot determine head revision of ... on branch ... Branch has probably been removed"?
Asked by Leandro Iriarte:

I am getting the following exception when trying to pull changes from master branch. How can I fix it?

```
com.atlassian.bamboo.repository.RepositoryException: java.lang.RuntimeException: com.atlassian.bamboo.repository.InvalidRepositoryException: Cannot determine head revision of 'https://bitbucket.org/.../dev' on branch 'release/3.1.2'. Branch has probably been removed.
```


Answers:
author: Leandro Iriarte
body: I don't think so. The error refers to:

```
... on branch 'release/3.1.2'. Branch has probably been removed.
```

The branch 'release/3.1.2' has indeed been removed, but the repository is configured to use master branch. Why is it looking for another one?


author: Jaime S
body: Hi, Leandro.

Check if you're not affected by the following bug:

<https://jira.atlassian.com/browse/BAM-14901>

This happens when branch name and a tag short name are the same. If so, check if changing either helps.

Kind regards,  
Jaime Kirch da Silveira  
Atlassian Cloud Support

comments: author: Jaime S
body: Also, check these two:<https://jira.atlassian.com/browse/BAM-16118><https://jira.atlassian.com/browse/BAM-12684>


Tags: cloud
Please help me to delete the URL from Stash Display URL so that i can link Stash and Bamboo
Asked by Ishan Thapa:

Integration of stash and Bamboo.


Answers:
author: rsperafico
body: Hello Ishan,

Thank you for your question.

I am not sure what are you referring to when mentioned: "*Please help me to delete the URL from Stash Display URL*". The display URL can be defined on:

* Stash administration \>\> Settings \>\> Server settings \>\> Base URL
* Bamboo administration \>\> System \>\> General configuration \>\> Base URL

---

Kind regards,  
Rafael P. Sperafico  
Atlassian Support
while creating build paln in bamboo unable to create stash repository when we clicking the configure plan button it is again going back to login page of bamboo.
Asked by susanta mondal:

after linking of stash and bamboo.  
[](https://community.atlassian.com/t5/Bamboo-questions/while-creating-build-paln-in-bamboo-unable-to-create-stash/qaq-p/429110?attachment-id=1439){#link_1168552b34d196}  
[](/tnckb94959/attachments/tnckb94959/bamboo-questions/13548/1/problem4.PNG){#display_1168552b34d196_0}


Answers:
author: rsperafico
body: Hello Susanta,

Thank you for your question.

Could you let us know what is the URL used to hit Bamboo and Stash on your web browser, please? (*i.e.: for Bamboo - <http://localhost:8085> and for Stash - <http://localhost:7990>*). If the example provide is what you have, this would explain the necessity of log back in to Bamboo.

Basically, Bamboo and Stash create a cookie that holds login information. However, cookie does not hold port number information so if you log in to Bamboo and later log in to Stash, the next time you access Bamboo, you will be prompted to log back in as the cookie has only the latest login information, in this case Stash.

In order to bypass that, you would be required to add a **Context path=""** to Bamboo (*\<bamboo-install\>/conf/server.xml* ) and Stash (*\<stash-install/conf/server.xml*\>)

```
&lt;Context path="/bamboo" docBase="${catalina.home}/atlassian-bamboo" ...?&lt;Context path="/stash" docBase="${catalina.home}/atlassian-stash" ...
```

Now, you would hit Bamboo and Stash on your web browser as:

* <http://localhost:8085/bamboo>
* <http://localhost:7990/stash>

It will be required to:

1. delete the application link
2. stop Bamboo and Stash
3. update Context Path in both *server.xml* files
4. start Bamboo and Stash
5. update Bamboo Base URL (*Bamboo administration \>\> System \>\> General Configuration \>\> Base URL* ) to and <http://localhost:8085/bamboo>
6. update Stash Base URL (Stash administration \>\> Settings \>\> Server settings \>\> Base URL) to <http://localhost:7990/stash>
7. recreate application link

---

Kind regards,  
Rafael P. Sperafico  
Atlassian Support


author: Peter Van de Voorde
body: Hi Susanta,

Could you take a look in the bamboo log file to see if you get any error message?

the log file can be found in the logs directory of your Bamboo home directory.

This looks like a configuration issue.

Cheers,  
Peter
Bamboo Docker task(daemon) failed to execute "mkdir" command
Asked by Fahd:

Error:

```
build	11-Aug-2015 15:40:07	Sending build context to Docker daemon error	11-Aug-2015 15:40:07	time="2015-08-11T13:40:07Z" level=fatal msg="Error: mkdir /mnt/docker/tmp/docker-build261033587: no such file or directory" simple	11-Aug-2015 15:40:07	Failing task since return code of [/usr/bin/docker build --force-rm=true --tag="bamboo/XXXXX-XXXXX:221" /home/bamboo/bamboo-agent-home/xml-data/build-dir/XXXX-BUILD-JOB1/application/build/distributions] was 1 while expected 0
```

This is executed in EC2 instance using Atlassian Ubuntu stock image. Restarting Docker service manually in SSH session seem to fix the problem in that running EC2 instance.


Answers:
author: Michael Van Diest
body: You can actually just do the following in the **Instance Startup Script**:

```
$ sudo /etc/init.d/docker restart
```

Not sure why the docker service doesn't come up properly on it's own. But adding this fixed my issue.

comments: author: reiner
body: Thank you! I forgot to come back to this issue and add this step to the instance startup script entry to my answer.


author: reiner
body: By following [these steps](https://confluence.atlassian.com/display/BAMBOOCLOUD/Configuring+the+Docker+task+in+Bamboo) (all the way at the bottom of the page) in the Bamboo instance:

```
sudo -i#stop the docker daemonservice docker stop#remove the broken devicemapper filesrm -rf /var/lib/docker service docker start
```


author: Dan DeMaggio
body: Have the same problem. Seems to be in the way they remount /home to be the ephemeral drives. Docker containers see the empty /home that is "underneath" the mounted /home that has bamboo stuff on it. Very annoying.


author: reiner
body: My Docker task also failed to executed the "mkdir" command.


author: Michael Van Diest
body: Just started having the same problem. Even after launching a few new ec2s. Is this an ubuntu issue? Did the AMI for ubuntu change recently introducing this issue? Not sure...


Tags: cloud

docker
Merge 2 Bamboo Servers
Asked by John Bowker:

We have 2 Bamboo servers running separating in our organisation and we want to merge all the projects into 1 Bamboo servers.

The servers run different projects and the Export/Import model in Bamboo looks like it will wipe out project configurations on the target server.

Is there a way to cherry pick the projects to export and import in Bamboo?


Answers:
author: Przemek Bruski
body: No simple way. Copying the data manually or engaging an Atlassian expert are your only options.


author: Bob Swift (personal)
body: You might want to consider turning your plans into scripts - see [Plan Creation Scripting](https://bobswift.atlassian.net/wiki/display/BCLI/Plan+Creation+Scripting) (part of [Bamboo Command Line Interface (CLI)](https://bobswift.atlassian.net/wiki/display/BCLI) support). They could then be applied to other Bamboo instances. That has other benefits, but, it would still take a lot of time depending on your situation.


Tags: bamboo-administration

export

import
Bamboo : how to allow manual jobs/stages selections when running a plan
Asked by Hussain Misbah:

Hello everyone,

I need some help, I am trying to create a plan and be able to use custom run to select only the jobs or stages that I want to run, currently with Bamboo 5.7.2, the stages need to be sequential , this means when I select stage 5, all previous stages will be automatically select . I can not for example select to run stage 1 and stage 3 but not stage 2.

with a custom run, I like how manual stages are displayed in check boxes list to allow the user to select what stages to run, but unfortunately the way it is does not allow me to freely deselect a stage in the middle.

plan variables seems like one option but they are not displayed nicely as the stages,

in a custom run, all stages will be displayed in checklist box.

but variables will need to be added manually using a drop down list and then a value need to be passed.

can any one help me ? is there a different way to implement what I need ?


Answers:
author: Daniel Wester
body: What you're running into is per design. Bamboo's stages are sequential so you can't run things out of order. If you're wanting to do something out of order you'll probably want to break the build into multiple builds (and use a deployment project at the very end).


author: Hussain Misbah
body: Thanks Daniel for your suggestion , I thought of this solution but it is not efficient or friendly in my case because I will have to create over 20 deployments plans. and every time I will need to run them one by one.

I don't know if there is away to hack this forced sequential stages.

but I will start looking at developing custom plugins , this does not look like a simple task but I need a good solution .


Tags: bamboo-administration
How to access SolutionDir from post build event in bamboo?
Asked by JeffreyM:

Does anyone know how to access Solution Variables such as "$SolutionDir" from VS in bamboo? You cannot define a custom variable in bamboo = to SolutionDir so I am stuck. Any ideas please.


Answers:
author: JeffreyM
body: What I am attempting is to get the value to $(SolutionDir) from the post build event that is defined in the .csproj file. What happens is that when the post build steps goes to run in bamboo the $(SolutionDir) is not defined so when bamboo tries to use that variable it has no value so it actually substitutes an extra ../ to the path and the .file that is trying to be copied is not found.

Since Bamboo only allows alphanumeric variables I cannot predefine $(SolutionDir) in bamboo which should be changed in my opinion. As a result the build fails and reports an unsuccessful status. I know I can modify the .csproj file but that defeats the purpose of the $(SolutionDir).


author: Mike Friedrich
body: The variable itself cannot be used in bamboo, but you can hardcode the solutiondir by using the workspace directory and the relative file of you sln. Or you can define a bamboo variable and use that as a environment variabe. VS allows you to use environment variables with the $() syntax.

comments: author: Mike Friedrich
body: But please explain why you need that. Maybe there is another way of achieving the same.
EOF while expecting response to protocol message. Additional info: `scp: Failed to open file '/home/
Asked by Shree:

**net.schmizz.sshj.xfer.scp.SCPException: EOF while expecting response to protocol message. Additional info: \`scp: Failed to open file '/home/**

<br />

Please advice how to give remote path for SCP task in Bamboo


Answers:
author: rsperafico
body: Hello Shree,

Thank you for your question.

I have noticed you have raised the same question on:

* <https://answers.atlassian.com/questions/24282598>
* <http://stackoverflow.com/questions/27696656/bamboo-scp-plugin-throwing-exception-when-sending-multiple-files>

Please, notice according to our documentation [Using the SCP task in Bamboo](https://confluence.atlassian.com/display/BAMBOO/Using+the+SCP+task+in+Bamboo), the **Local Path** is *relative to the Bamboo working directory*.

In Bamboo, could you please confirm the **Job** where the SCP is configured has been set up to run on a Windows agent.

Could you please open up **Command Prompt** and attempt on copying "*D:\\Users\\Administrator\\bamboo-home\\xml-data\\build-dir\\688129-884737\\TestCopy.txt* " to "*D:\\Test_deploy*" by running:

```
scp -v "D:\Users\Administrator\bamboo-home\xml-data\build-dir\688129-884737\TestCopy.txt" "D:\Test_deploy"
```

---

Kind regards,  
Rafael P. Sperafico  
Atlassian Support
Bamboo: Error occurred while saving build results. Reindex failed.
Asked by Mark de Bont:

We are running Bamboo 5.9.1. on Windows and get the following error on some jobs :

*Error occurred while saving build results. Reindex failed.*

```
Caused by: java.sql.SQLException: Transaction (Process ID 126) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.	at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:372)	at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2894)	at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2334)	at net.sourceforge.jtds.jdbc.TdsCore.getNextRow(TdsCore.java:777)	at net.sourceforge.jtds.jdbc.JtdsResultSet.next(JtdsResultSet.java:596)	at com.mchange.v2.c3p0.impl.NewProxyResultSet.next(NewProxyResultSet.java:2859)	at org.hibernate.loader.Loader.doQuery(Loader.java:825)	at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)	at org.hibernate.loader.Loader.loadCollectionBatch(Loader.java:2204)
```

What is causing this condition?

It's a annoying since we have to manually restart build to resolve this condition. It typically seems to be generated on off the local agents.


Answers:
author: Mark de Bont
body: The error message is generated in the build plan. So what typically happens is that the build fails. I go to the related job and the error is shown in the Job Summary. See the attached screenshot. Since I am not creating database transaction, other then running builds, it must be Bamboo itself creating the deadlocks.

image2015-8-11 8:20:17.png

[](https://community.atlassian.com/t5/Bamboo-questions/Bamboo-Error-occurred-while-saving-build-results-Reindex-failed/qaq-p/51670?attachment-id=9802){#link_116855c62d35dc}  
[](/tnckb94959/attachments/tnckb94959/bamboo-questions/1569/1/image2015-8-11%208%3A20%3A17.png){#display_116855c62d35dc_0}


author: Jaime S
body: Hi, Mark.

I didn't get if this problem is happening in Bamboo or in the build you're running. That changes things.

If it's a problem in the build, you should check for any database transactions you're creating. Something there is causing a deadlock.

Either way, I found a KB for Confluence with a similar problem. Since it's a Confluence problem, it may not apply to this situation, but may help you better understand the problem.

<https://confluence.atlassian.com/display/CONFKB/Database+deadlock+on+Microsoft+SQL+Server>

Kind regards,  
Jaime Kirch da Silveira  
Atlassian Cloud Support


Tags: bamboo-administration
Integration of Bamboo with Stash
Asked by Ishan Thapa:

how to integrate bamboo with stash

what is the plugins required for the integration.


Answers:
author: rahuldanwade
body: Hi @Ishan Thapa

please refer my previous answer for Bamboo and JIRA integration

<https://answers.atlassian.com/questions/24283607/answers/24283629?flashId=-987736863>

only thing is instead instead of bamboo URL this time use Stash base URL.

comments: author: Ishan Thapa
body: hi sir we tried to link both stash and bamboo we did also but we gave the wrong URL of bamboo now we want to delete the URL from Display URL but we are unable to delete the URL please suggest us how to delete the URL from Display URL of Stash


Tags: cloud
Integration of Bamboo with Jira
Asked by Ishan Thapa:

how to integrate bamboo with JIRA

what is the plugins required for integration


Answers:
author: rahuldanwade
body: Hi Ishan,

Configuring Bamboo and JIRA to work together simply requires you to set up an application link (two-way) between JIRA and Bamboo.

1. go to JIRA Application links with administration login(press g+g and type application link)
2. copy Bamboo server base URL into application link in box in JIRA
3. click on create link

doing this it will redirect you from JIRA to bamboo instance and vice versa to create reciprocal link

for reference follow this link

<https://confluence.atlassian.com/display/BAMBOO/Integrating+Bamboo+with+JIRA>


Tags: cloud
Failed Build Log has issue with "com.sun.org.apache.xerces.internal."
Asked by Shijit Dasgupta:

Is there a reference I am missing? My java programs refer to multiple of these and there is writing in red about this.

First Time troubleshooting a failed build so help would be appreciated.

This happens when we run it with the unit tests.


Answers:
author: Shijit Dasgupta
body: Sorry for the late response but it turns out a file was misnamed in the resources folder. Thanks!


author: Alexey Chystoprudov
body: It's not enough information to help you. Does tests run correctly when executed from command line? What JDK and Bamboo versions you have?
file not copying to remote server
Asked by Shree:

it shows message like

Executing \[scp -v "D:\\Users\\Administrator\\bamboo-home\\xml-data\\build-dir\\688129-884737\\TestCopy.txt" "D:\\Test_deploy"\]

but not processing further operations

Now i am getting below error :

net.schmizz.sshj.xfer.scp.SCPException: EOF while expecting response to protocol message. Additional info: \`scp: Failed to open file '/home/


Answers:
author: Jaime S
body: Hi, there.

Are you running that on a plan task?

Maybe you'll be better able to troubleshoot this problem if you log to the machine it's being run in and run it yourself. You may get some error message.

Kind regards,  
Jaime Kirch da Silveira  
Atlassian Cloud Support

comments: author: Shree
body: I am running SCP task for uploading file


author: Shree
body: server application freeSSHd and version 1.3.1


author: Alexey Chystoprudov
body: What is SSH server application and version at remote server?