youngmon/atlassian-qna huggingface dataset:
how do I know how my build plan was triggered: manually or automatically (night)?
Asked by e:

Hello, I am using Bamboo 5.4.2

How do I know how my build plan was triggered: manually or automatically (night)?

I want to write a script that will react accordingly, depending on whether the build was started manually or automatically (scheduled).

I expect there to be some kind of a variable like ${bamboo.triggered.by}, which sets to "manually", "scheduled", "child".

Please advise.


Answers:
author: Jason Monsorno
body: ```
${bamboo.ManualBuildTriggerReason.userName}
```

It's only populated on manual builds but can be used as a flag in a script or something.

[](https://confluence.atlassian.com/display/BAMBOO/Bamboo+variables)<https://confluence.atlassian.com/display/BAMBOO/Bamboo+variables>

<br />


author: Timothy
body: <https://jira.atlassian.com/browse/BAM-13030>

comments: author: e
body: All right, if it's not a variable, then how can I know if the build was triggered manually?


author: rsperafico
body: Hello,

Thank you for your question.

You could use the follwing REST API call:

```
# URI result/PROJECTKEY-PLANKEY# (where PROJECTKEY-PLANKEY is the key of the desired build plan of a project, e.g. MYPROJ1-MYPLAN1)http://&lt;bamboo-baseURL&gt;/rest/api/latest/result/MYPROJ1-MYPLAN1?expand=results.result.buildReason
```

Please, refer to Bamboo REST Resources for further information.

In the XML response, please search for the \<buildReason/\> tag. You might find the follwing:

```
&lt;!-- Initial build --&gt;&lt;buildReason&gt;First build for this plan&lt;/buildReason&gt;
```

```
&lt;!-- Manual build --&gt;&lt;buildReason&gt;Manual run by &lt;a href="http://BAMBOO-BASEURL/browse/user/admin"&gt;Administrator&lt;/a&gt;&lt;/buildReason&gt;
```

```
&lt;!-- WebHooks --&gt;&lt;buildReason&gt;Changes by &lt;a href="http://BAMBOO-BASEURL/browse/user/admin"&gt;Administrator&lt;/a&gt;&lt;/buildReason&gt;
```

```
&lt;!-- Scheduled --&gt;&lt;buildReason&gt;Scheduled&lt;/buildReason&gt;
```

```
&lt;!-- Dependency (Child of) --&gt;&lt;buildReason&gt;Child of &lt;a href="http://BAMBOO-BASEURL/browse/PROJECTKEY-PLANKEY-BUILDNUMBER"&gt;PROJECTKEY-PLANKEY-BUILDNUMBER&lt;/a&gt;&lt;/buildReason&gt;
```

Kind regards,  
Rafael


author: e
body: Thanks a lot!


Tags: bamboo-administration
Sharing artifacts between build plans
Asked by Kody Ensley:

Recently upgraded to Bamboo 5.5 for the "Sharing artifacts between build plans" feature.

Not sure if I'm missing something, but this is the layout.

Plan A has run and generated an artifact.

Plan B (the new one I'm trying to setup) has the step "Artifact Download" added. However, when I click the "Source Plan" drop down list, Plan A is not listed. In fact, 80% of our plans are not listed.

Is there another configuration setting in Plan A that needs to be set?

Thank you.


Answers:
author: Ron Chan
body: Try typing into the text box. Available build plans should appear with each matching keystroke.

comments: author: Kody Ensley
body: Yes, this seems to be the answer. I contacted atlassian support and they stated it is a known bug that only some of your plans will poulate the dropdown box. Thank you for your time Ron Chan.


Tags: bamboo-administration
Bamboo unable to get changes from Git: permission denied
Asked by RAPID Capability:

My bamboo installation recently just started to show system errors connecting to my stash installation.I'm using password based authentication, and I've verified that the password is correct. I've also tried to execute the command manually under the same user and had no issues. The abridged error is

/usr/bin/git ls-remote [https://BambooUser:\*\*\*\*\*\*\*\*](https://BambooUser:********%40xyz.c)@xyz.c

om/stash/scm/my/repo.git failed with code -1. Working directory was \[.\]., stderr: \[\]

The only thing I can think of is that there's an issue with the directory it's trying to execute this in, but I don't know where that is to check for permission issues or something of the sort. I tried several places when I ran it manually, one of them being /tmp, so I don't think there's any issues with the permissions or anything on that directory, but I'm not ruling out me being ignorant of something.

It now appears that Bamboo is seeing changes, but I'm still getting these messages. Is this expected, or is something not working correctly?


Answers:
author: rsperafico
body: Hello,

Thank you for your question.

Could you go to the **log4j.properties** file located in the {{*\<bamboo-install\>/atlassian-bamboo/WEB-INF/classes/* }} directory and change the 2 lines below from {{*WARN* }} to {{*DEBUG*}}:

```
log4j.category.com.atlassian.bamboo.plugins.ssh=WARNlog4j.category.com.atlassian.bamboo.ssh=WARN
```

Also add this extra line:

```
log4j.logger.com.atlassian.bamboo.plugins.git.GitRepository=DEBUG
```

If the {{*Build* }} is run from a {{*Bamboo remote agent* }}, the debug logging can be done by copying the formatted **log4j.properties** file from the Bamboo local agent (*Server* ) to the Bamboo remote agent (*Remote*) home.

The above will provide you extra information about your repositories and its connectivity.

Open {{*\<bamboo-home\>/xml-data/build-dir/_git-repositories-cache*}} directory and detele its content.

Stop all Bamboo instances (local and remote).

Start Bamboo.

Also as a side note, could you please create a sample test plan with Stash as the repository type and lets know if this works.

---

Kind regards,  
Rafael


Tags: bamboo-administration
Import configuration: Duplicate entry for key 'AUTHOR_NAME'
Asked by Guillaume Lucazeau:

Hello,

I've exported my configuration from Bamboo 4.4.5 and I'm trying to import it to another one, but I get this error:

org.springframework.dao.DataIntegrityViolationException: Hibernate operation: could not insert: \[com.atlassian.bamboo.author.AuthorImpl#17235970\]; SQL \[\]; Duplicate entry 'firstname Lastname' for key 'AUTHOR_NAME'; nested exception is java.sql.BatchUpdateException: Duplicate entry 'firstname Lastname for key 'AUTHOR_NAME'

I tried to look at the file db-export/authors.xml in my exported archive but I see only one entry. Could it be an issue with the Source Repository Aliases?

Thank you for your help,

Guillaume


Answers:
author: klippo
body: We had the same problem, for us it was solved by setting collation to utf8_bin.


author: Guillaume Lucazeau
body: I have twice the same entries except one has a capital for the first letter of the firstname, and the other is a lower case. I guess it comes from here, I'll try to spot the difference in the MySQL configuration...


Tags: bamboo-administration
Bamboo wont start: ERROR [Finalizer] [FelixOsgiContainerManager] JarContent: Unable to read bytes
Asked by Stickyeyes:

Our copy of Bamboo will no longer start. Checking $BAMBOO_HOME/logs/atlassian-bamboo.log contains this exception (the first before a couple more and then bamboo shuts itself down):

I really need to get this fixed as we need to push live today! Argh!

2014-06-30 10:19:00,797 ERROR \[Finalizer\] \[FelixOsgiContainerManager\] JarContent: Unable to read bytes.

java.lang.IllegalStateException: zip file closed

at java.util.zip.ZipFile.ensureOpen(ZipFile.java:634)

at java.util.zip.ZipFile.getEntry(ZipFile.java:305)

at java.util.jar.JarFile.getEntry(JarFile.java:226)

at org.apache.felix.framework.util.JarFileX.getEntry(JarFileX.java:61)

at org.apache.felix.framework.cache.JarContent.getEntryAsBytes(JarContent.java:120)

at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.findClass(ModuleImpl.java:1738)

at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:716)

at org.apache.felix.framework.ModuleImpl.access$200(ModuleImpl.java:73)

at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1690)

at java.lang.ClassLoader.loadClass(ClassLoader.java:358)

at org.apache.http.impl.conn.PoolingClientConnectionManager.shutdown(PoolingClientConnectionManager.java:284)

at org.apache.http.impl.conn.PoolingClientConnectionManager.finalize(PoolingClientConnectionManager.java:121)

at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method)

at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:101)

at java.lang.ref.Finalizer.access$100(Finalizer.java:32)

at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:190)


Answers:
author: Stickyeyes
body: Thankfully we run our servers on VMWare. I was unable to resolve this issue so in the end had to revert to a previous snapshot from last week. Not ideal and not an option available to everybody, but it did resolve the issue for us.


author: Stickyeyes
body: I've deleted the cache directories and restarted Bamboo, but to no avail; still the same messages output to the log. I read online that Bamboo has a safe mode that will start it without any user installed plugins, but I can't find how I would start bamboo in start mode from the command line. Any suggestions?


Tags: bamboo-administration
Shared checkout?
Asked by Matt Stafford:

I'm currently evaluating Bamboo for game development purposes. One of the big concerns I have is the artifact sharing and the speed \& efficiency of it for deployment.

A full build of a game can run into several gig in size, and the idea of checking out and compiling code and sharing THE ENTIRE CHECKOUT as an artifact to the next stage feels really inefficient to me.

Is there something I'm missing for how to handle this? The general idea is that for a standard build we just want to compile and commit binaries, but a deployment needs additional steps that I'd like to have as a separate (and perhaps manually triggered) stage/job.


Answers:
author: Przemek Bruski
body: In Bamboo 5.6, you'll be able to dedicate agents to builds, in this way all jobs will run on the same agent and they could share the build directory.


author: Przemek Bruski
body: Do you need the full checkout in the subsequent stages? Maybe you could share just the binaries?

comments: author: Matt Stafford
body: Yes, we do need the full checkout, because it contains all of the assets required to deploy the product.


Tags: bamboo-administration
How do I make a job resolve its maven dependencies with artifacts from previous jobs in the same plan
Asked by Dan Rumney:

The documentation out there is unclear about whether this is even possible.

Can I configure a Bamboo plan, such that maven dependencies are resolved (were appropriate) via artifacts from a previous job, in a different stage?

I need to be able to do this so that my branch builds don't cross contaminate one another. Is this possible?


Answers:
author: Dan Rumney
body: I ended up following a variation on this: [](http://twasink.net/2013/11/18/building-dependent-maven-projects-in-bamboo/)<http://twasink.net/2013/11/18/building-dependent-maven-projects-in-bamboo/>

In short, I grabbed the asset from the previous job, installed it into my build agent's local repo, ran my tasks and then manually purged it from the agent's repo. That worked just fine.


author: rsperafico
body: Hi Dan,

Thank you for your question.

You could add the full path to the artifact you want to use.

Kind regards,  
Rafael


Tags: maven
Broken pipe when attempting to publish artifact
Asked by David Schlesinger:

I'm attempting to publish an artifact from my remote agent to bamboo (version 5.5.1) using bamboo's artifact publisher. The build completes correctly up until the artifact publish step.

I have been seeing the following error (taken from the remote agents logs):

```
Connection has been shutdown: javax.net.ssl.SSLException: java.net.SocketException: Broken pipe
```

I can't seem to find any information on what would cause this error.

Thanks


Answers:
author: Przemek Bruski
body: Which URL does your agent use? If it's the reverse proxy URL, you may want to point directly at Bamboo's Tomcat URL.

comments: author: David Schlesinger
body: It's a reverse proxy URL (running Nginx) and actual bamboo is on localhost. It would require a lot of configuartion changes otherwise.

Is it unusual to run bamboo behind a proxy? I seems like this would be a very common issue.


author: Przemek Bruski
body: It's not unusual. But you won't find out if it's an issue with the proxy unless you reconfigure. Nginx versions quite often doesn't support full HTTP/1.1 . Some configuration options may prevent hte publishing from working too.

How about installing a different proxy then? For example, Apache?


author: Daniel Wester
body: You can use nginx (I've done it) - I believe that the issue is that nginx strips out the Content-Length so you'll need to allow that header through. Your best bet would be to take a look at the nginx error logs and the bamboo server logs at the same time. One of them should tell you which header is missing.


author: David Schlesinger
body: I managed to fix the issue by pointing directly to <http://brokerURL:8085/agentServer>rather then <https://brokerURL/agentServer>

Thanks for the help.


author: Razvan Grigore
body: If you want to keep your nginx reverse proxy, like we did, because of SSL offloading, you need to add this to your config:

client_max_body_size 1G;

The size depends on the artifacts size you have.


Tags: artefact

ssl
Anyone else get SPDE when accessing injected BambooUserManager in a Bamboo Plugin Task Configurator?
Asked by Dana Cleveland:

This plugin worked fine on Bamboo 5.4.x. I have recently upgraded to 5.5. After a people fills out a form on this task, The TaskConfigurator attempts to access the BambooUserManager to retrieve user information to save for the actual Task.

No I'm getting

2014-06-26 22:51:42,111 ERROR \[ajp-bio-8009-exec-56\] \[FiveOhOh\] 500 Exception was thrown.

org.springframework.osgi.service.importer.ServiceProxyDestroyedException: service proxy has been destroyed at org.springframework.osgi.service.importer.support.internal.aop.ServiceDynamicInterceptor$ServiceLookUpCallback.doWithRetry(ServiceDynamicInterceptor.java:105)  
..

..

..

at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)

at com.sun.proxy.$Proxy944.getBambooUser(Unknown Source)


Answers:
author: Henrik Opel _Utoolity_
body: Yes, we just encountered such issues when using injected dependencies in Bamboo TaskConfigurator implementations in our own plugins. The problem does not seem to be tied to usage of a BambooUserManager dependency, rather any injected dependency from the host product will do.

As far as [our current analysis goes](https://jira.atlassian.com/browse/BAM-14801?focusedCommentId=622431&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-622431 "BAM-14801 analysis"), this is not tied to a specific Bamboo version, but triggered by a Disable/Enable cycle of the related Spring/OSGi contexts.

If our analysis is correct, you should be able to trigger the issue again by simply disabling and enabling the plugin once via UPM. A complete reinstall of the plugin fixes it again.

We reported this as a (likely) [bug in Bamboo (BAM-14801)](https://jira.atlassian.com/browse/BAM-14801 "BAM-14801"), and we have come up with [a possible workaround](https://jira.atlassian.com/browse/BAM-14801?focusedCommentId=622455&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-622455 "Possible workaround"), but are waiting for confirmation of both the bug as well as the validity of our workaround.
Installing Plugin 1 type
Asked by Kyle Nicholls:

I'm trying to install a version 1 plugin (Artifactory specifically) into bamboo 5.5.1 (running on CentOS). I do not have this directory: $BAMBOO_INSTALLATION_HOME/webapp/WEB-INF/lib

These are the only dirs that show up in my bamboo installion directory:

atlassian-bamboo conf logs README.txt tomcat-docs

bamboo.sh lib NOTICE scripts webapps

bin licenses README.html temp work

I also tried copying the jar into $bamboo_home/plugins. The plugin shows up but is disabled.


Answers:
author: Daniel Wester
body: I would stay away from p1 plugins if at all possible. They can cause conflicts and a lot of headache (they're loaded into the main classloader).

You'll want to put it in atlassian-bamboo/WEB-INF/lib


Tags: bamboo-administration
[elasticbamboo.pk doesn't provide access to the elastic instance using ssh]
Asked by Alexandre Honorat:

Hello,

Whenever I start a new elastic instance in bamboo, the instance does run but its agent's state remains pending. Then when I try to establish an ssh connexion to the instance with the provided elasticbamboo.pk, the access is denied and I don't understand why. From AWS, I can only see this instance running.  

I've tried several AMI, the last one is an Ubuntu 14.04 64-bits, running on a M3 instance type: ami-cb4986bc. I am currently trying to use the free version of Atlassian Bamboo On Demand.

Thanks,  

Alex H.


Answers:
author: Przemek Bruski
body: Delete the elasticbamboo key pair using AWS console and try again.


author: Alexandre Honorat
body: Ok it works now. Thanks.


Tags: aws

elastic
Having Trouble with getArtifact
Asked by Steven Bergstein:

I'm trying to use the Bamboo CLI (I've tried v2.6.0 and v3.2.0) to retrieve an artifact. We've used the getArtifact action before, but I just created a new build (by cloning a job from which we were able to get an artifact) job to use it with. In order to verify that I have the basics correct, I executed the following successfully:

*bamboo --action getLatestBuildNumber --build \<my-clients-name\>-VADI --server https://\<server\>/builds--user \<username\> --password \<password\> -v*

When I try to get the artifact with a command like this:

*bamboo --action getArtifact --file VCARS-1.0.0.war --build \<my-clients-name\>-VADI --artifact VCARS-1.0.0.war --server https://\<server\>/builds--user \<username\> --password \<password\> -v*

I consistently get this response:

*URL requested: https://\<server\>/builds/rest/api/latest/result/\<my-clients-name\>-VADI/2?os_authType=basic\&expand=artifacts*   
*Request type: GET*   
*Content type: application/xml*   
*Using basic authentication.*   
*Response code: 200, message: OK, url: https://\<server\>/builds/rest/api/latest/result/\<my-clients-name\>-VADI/2?os_authType=basic\&expand=artifacts*

*Remote error: Could not find artifact 'VCARS-1.0.0.war'*   
*org.swift.common.cli.AbstractRemoteClient$RemoteRestException: Could not find artifact 'VCARS-1.0.0.war'*

I can see that the artifact exists as part of the latest build (and I've tried specifying the build number to no avail).

Help!


Answers:
author: Steven Bergstein
body: It seem that the --job qualifier is required. When I added --job JOB1, it started working.
InvalidSnapshot question
Asked by Kaia Cornell:

I am trying to run my normal Bamboo plan, but today I received the following error(s):

Elastic Bamboo Error : *Error during creation of EBS volumes for image configuration \[Default Image EBS x86_64 (linux)\]*

...

AWS Error Code: InvalidSnapshot.NotFound, AWS Error Message: Snapshot does not exist

What's going on?

Thanks!

Kaia.


Answers:
author: Kaia Cornell
body: Hi there,

The snapshot is still avaialbe. I have no access to the AWS console. Please see the support thread for all previous advice and trial information regarding this issue.

Thanks!

Kaia.


author: Przemek Bruski
body: is the snapshot still available? Do you see it in the AWS console? Is it in the correct region with correct permissions?


Tags: cloud
How to point particular Java version for Bamboo While Installation
Asked by Firoz Khan:

HI Team,

I have jdk1.8 in my windows 2008 R2 server but bamboo will support only Jdk1.7 .It is not possible to uninstall jdk 1.8 from my server.I thought of installing jdk1.7 in the server.

My doubt is how can i make Bamboo to point to that particular java version 1.7 at Installation time.

Please provide me solution if any

Thanks in advance.

Regards,

Firoz Khan.


Answers:
author: Peter Van de Voorde
body: Hi Firoz

Before running the Bamboo start command to start the installation you should edit the setenv.sh file in your \<Bamboo Installation Directory\>/bin directory.

Here you can set your JAVA_HOME variable to your java version 1.7 install.

Best regards,

Peter
Is there a way to have an admin for user group that is not the workspace admin?
Asked by T Smith:

I have multiple user groups that have different permissions for different repositories.

Is there a way to allow specific users within a user group to be an admin of just that user group (i.e. they can add or remove users) without giving them admin access to the workspace (i.e. all the user groups within that workspace)?

Thanks,  
T


Answers:
author: Fabio Racobaldo _Herzum_
body: Hi [@T Smith](/t5/user/viewprofilepage/user-id/2365821) ,

you can't elect an admin with a group. My suggestion is to create two different groups, one for developers and another one for admins.

On Bitbucket, just a project/repo admin can update user permissions <https://support.atlassian.com/bitbucket-cloud/docs/grant-repository-access-to-users-and-groups/>

Hope this helps,

Fabio

comments: author: T Smith
body: Thanks for your response. I have the two groups that you mentioned, but I would like the members of the admin group to be able to add / remove members of the non-admin group (so that I don't have to do this for several group and repositories).

It seems like this cannot be done (yet).

Thanks!  
T


Tags: bitbucket-cloud

cloud
Running tests after deployment best practices
Asked by Brendon Parker:

I see questions for this related to bamboo. But I'm using bitbucket cloud.   

What is the best process for running integration tests post-deployment? Should that be in the deployment step/script? Or a build step that runs after the deployment in the pipeline? Is it even possible to run a build step after a deployment step? If so, how do I make sure I don't run another deployment while the build(tests) are running.   

I'm thinking it makes most sense to run the tests as a part of the deployment step, as then the deployment can pass/fail as a whole. Also keeps deployments in other pipelines for the same environment from running.   

looking for confirmation on this approach or other ideas.   

Thanks!


Answers:
author: Ankit Gupta
body: Hey Brendan,

Environment in Bitbucket is defined at a step level unfortunately, previously I have worked with Gitlab which did not have this limitation.

As per <https://support.atlassian.com/bitbucket-cloud/docs/deployment-concurrency-control/> the deployments are paused if there is one running for the environment.

So it makes sense to add them in the same script and not as a separate step.

*** ** * ** ***

Also, generally one should run the tests before the deployment happens, is there a reason there is a post-deployment test run? If that fails would you rollback?

Or by deployment you mean just the build process?


Tags: bitbucket-cloud

bitbucket-pipelines

cloud

deployment
How to get email notifications for changes to a specific branch only, not the whole repository ?
Asked by Lars Brenk:

The problem with bitbucket is that we get notification emails on commits to ALL branches not specific ones.  
That spams the inbox with changes made to the other 30-50 branches active in the repository, and you cannot see the actual important emails you desire!


Answers:
author: Chris Mann
body: I'd really like to have the branch name included in the email - otherwise the email notification becomes utterly useless when there are multiple branches.

Used to use notifyr for our on-prem bitbucker server, but being forced to the cloud has meant we cannot use that anymore.


Tags: bitbucket-server

branch

notification

server