youngmon/atlassian-qna huggingface dataset:
SCP identity agent key invalid problem
Asked by hkulekci:

I am getting below error while coping some files with scp task

2018-03-21 07:19:00,116 INFO \[17-BAM::Default Agent::Agent:pool-32-thread-1\] \[TransportImpl\] Client identity string: SSH-2.0-SSHJ_0.21.12018-03-21 07:19:00,182 WARN \[17-BAM::Default Agent::Agent:pool-32-thread-1\] \[IdentificationStringParser\] Server identification has bad line ending, was expecting a '\\r\\n' however got: '2' (hex: 32)2018-03-21 07:19:00,183 WARN \[17-BAM::Default Agent::Agent:pool-32-thread-1\] \[IdentificationStringParser\] Will treat the identification of this server 'SSH-2.0-OpenSSH_7.4p1 Debian-10+deb9u2' leniently

This error started getting after changing remote server without changing IP.


Answers:
author: Anonymous Coward
body: Simon says:

On your remote SSH server (the one that is the destination of the copy operation) configuration set the following option:

**DebianBanner no**

and restart the remote SSH server. This will transform the SSH banner to SSH-2.0-OpenSSH_7.4p1.

On some other distribution you may have to use instead the option:

**VersionAddendum none**

in the SSH server configuration on the remote host.

Cheers, Simon out.

comments: author: hkulekci
body: Hello Simon, I tried both but not work for me. The result is the same.


author: Jeyanthan I
body: Do you get the same error when you execute the scp command from the terminal as the same user outside Bamboo?

If it didn't error out, you may use the script task instead of scp task where you can define your scp command.


author: hkulekci
body: I used script instead of scp task. I guess scp task cache the ip addresses or ssh library of java cache the ip address. And the ip changed for same server. The scp task give this error interestingly.


author: Jeyanthan I
body: Ah, good catch. Thanks for sharing it here :)
Export bash variable for use in deployment task
Asked by Dewang Shah:

I have a Script task in my Deployment project that executes some shell commands. I want this shell command to have access to a Bash environment variable (Not a Bamboo variable).

If I was running this script manually at the command line I would export the variable in my .bashrc and it would be available to the script. How can I achieve the same thing when the script is running inside Bamboo?


Answers:
author: robhit
body: Hi Devang,

Thanks for your question!

Try using like this:

```
source ~/.bashrc

echo $variable
```

Please accept the answer if it helps you so that others can also make use of it.

Thanks,

Robhit

comments: author: Dewang Shah
body: Hi Rohit,

Do you mean add a "source" line to my deployment task? I have about 30 tasks, I was hoping I could have the task access system environment variables without going in to each one and editing them.


author: robhit
body: Hi Dewang,

You could also try to add the variables in the ".bash_profile" or the ".profile" then it will be available.

Thanks,

Robhit


author: Dewang Shah
body: I've already added the variable to the .profile but it doesn't get picked up when the task is running inside Bamboo. Is there any other change that needs to be made? Do I need to restart the Bamboo server?

Just to clarify - this is an _inline_ Script task running as part of a Deployment project


Tags: script
How to reduce bamboo-home size?
Asked by jgauthier:

Hello, my bamboo-home directory is quite big (almost 15 Gb) so I'd like to know if there is a way to "clean-up" some logs or any other "non so useful" files.

Fyi on my plans I only keep the last 2 build logs, not more.

Thank you in advance

Jerome


Answers:
author: Christian Glockner
body: Hi Jerome,

You can configure Global Expiry (see <https://confluence.atlassian.com/bamboo/configuring-global-expiry-289277253.html>), which gives you the option of cleaning up unused artifacts.

Cheers,

Christian

Premier Support Engineer

Atlassian

comments: author: jgauthier
body: Hi Christian, thanks for your answer. Here is the setting I get.  
Maybe this mean that I cannot really purge more information? (fyi the size actually reached more than 20 Gb now)

![bamboo expiry.png](https://community.atlassian.com/t5/image/serverpage/image-id/17609i18FFE99787D4B6E4/image-size/large?v=v2&px=999 "bamboo expiry.png")


author: Christian Glockner
body: Hi Jerome,

We have seen cases where Global Expiry tries to clean up artifacts but then fails due to some underlying error. I wonder if that is the situation here - try triggering global expiry using the "Run now" button and then take a look at the **atlassian-bamboo.log** in **\<BambooHome\>/logs** to see if you can spot any errors.

Cheers,

Christian

Premier Support Engineer

Atlassian


author: jgauthier
body: Thanks, the result is "The expiry affected 19 builds and no deployments" and I did not see any easy-to-see error in the log. I guess this means that ther is no other reason to reduce the size which is probably normal. I'll investigate with my team, thanks for your time.


author: Christian Glockner
body: You're welcome!

One thing that I just wanted to point out - based on the screenshot above you're excluding builds from expiry if they have one of the "sprint" labels. It could be that the builds contributing to the storage consumption have one of those labels and are therefore not expired.

<br />

Cheers,

Christian

Premier Support Engineer

Atlassian
Build success even though [Unable to publish artifact] on logs
Asked by Adrian_Quiambao:

Hi, I'm not sure if this is a bug. Our build shows success but upon checking the logs it shows unable to publish artifact. I expect this to fail.

![Screen Shot 2018-03-21 at 10.38.17 AM.png](/t5/image/serverpage/image-id/17571iD98DD47154189ADC/image-size/large?v=v2&px=999 "Screen Shot 2018-03-21 at 10.38.17 AM.png")

Bamboo version:6.2.2

|----------------------------|
| Unable to publish artifact |


Answers:
author: robhit
body: Hi Adrian,

Thanks for your question!

Yes, it is a known bug. [Bug report](https://jira.atlassian.com/browse/BAM-19582)

But, I can suggest you a workaround to use a script task with the following code:

```
cnt=`ls | wc -l`
echo "Count value is: "$cnt
if [ $cnt -lt 1 ] 
then
echo "failing build as no artifacts found"
exit -1
fi
```

This code will check if there is any file present in the current build working directory or no. If not then "exit -1" will fail the build.

Please note: The above code is bash compatible and is only for reference. You could change this code as per your requirement to look for specific files as well.

Thanks,

Robhit

comments: author: Adrian_Quiambao
body: Great. I'll try this one. Thanks! Appreciate it :)
Can you override Bamboo's Generic repository variables?
Asked by Ed Dev:

I tried overriding this but no luck.

```
${bamboo.planRepository.2.branchName}
```

Is it even possible to change the branch in the script?


Answers:
author: Jean Volski
body: Hi Ed,

You can change the variable but it has no effect on the behaviour of Bamboo because the value of the variable reflects the state of the repository configuration. What are you trying to achieve with this change?

Cheers,

Jean
Setup of Bamboo to remote MSSQL Server fails to complete
Asked by Barry Tresadern:

We have an MS SQLServer on another server which has the correct collation and permissions. During the setup using the gui, we see the animated icon and it hangs there for over 12 hrs.  
I can see tables created in the SQL server db, however the install does not complete.

The command line application shows 'C:\\bamboo-home\\jms-store\\bamboo\\kahaDB\\lock is locked by another server. This broker is not in slave mode waiting a lock to be acquired'.... Could not find token mapped to token name: token.

---

I have attempted re-install as found on your forum and removed everything from the Bamboo-home folder and started over, however we end up at the same point each time. DB populated with tables (don't know what tablet to check for data/records).


Answers:
author: Christian Glockner
body: Hi Barry,

What does the **atlassian-bamboo.log** in **\<BambooHome\>/logs** show?

Cheers,

Christian

Premier Support Engineer

Atlassian

comments: author: Barry Tresadern
body: I got the answer I needed from <https://confluence.atlassian.com/bamboo/microsoft-sql-server-289276827.html>..... I needed to run

ALTER DATABASE \<database name\>  
SET READ_COMMITTED_SNAPSHOT ON  
WITH ROLLBACK IMMEDIATE;

before I installed.

Thanks for your help
Bamboo package .WAR file and deploy
Asked by Connor Oneill:

Hi all,

Would someone be able to tell me if it is possible to package a website (stored in Bitbucket) into a .WAR file and deploy it to a tomcat server using Bamboo? This seems like the perfect job for Bamboo, but I cant figure out how to get it to build something that is just a basis website.

EDIT: I have been trying with Maven 3 and ANT.

Much appreciated

Cheers


Answers:
author: robhit
body: Hi Connor,

Thanks for your question!

I know I am replying a bit too late but if you have not got the answer yet then it might help you here.

Your problem seems to be very basic which indeed is a perfect job for Bamboo to do. I would say below could the flow as per my knowledge:

1. have your code in Bitbucket and link this repository to Bamboo for polling the changes and triggering builds.

2. When using Maven you have to make sure that the packaging is set to war, something like this:

```
 <groupId>com.atlassian</groupId>
 <artifactId>demoServ</artifactId>
 <packaging>war</packaging>
 <version>1.0-SNAPSHOT</version>
```

This will make sure that when Maven is used to build the code the war package is generated.

3. Bamboo should be having the below tasks in sequence:

3.1 -- Source Code Checkout

3.2 -- Maven (To build the code and produce the war file)

3.3 -- JUnit or any other tests task for your test cases if you have any

3.4 -- Artifact Definition (Name: War \| Location: target \| Copy Pattern: \*\*/\*.war \| Shared: Ture)

The above will generate the war file

4. Have a deployment plan linked to this build plan with the tasks in the respective environments:

4.1 -- artifact download (to download the shared war artifact)

4.2 -- Deploy tomcat application (set your tomcat settings here)

4.3 -- Reload your tomcat to make the changes take effect.

Hope this will help. Let me know if a more detailed explanation is required.

Thanks,

Robhit
Bamboo LDAP Cache refreshness
Asked by Build Management Services:

Hi,

I followed the below link to enable LDAP cache for our Bamboo Stage application.

<https://confluence.atlassian.com/bamboo0515/configuring-the-caching-of-your-ldap-repository-894237982.html>

After Bamboo application is started, we tried to add a user to be part of one of the LDAP group.

But even after sufficient period of time, I couldn't get the user being authenticated with right set of permissions in Bamboo application.

May I know, if there needs to be any additional setting to get the LDAP cache refreshed and work as expected?

Chitra


Answers:
author: Jeyanthan I
body: Hi,

When you say that the newly created users are not able to login, do you see that user being listed under **Users** section in Bamboo?

The way how it works is that once you activate LDAP authentication, you cannot manage LDAP accounts or user groups from Bamboo. All the authentication requests are routed to LDAP and Bamboo just validates the request to login. Bamboo will, however, continue to use local users and groups, even when LDAP is enabled.

Can you check the order of your user repositories in *\<Bamboo Home Directory\>/xml-data/configuration/atlassian-user.xml?* It should be the LDAP repo first followed by the hibernate repo.

comments: author: Build Management Services
body: Hi Jeyanthan,

I figured out that I had typo issue in the xml and thus had login issue for the users to get synced up from LDAP.

I could get the LDAP user/group sync working.

Thanks for your reply.

Chitra


author: Jeyanthan I
body: Glad to hear that you sorted it out. Thanks for acknowledging here.
Bamboo Automatic Branch Plan
Asked by Andrew Karetas:

I know you can make automatic branch plans based on when branches are created. Also you can make it so it only makes a plan if it follows specific naming criteria. What I need is to make a branch plan when a pull request is created and has a specific tag in the branch name. Is this possible?


Answers:
author: Foong
body: Please refer to the feature request <https://jira.atlassian.com/browse/BAM-19825>
Bamboo LDAP Cache refreshness
Asked by Build Management Services:

Hi,

I followed the below link to enable LDAP cache for our Bamboo Stage application.

<https://confluence.atlassian.com/bamboo0515/configuring-the-caching-of-your-ldap-repository-894237982.html>

After Bamboo application is started, we tried to add a user to be part of one of the LDAP group.

But even after sufficient period of time, I couldn't get the user being authenticated with right set of permissions in Bamboo application.

May I know, if there needs to be any additional setting to get the LDAP cache refreshed and work as expected?

Chitra


Answers:
author: AnnWorley
body: Hi Chitra,

I understand you set up LDAP caching for Bamboo, but the LDAP users do not have the expected permissions based on their LDAP group membership.

I opened a support request on your behalf so we could examine confidential materials that shouldn't be shared publicly. When it's resolved we can update this thread to let the Community know what the cause was.

Thanks,

Ann
Bamboo Agent some times not picking up the commands like Pod, figlet etc..,
Asked by Raj K:

It would be of great assistance. If someone assist me why sometimes Bamboo Agent doesn't pick up the commands like Pod, xcpretty, figlet etc..,


Answers:
author: Jean Volski
body: Hi Raj,

The Bamboo Agent may not pick up commands if they are not set up in the environment. Please check that the commands you want the Agent to pick up are present in the $PATH environment variable.

Cheers,

Jean

comments: author: Raj K
body: Thanks a lot for your reply Jean.

The problem is that sometimes it picks up and some times it doesnt.

Kindly See the screenshot for more information.

Let's say for the very first time after the configuration of the agent it picks up all the commands properly and after some time it doesn't .

Its very weird.

To add to your point:

I print my path : echo $PATH

It prints the

/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

Where it went and checked whether all the commands are there. Its there.

I'm quite not sure where should I need to update .

It would be of great assistance, if there are some pointers.

---Raj

![Screen Shot 2018-03-22 at 6.23.24 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/17753iFD88B0F7CA5DEAF5/image-size/large?v=v2&px=999 "Screen Shot 2018-03-22 at 6.23.24 PM.png")![Screen Shot 2018-03-22 at 6.23.46 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/17754i3016A668046E2A18/image-size/large?v=v2&px=999 "Screen Shot 2018-03-22 at 6.23.46 PM.png")


author: Jean Volski
body: Hi Raj,

The screenshot you sent shows that your script is calling your commands/tools (figlet, pod, ...) but the shell cannot find them in the environment.

I suggest you try the following:

(1) Use the absolute paths for each tool that you are calling in your script. To find the absolute path for "figlet", you can run the command **which figlet.** You should be able to then update your script using the results that the **which** command returns for every tool.

OR

(2) Ensure the environment has the correct path to the tools in the $PATH variable. Using the same **which** command above, you can verify where the tool is located and update the $PATH variable to point to the location of your tools (if needed).

Hope that helps!


author: Raj K
body: Thanks a lot Jean. I have updated my scripts to the absolute paths. As of now No problem.

But I wonder why it succeeds sometimes and some times it doesn't.

I have my .bash_profile under the home user when I print, it does shows the following path.

/usr/libexec:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin where I can see all sh files.

why it happens.

As of now, the absolute path seems to have given the fix.

-Thanks and Regards,

Raj
Cannot start Bamboo due to pad block corrupted error
Asked by Andreas Pohl:

We cloned the database schema to a test instance.

Bamboo doesn't start afterwards because of the following error message:

FATAL \[localhost-startStop-1\] \[BambooContainer\] Cannot start bamboo  
com.google.common.util.concurrent.UncheckedExecutionException: java.lang.RuntimeException: org.bouncycastle.crypto.InvalidCipherTextException: pad block corrupted

Editing the bamboo-mail.cfg.xml as described at <https://confluence.atlassian.com/bamkb/upgrade-task-51602-fails-pad-block-corrupted-915474011.html> doesn't help.

Any idea how can we start Bamboo?


Answers:
author: Ellie Z _they_them_
body: Hi Andreas,

Thanks for reaching out to the Atlassian Community!

The "Pad block corrupted" error occurs when we're unable to correctly use the Bamboo Cipher.

The Cipher is split between the database and filesystem, and the filesystem part is stored in

```
<bamboo-home>/xml-data/configuration/cipher/cipher.key_0
```

When you cloned the Bamboo database, did you also copy the Bamboo Home directory? If you did not, please:

1. Stop Bamboo
2. Copy the cipher.key_0 file from the original Bamboo instance to the clone into the correct directory -- you may need to create the \`\<bamboo-home\>/xml-data/configuration/cipher/cipher.key_x\`
3. Start Bamboo

Please let us know if this works, or if you have any other questions!

Thanks,

Elias \| Bamboo Support

comments: author: Andreas Pohl
body: Hi Elias,

Thanks a lot for your quick reply!

That fixed the issue, Bamboo was able to start up after I copied the cipher.key_x from the cloned system.

Cheers

Andreas


author: Ellie Z _they_them_
body: Hi Andreas,

I'm glad we were able to help you get back up and running!

Could you please "Accept" this answer by clicking on the checkmark symbol near my first comment in case other users might find this helpful?

Thanks again for reaching out. If you have any other questions, please do not hesitate to ask!

Elias \| Bamboo Support


author: cnp rayan
body: [@Ellie Z _they_them_](/t5/user/viewprofilepage/user-id/50795)

What if we miss that cipher?


author: Ellie Z _they_them_
body: Hi [@cnp rayan](/t5/user/viewprofilepage/user-id/4465782) ,

Thanks for your question.

For security reasons, if the cipher is missing Bamboo will not start under default configuration.

There is a system parameter that can be added to Bamboo to disable the encryption/decryption.

```
-Dbamboo.security.encryption.disable=true
```

With this added Bamboo can start, but any data that had been encrypted previously will not be available. Depending on your version of Bamboo, this could include variables, Repository configurations, secrets, passwords, and more.

If you can, I would strongly encourage you to contact Bamboo Support for assistance with a restore.

Thanks,

Elias \| Former Bamboo Support Engineer
Bamboo - Bitbucket issue
Asked by Pragya:

I am not able to load my repository from bitbucket cloud or server in bamboo.

Error:

Failed to load data from Bitbucket. \[500 Internal Server Error\]

We couldn't connect to the repository. The details you provided were invalid.


Answers:
author: Nic Brough -Adaptavist-
body: I'm not sure we can tell you more than what the error message does. Check the details you've given it are correct!


Tags: bitbucket
How to pass parameters to the jobs while triggering any job
Asked by Suvankar Dey:

Suppose we have one ssh job that should run in multiple env like ENV-A, ENV-B  
Now i want to run the job with parameter ENV-B or ENV-B, if it matches with ENV-A, it will run for ENV-A . Is there any way to use single job for multiple env or we have create separate separate job for multiple env.


Answers:
author: Jeyanthan I
body: Hi Suvankar,

If your intention is to connect to multiple environments, it is necessary to define multiple ssh tasks to connect to multiple environments preferably in a different job/plan based on your requirement.

If you want to run using the same job, you may use [plan variables](https://confluence.atlassian.com/bamboo/defining-plan-variables-289276859.html) and define the hostname in \***Configure plan -\> Variables(tab)** \*

```
host= env1hostname
```

and use this variable in your script task

```
ssh://${bamboo.host}
```

Now, you can choose Run customized and give a hostname of your preference to override the hostname variable for that build. See [Triggering a plan build manually](https://confluence.atlassian.com/bamboo/running-a-plan-build-manually-289276898.html) for more info


author: robhit
body: Hi Suvankar,

Thanks for your question!

I believe the only solution to your problem in my knowledge is by using a script task.

Thanks,

Robhit
Possibility of checking out code from two different SVN location.
Asked by MDNRAJ:

I am working on a project were my master SVN directory contains some sub folder apps, i was asked to perform build one specific sub folder(one specific app) but all my dependent jar and files are present in the master folder. this makes me difficult to checkout those dependent files as i am concerned about checkout of sub app trunk in my initial task.


Answers:
author: Jeyanthan I
body: Hi Nishanth,

Checking out multiple parts of the same repository is possible. All you need to do is to define multiple [linked repositories](https://confluence.atlassian.com/bamboo/linking-to-source-code-repositories-671089223.html) for different branches. In your case, you can create a linked repository for ***repo/branches/proj1/*** and one for ***repo/trunk/library/.***

Now, you can define multiple repositories in the same [Source code task](https://confluence.atlassian.com/bamboo/checking-out-code-289277060.html) (by clicking on **Add repository**) such that both your libraries and project branch are checked out in the build directory. From here, you can have other sequence of tasks to configure a build.

Hope that helps.