youngmon/atlassian-qna huggingface dataset:
Elastic Bamboo - Instance schedules not working
Asked by Matthew Tiffany:

I set up some Instance schedules to maintain a certain number of agents. However the schedule never actually starts up any agents.

![image.png](/t5/image/serverpage/image-id/37982iADC02C754F2194CD/image-size/large?v=v2&px=999 "image.png")


Answers:
author: Matthew Tiffany
body: Apparently this was an issue with hibernate that is fixed in 6.6.3.
ssh-task shows command not found while running on connected server
Asked by kswati:

I am using ssh-task in deployment job, this ssh-task is connected to server with ubuntu user where kubectl command are running.

When I am running same command directly on server, it working but when I am running it using job its showing command not found.

Is this due to ssh-task?


Answers:
author: Daniel Santos
body: Hi [@kswati](/t5/user/viewprofilepage/user-id/2139726),

It is possible that your problem is not Bamboo related but a constraint on how an SSH command is run.

A command running with SSH does not get the same environment variables as if it was run with a logged in user on terminal. The reason is that we have a non-interactive terminal instead of an interactive one.

You should see completely different results from

Env as and SSH command:

```
$ ssh user@localhost 'env'
```

Env from terminal:

```
$ env
```

<br />

**Suggestion for troubleshooting**

1. Check if you are able to run the command you need without Bamboo, but sending it through an ssh command line as the command above for 'env'.
2. If you experience the same problem the reason might be a missing environment variable. In this case you will need to source the variable in the SSH command or add the full path to executable.
3. In case you don't reproduce the problem, please send us the SSH task details so we can check them,


Tags: ssh
Accessing plan variables at task creation time (populateContextForCreate())
Asked by attilaerdei:

Hey!

I'm working on a plugin and having a hard time accessing plan variables at task creation.

I can access the variables at task execution with

```
taskContext.getBuildContext().getVariableContext();
```

But can't seem to find a way to do that at task creation time (populateContextForCreate()). Is there any way to do this?

Any help/guidance is appreciated!

Attila


Answers:
author: Marcin Gardias
body: What you are looking for is:

```
VariableDefinitionAccessor.getPlanVariables(PlanIdentifier plan)
```


Tags: atlassian-sdk

bamboo-app
Get revision number from artifacts from another job
Asked by Ernte1893:

Dear Community,

I created a buildjob that uses artifacts from two different buildjobs A and B (therefore, has no own repository). The job itself creates an artifact C that I want to upload to Artifactory (the binary version control tool). So, now I want to create properties that link directly to the revision number of the artifacts. In the buildjobs a and b that create A and B, it can be easily accessed with ${bamboo.repository.revision.number}. However, since I do not checkout any repo and only use the artifacts via the sharing artifact option:

<https://confluence.atlassian.com/bamboo/sharing-artifacts-359400060.html>

the revision.number variable is not an option.

Do you have any suggestions how to get to the required commit hash?

Thx for your help,  
kind regards


Answers:
author: Steffen Opel _Utoolity_
body: You could propagate the ${bamboo.repository.revision.number} variable by means of a secondary artifact and the [Bamboo Variables task](https://confluence.atlassian.com/bamboo/configuring-a-variables-task-687213475.html), roughly:

1. Dump the variable to a properties file via the [Bamboo Script task](https://confluence.atlassian.com/bamboo/script-289277046.html) in plans A and B, i.e. (from the top of my head) something like:
   * 'echo "plan1hash= $bamboo_repository_revision_number" \>plan1.properties' for Bash
     * the shell specific variable syntax is not well documented - we provide a few examples within the *Environment variables* section of [Using the AWS Credentials Variables task in Bamboo](https://utoolity.atlassian.net/wiki/spaces/IFAWS/pages/42434587/Using+the+AWS+Credentials+Variables+task+in+Bamboo#UsingtheAWSCredentialsVariablestaskinBamboo-Environmentvariables)
2. Share the two property files as secondary artifacts with plan C
3. Download the secondary artifacts from plan A and B in plan C
4. Inject new variables from the two property files in plan C with the [Bamboo Variables task](https://confluence.atlassian.com/bamboo/configuring-a-variables-task-687213475.html)
5. Use the two commit hashes by consuming the variables in your Artifactory upload


Tags: artefact

share
Bamboo Specs: Deployment Projects/Environments in YAML
Asked by Jules Clements:

The reference material provides a guide for the existence of Maven 3, but we have windows and linux build servers, and we want to direct some jobs only to linux, i.e.

"Maven 3" = /opt/apache-maven-3.5.0

What is the syntax for this?


Answers:
author: Chris Berry
body: Hey Jules,

If you wish to control which agents run which jobs then the best way would be to add a custom Capability. Assign the wanted capability to the agent and specify the capability as a requirement for the Job. For example if a remote agent has the custom capability **isWindows**, the YAML spec for the job would have this as a requirement

    stages:  - jobs:      - scripts:          - echo 'i am on windows'        requirements:          - isWindows

Let us know if this helps.

Chris

comments: author: Jules Clements
body: that is what I have done as a work around, but we are wanting to minimise the level of manual/scripted intervention with our agents. Using the values the Bamboo agent calculates would have been preferable.

We have around 200 YAML files so I was hoping to apply a simple bulk update on the existing string, rather than having to add an element into the YAML.
Bamboo build got failed with error: MSB4019 and MSB1009
Asked by Divakar Reddy Matteddula:

When I ran Bamboo build plan, it got failed with errors. Please help to me fix this issue.

Error summary for Default Job

MSBUILD : error MSB1009: Project file does not exist.  
Switch: C:\\Windows\\system32\\config\\systemprofile\\AppData\\Local\\Temp\\NuGetScratch\\corcd4dw.was.nugetinputs.targets  

Project "C:\\Bamboo-Agent-Home\\xml-data\\build-dir\\CRON-DR-JOB1\\RMI.Tests\\RMI.Tests.csproj" on node 1 (default targets).  
C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Professional\\MSBuild\\15.0\\Bin\\amd64\\Microsoft.CSharp.CurrentVersion.targets(322,5): error MSB4019: The imported project "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Professional\\MSBuild\\15.0\\Bin\\Roslyn\\Microsoft.CSharp.Core.targets" was not found. Confirm that the path in the \<Import\> declaration is correct, and that the file exists on disk. \[C:\\Bamboo-Agent-Home\\xml-data\\build-dir\\CRON-DR-JOB1\\RMI.Tests\\RMI.Tests.csproj\]  
"C:\\Bamboo-Agent-Home\\xml-data\\build-dir\\CRON-DR-JOB1\\RMI.Tests\\RMI.Tests.csproj" (default target) (1) -\>  
C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Professional\\MSBuild\\15.0\\Bin\\amd64\\Microsoft.CSharp.CurrentVersion.targets(322,5): error MSB4019: The imported project "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Professional\\MSBuild\\15.0\\Bin\\Roslyn\\Microsoft.CSharp.Core.targets" was not found. Confirm that the path in the \<Import\> declaration is correct, and that the file exists on disk. \[C:\\Bamboo-Agent-Home\\xml-data\\build-dir\\CRON-DR-JOB1\\RMI.Tests\\RMI.Tests.csproj\]


Answers:
author: Chris Berry
body: Hi Divakar,

From the error seen the projects you are trying to import do not exist.

What \<Import\> directives have you set in the RMI.Tests\\RMI.Tests.csproj file?

The issue looks to be that the csproj file is not looking in the correct location for these target files or that the targets have not actually been installed...The issue looks to be similar to the below article and not specific to Bamboo..

<https://stackoverflow.com/questions/47260114/microsoft-csharp-core-targets-missing>

Let us know if this helps..

Chris
Permission denied (publickey) when running git from PowerShell task in a scheduled deployment
Asked by chrispsweeney:

I have a deployment project setup to deploy some code to a web server. When the deployment completes, I run a PowerShell script task that does the following:

\* Clones the repository onto the build server (we're running Bitbucket server internally).

\* Tags the commit.

\* Pushes the tags.

If I run this task by running the deployment project manually everything works. However, if I run the task on a schedule I get:

"Permission denied (public key)" on the clone step.

The private key is on the build server and the public key is setup in Bitbucket. What could I be missing here? Is there a difference between how Bamboo runs a deployment on a schedule versus being kicked off manually?

Thanks.


Answers:
author: chrispsweeney
body: Right as I posted this I realized the problem. I have a remote agent setup that I forgot about. The agent without the private key setup is always running the scheduled deployments for some reason and the local agents are always running the manual deployment.

All I have to do is either add a required capability to the environment, setup a private key on the other agent or setup the dedicated agents on the environment.

Maybe this will help someone who runs into a similar issue.


Tags: deployment

git
Webhook not working as explained
Asked by Dchosen:

Hi there,

I have webhook url created as the document in the Atlassian site. I am able to trigger the Bamboo build with the curl command but it is working from the Jira Service Desk. I have added the JQL Query and tested and then kept all issues and also tested. Can you tell me where to start troubleshooting??

_______________________________________________________________

We have the on-premise Atlassian tools.

Does the custom rule work from the on-premise?

Let me tell you what I am doing. We have the Applications like Jira, confluence, bitbucket and Bamboo linked using oauth. I am trying to trigger a bamboo build when a Jira Service Desk Request is moved to Approve status.

I thought of implementing using the webhook would be the right approach. Let me know if there is anyother way.

For some reason I tried creating the webhook in the Jira \>Systems\>Webhook \& Service Desk \> project setting \> automation \> Rule.

I am not sure why both of them are not working. Please let me know ur inputs.


Answers:
author: Jonathan Schemmel
body: Not sure what you're having troubles with. But if you setup an account on beeceptor, or any other site like that where you setup an endpoint, you can send the webhook event at that and check the JSON response you receive and make sure it lines up with what you're looking for.

comments: author: Dchosen
body: Hi Jonathan,

We have the on-premise Atlassian tools.

Does the custom rule work from the on-premise?

Let me tell you what I am doing. We have the Applications like Jira, confluence, bitbucket and Bamboo linked using oauth. I am trying to trigger a bamboo build when a Jira Service Desk Request is moved to Approve status.

I thought of implementing using the webhook would be the right approach. Let me know if there is anyother way.

For some reason I tried creating the webhook in the Jira \>Systems\>Webhook \& Service Desk \> project setting \> automation \> Rule.

I am not sure why both of them are not working. Please let me know ur inputs.


Tags: jira-software

webhook
What versions of Websphere can Bamboo integrate with?
Asked by Brian Molloy:

I am looking into the Atlassian products but my one main focus is websphere deployments. I currently deploy EARS out to Websphere 6/7/8. Wondering if Bamboo can support all those versions?


Answers:
author: Gonchik Tsymzhitov
body: Hi!

I hope by this type of task you cover everything

[https://confluence.atlassian.com/bamboo/script-289277046.html](https://confluence.atlassian.com/bamboo/script-289277046.html?)

Also, don't forget about capabilities :)

Cheers,

Gonchik Tsymzhitov
Bamboo does not automatically create branch in the plan
Asked by Michal ??pek:

On my current build plan I've checked an option create branch plan when new branch in repository is created and matches expression and set value **hotfix\***

Repository from the Bitbucket is of course linked to this build plan.

**Bitbucket:**

I have created branch named **hotfix/test** in Bitbucket git repository and set Bamboo plan branch.

After several hours branch was not automatically created and I have no idea what do I wrong.


Answers:
author: Michal ??pek
body: I've resolved this by making the following changes:

1. Changed match pattern from **hotfix\*** to **hotfix/.\***   
2. Be also sure, that new hotfix repository you're creating in Bitbucket doesn't have activity older than you've set in other option Delete plan branch - After branch inactivity in repository.
How to run a bamboo plan using bamboo java specs
Asked by Bharath:

I have been trying to use bamboo java specs to run a bamboo plan, but I'm just able to create the plan not run it.


Answers:
author: Chris Berry
body: Hey Bharath,

Yes, Bamboo Specs are for defining the Bamboo plan. To run the plan you can use the REST API. Find the documentation at the following link. [Bamboo REST API](https://docs.atlassian.com/atlassian-bamboo/REST/6.7.1/#d2e4038)

A Curl example to run the Plan $PROJECT_NAME-$PLAN_NAME would be.. as follows.

```
curl --user $BAMBOO_USER:$BAMBOO_PASS -X POST http://mybamboohost:8085/rest/api/latest/queue/$PROJECT_NAME-$PLAN_NAME
```

Let us know if this helps or if you have further questions.

thanks

Chris
Facing issue while running the bamboo plan
Asked by sravani:

```
Error occurred while running Task '(2)' of type com.atlassian.bamboo.plugins.bamboo-docker-plugin:task.docker.cli.error	16-Nov-2018 12:19:57	com.atlassian.bamboo.task.TaskException: Failed to execute taskerror	16-Nov-2018 12:19:57		at com.atlassian.bamboo.plugins.docker.service.RunService.execute(RunService.java:75)error	16-Nov-2018 12:19:57		at com.atlassian.bamboo.plugins.docker.tasks.cli.DockerCliTask.execute(DockerCliTask.java:70)error	16-Nov-2018 12:19:57		at com.atlassian.bamboo.task.TaskExecutorImpl.lambda$executeTasks$3(TaskExecutorImpl.java:288)error	16-Nov-2018 12:19:57		at com.atlassian.bamboo.task.TaskExecutorImpl.executeTaskWithPrePostActions(TaskExecutorImpl.java:221)error	16-Nov-2018 12:19:57		at com.atlassian.bamboo.task.TaskExecutorImpl.executeTasks(TaskExecutorImpl.java:288)error	16-Nov-2018 12:19:57		at com.atlassian.bamboo.task.TaskExecutorImpl.execute(TaskExecutorImpl.java:110)error	16-Nov-2018 12:19:57		at com.atlassian.bamboo.build.pipeline.tasks.ExecuteBuildTask.call(ExecuteBuildTask.java:71)error	16-Nov-2018 12:19:57		at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.executeBuildPhase(DefaultBuildAgent.java:203)error	16-Nov-2018 12:19:57		at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:175)error	16-Nov-2018 12:19:57		at 
```


Answers:
author: Daniel Santos
body: Hi Sravani,

Are you able to see the full docker in the build logs?  
Is there any caused by stack trace there that you could share?  
Is docker installed in the Bamboo server?  
Is just this docker task failing or all of them?
Heap Sizing
Asked by Rafael Valverde:

Hi guys, I would like to know what values I could set in list of system parameters. Guide: <https://confluence.atlassian.com/bamboo0605/administering-bamboo/system-settings/configuring-your-system-properties>


Answers:
author: Daniel Santos
body: Hi Rafael,

I'm assuming you are talking about the min and max heap, so I'll give you my answer to that.  
This is the page we usually recommend: [Bamboo Best Practice - System Requirements - Atlassian Documentation](https://confluence.atlassian.com/bamboo/bamboo-best-practice-system-requirements-388401170.html).   

The page talks about the general server specification. We usually define the min heap equals to the max heap to reduce the work of garbage collection.  

The best values will be estimated based on your server load, not only by number of plans.

This is what I would do in your case:

1. Find the time of the day where your server is experiencing the higher load.
2. Check the percentage of memory used in your server (**Used memory/Total memory** ). You can get those values on **Cog \>\> Overview \>\> System information \>\> Memory statistics**.
3. If you see that you have 75% or more of the memory used:
   1. Stop Bamboo
   2. Adjust the min and max memory to a bigger value, using [Configuring your system properties - Atlassian Documentation](https://confluence.atlassian.com/bamboo/configuring-your-system-properties-289277345.html) documentation.
   3. Start Bamboo

I hope that helps.
Bamboo Custom installation
Asked by Nelson Faustino:

Trying to connect our new bamboo installation to our existing Postgres DB on another server that JIRA connects too as well. Keep getting the error below. If i make the change to that conf file, my Postgres DB service shuts down and jira stops working. I remove the new access line and everything works fine, except for the custom installation.

Choose how you wish Bamboo to connect to your database - Atlassian Bamboo

Error accessing database: org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host "10.10.10.72", user "bamboouser", database "bamboo", SSL off

I'm entering the line as explained below

<https://confluence.atlassian.com/bamkb/bamboo-database-postgresql-setup-wizard-error-ident-authentication-failed-for-user-416583748.html>

ex.

host bambooDB bamboouser xx.xx.xx.xx password

is it because i can only have one host


Answers:
author: Edwin Kyalangalilwa
body: Hi [@Nelson Faustino](/t5/user/viewprofilepage/user-id/597212),

For example the line would be

```
host     bamboo     bamboouser       10.10.10.72           md5
```
On which agents can a deployment project be created?
Asked by Alexander Rabenstein:

I have many plans and all of them are running on one remote agent.

Can I use the same remote agent for the deployment project or are there better solutions?


Answers:
author: Foong
body: The same remote agent can be used for deployment project.

However, having a single remote agent to handle all the builds and deployment might not be sufficient. There could be a lot of builds and deployments queuing at Build Queue waiting for a single remote agent to run it.

Check Build Queue to confirm if the load is manageable by a single remote agent or does it need more remote agents to clear the queue.


Tags: deployment
JUnit Parser - Failing task since test cases were expected but none were found
Asked by user2117:

i have result.xml file in a different directory but jUnit Parser searches for that xml file in different directory(working directory). Can i configure the path for it? result.xml is in the home directory.


Answers:
author: Foong
body: How about using Script task to copy the file from the home directory into the working directory?


Tags: junit

parse
Bamboo export fails
Asked by danielgruberg:

Hello community!

My bamboo instance fails to export (and thus fails the automatic backup).

I found the following error in the log files:

```
< - some git commits ->

2710200 Squashed 'system/' changes from 74915e9..44b0123



git-subtree-dir: system

git-subtree-split: 954d0c07c07bb6756a4a6373b1eef269f1cb1326,revisionKey=com.atlassian.bamboo.deployments.versions.persistence.commits.MutableDeploymentVersionVcsChangesetImpl@3a10024]

com.ctc.wstx.exc.WstxIOException: Invalid null character in text to output

at com.ctc.wstx.sw.BaseStreamWriter.writeCharacters(BaseStreamWriter.java:464)

at org.codehaus.staxmate.out.SMOutputContext.writeCharacters(SMOutputContext.java:479)

at org.codehaus.staxmate.out.SMOutputContainer.addCharacters(SMOutputContainer.java:171)

at com.atlassian.bamboo.migration.SMOutputElementAppender.append(SMOutputElementAppender.java:37)

at com.atlassian.bamboo.deployments.versions.migration.stream.commits.DeploymentVersionVcsCommitMapper.exportProperties(DeploymentVersionVcsCommitMapper.java:86)
```

Does somebody have an idea how to address this error?  
Thank you!


Answers:
author: Gonchik Tsymzhitov
body: Hi!

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

Looks like time to update to the 6.8.0 :)

Cheers,

Gonchik Tsymzhitov
Bamboo plan does not start
Asked by ???:

Hello.

I currently use Bamboo 5.7.2 as a CD. I operated the bamboos in their usual configuration.  
But it doesn't work and only the message ' Build: #59 has been queued for 1429 minutes' was received.  
All plans work like that without an error message. I stopped all configurations and ran 'Source Code Checkout' but the result was the same.  
I think that is a Git problem. Is there a solution?


Answers:
author: Daniel Santos
body: Hello.

Usually this problem happens when there is no agent to process the specified build.  
Since this problem is happening with multiple plans I would try:

1. Check if your agents are available.
2. If they are online, verify if they are dedicated. It could prevent other plans from using it.
3. If this is a problem with GIT, other plans with SVN or a different repository would work. Do you have plans with Mercurial, SVN or CVS? Are they working as expected?
4. In case you confirm is GIT, please check if the capabilities are configured as expected. Check if any recent change was performed in the GIT installation recently.
Getting an error when running Powershell inline script
Asked by Hector Magnanao:

can't seem to run powershell inline script in bamboo. I keep getting this error after setting up a new bamboo agent:

Failing task since return code of \[powershell -ExecutionPolicy bypass -Command D:\\bamboo-agent-home\\temp\\ID-TP-JOB1-47-ScriptBuildTask-7318819736850637125.ps1\] was -1 while expected 0


Answers:
author: Omar Herrera
body: Hi [@Hector Magnanao](/t5/user/viewprofilepage/user-id/1048131) please check the environment variable PATH have the windows powershell exe

```
C:\Windows\System32\WindowsPowerShell\v1.0\
```

For test purpose you can add a new task with this inline cmd script

```
SET 
powershell -Command "$PSVersionTable.PSVersion"
```

This code show the path variables for you agent.

Cheers.

Omar H.

comments: author: Hector Magnanao
body: Omar,

This is already fixed. Thanks for your suggestion.


author: Hector Magnanao
body: Hi Omar,

This error seems to come back again with a new bamboo agent. I tried that command above but it gives me this error:

Unable to find executable at cmd.exe. Will try to run it anyway.  
'powershell' is not recognized as an internal or external command,  
operable program or batch file.


author: Eric Maynard
body: For those who are wondering, I also had this issue on a Windows 2016 box, with bamboo agent running as a non-interactive service, using the java wrapper.exe. On that machine, the system %PATH% was not being loaded for a domain user account which was being used to run the service. I got things working by modifying the wrapper.conf (referenced on the command line for the win service) to include the following lines:

```
set.default.MYPATH=%PATH%%WRAPPER_PATH_SEPARATOR%C:\Windows\System32\WindowsPowerShell\v1.0\%WRAPPER_PATH_SEPARATOR%
set.PATH=%MYPATH%
```

These statements should be on two lines. I used a temporary variable due to a bug mentioned in <https://wrapper.tanukisoftware.com/doc/english/props-envvars.html>

This may be a hack. I'm not sure what the proper way of injecting the system PATH into a service context is, if any.