youngmon/atlassian-qna huggingface dataset:
how to add Server capabilities for node.js
Asked by SaiCharan:

Unable to find executable at /usr/local/bin/node. Will try to run it anyway.  
command 28-May-2019 04:25:32 Beginning to execute external process for build 'newDev - new - Default Job #9 (NEW-NEW-JOB1-9)'\\n ... running command line: \\n/usr/local/bin/node /usr/local/bin/npm install\\n ... in: /var/atlassian/application-data/bamboo/xml-data/build-dir/NEW-NEW-JOB1\\n ... using extra environment variables:

Failing task since return code of \[/usr/local/bin/node /usr/local/bin/npm install\] was -1 while expected 0  
simple 28-May-2019 04:25:32 Finished task 'NPM Install' with result: Failed  
simple 28-May-2019 04:25:32 Running post build plugin 'NCover Results Collector'  
simple 28-May-2019 04:25:32 Running post build plugin 'Artifact Copier'  
simple 28-May-2019 04:25:32 Running post build plugin 'npm Cache Cleanup'  
simple 28-May-2019 04:25:32 Running post build plugin 'Clover Results Collector'  
simple 28-May-2019 04:25:32 Running post build plugin 'Docker Container Cleanup'  
simple 28-May-2019 04:25:32 Finalising the build...  
simple 28-May-2019 04:25:32 Stopping timer.  
simple 28-May-2019 04:25:32 Build NEW-NEW-JOB1-9 completed.


Answers:
author: Jimmy Seddon
body: Hi [@SaiCharan](/t5/user/viewprofilepage/user-id/3213776),

I have discovered that you will encounter this error if the user running the Bamboo server service has a local/user defined path variable in addition to the system defined one. That bug is captured here: <https://jira.atlassian.com/browse/BAM-16205>

The workaround is to delete the user defined PATH variable and things should start working for you.

I hope that helps!

-James


Tags: capability
repository include/exlude files regex expression in repository demo for sub directory
Asked by preeti singh:

repository include/exlude files regex expression in repository demo have 3 directory and each directory multiple sub directory , .\*/dir/subdir/test/.\* .

please suggest correct regex to get files or folders.


Answers:
author: Daniel Santos
body: Hello [@preeti singh](/t5/user/viewprofilepage/user-id/2692725)

Could you share some examples of which files you wanted to match and which ones you don't want?

I need that to really understand the scenario there so I can help you to build the REGEX for it.

I have a couple of examples to share:

```
.*/filename
```

* This one will match any file called "filename**"** in any repository folder that is NOT root. It needs to have a folder under it \<DIR\>/filename

```
.*/folder1/folder2/folder3/.*
```

* This one will match any file inside folder3 or subfolders, but only if folder3 is inside a structure like \<DIR\>/folder1/folder2/

```
.*/(folder1|folder2)/.*
```

* This is like .\*/folder1/.\* and .\*/folder2/.\* matches together. Anything inside the folders \<DIR\>/folder1 or \<DIR\>/folder2 will match the criteria.

I hope that helps to clarify the REGEX expression a little bit.
Bamboo source code checkout task failing
Asked by sangeetha:

Cannot fetch branch '(unresolved) HashAndSource{refName=\[null\], branch=\[release/February\], hash=\[commitid\]}' from 'bitbucket url' to source directory 'bambooagentlinuxpath/bamboo_home/xml-data/build-dir/_git-repositories-cache/'. java.lang.RuntimeException: java.nio.file.FileSystemException: /tmp/bamboo-ssh.: Operation not permitted

Bamboo agents are running in Linux machines .This error occurs specifically to a particular agent


Answers:
author: Daniel Santos
body: Hi [@sangeetha](/t5/user/viewprofilepage/user-id/2185915)

I would check a few things first:

1. Do you have a native GIT installation in this remote agent? If not Bamboo may be using JGIT which is more error-prone.
2. The OS on this agent does not allow running scripts at the /tmp directory.
3. The git cache is corrupted.

**1 -** Will require installing git and adding it as a capability.  
**2 -** Will involve editing the agent configuration so it has a different temp directory that can run scripts.  
For this you need:

1. Stop the agent
2. Edit the **\<Bamboo_Agent_Home\>/conf/wrapper.conf** to add an additional java parameter like the following line:

   ```
   wrapper.java.additional.3=-Djava.io.tmpdir=/var/tmp
   ```

   ?? In case the number 3 is used you will need to change it to a different number available.
3. Start the agent again

**3 -**Just a removing the folder caches folder will force the agent to create a new one

1. Stop the agent
2. Remove the **bambooagentlinuxpath/bamboo_home/xml-data/build-dir/_git-repositories-cache** folder
3. Start the agent

I hope that helps you to move forward.

comments: author: sangeetha
body: Thanks Daniel. Removing the cache folder as mentioned inn step 3 worked


author: Daniel Santos
body: That is great! I'm glad to help.
Can't create plan branch (405) using POST request
Asked by Dmitrij Kultasev:

I have **feature/JIRAISSUE-123-some-feature-name** git branch and want to create branch plan and link it to the git branch.

The plan key is **MOR-DB** and is valid as well as host as other requests are working, and I've tried following URLs:

http://localhost:8085/rest/api/latest/plan/MOR-DB/branch/feature-JIRAISSUE-123-some-feature-name?vcsBranch=refs/heads/feature/JIRAISSUE-123-some-feature-name  
http://localhost:8085/rest/api/latest/plan/MOR-DB/branch/feature-JIRAISSUE-123-some-feature-name?vcsBranch="refs/heads/feature/JIRAISSUE-123-some-feature-name"  
http://localhost:8085/rest/api/latest/plan/MOR-DB/branch/feature-JIRAISSUE-123-some-feature-name?vcsBranch="/refs/heads/feature/JIRAISSUE-123-some-feature-name"  
http://localhost:8085/rest/api/latest/plan/MOR-DB/branch/feature-JIRAISSUE-123-some-feature-name?vcsBranch="feature/JIRAISSUE-123-some-feature-name"

and getting following error message:
>
> 405 - The specified HTTP method is not allowed for the requested resource.


Answers:
author: Daniel Santos
body: Hi [@Dmitrij Kultasev](/t5/user/viewprofilepage/user-id/1701308)

The method you are trying to use does not support POST but PUT. Have you tried using PUT?

Bamboo REST API reference for this method

* [/plan/{projectKey}-{buildKey}/branch/{branchName}](https://docs.atlassian.com/atlassian-bamboo/REST/6.8.0/#d2e1948)

I hope that is the only issue =\]
Is it possible to "Force Clean Build" conditionally?
Asked by Joe Maffei:

I'm working on a React project that gets deployed to a development environment multiple times a day. In the rare instances when a node package gets installed/removed/updated, we have to force a clean build. Is there a way to conditionally toggle the "Force Clean Build" based on, say, a version change?


Answers:
author: Daniel Santos
body: Hello [@Joe Maffei](/t5/user/viewprofilepage/user-id/2907599)

Bamboo does not have a feature for this out-of-the-box, but you could use a script task for that at the beginning of the plan jobs. The script task would remove all files in the build working directory. I guess that will be challenging to identify when a version changes. You will need to compare the version being built with previous ones.

Another option is to isolate the part of the build that is sensitive in a different job and aways clean this specific job using the Bamboo **clean working directory task**.

I hope that can at least give you some ideas.
Why can an a user with admin permissions on project not publish bamboo specs with maven
Asked by nigelgbanks:

I have a user which has admin permissions on the project / plan, I'm attempting to update. Whose credentials I've placed in *.credentials* in the bamboo-spec folder.  

When executing:

```
mvn -Ppublish-specs
```

I get the following errors:
> 2019-05-23 12:03:24,393 INFO \[BambooServer\] An error occurred while publishing plan MOSE-FDBS: You are not permitted to access this resource  
> 2019-05-23 12:03:24,395 DEBUG \[BambooServer\] {"message":"You are not permitted to access this resource","status-code":500}  
> Caused by: com.atlassian.bamboo.specs.exceptions.BambooSpecsRestRequestException: You are not permitted to access this resource

With the same credentials as in *.credentials* , I am able to log into the website and make changes to the build plan and project manually through the UI.   

This user **is able to publish** to other projects / plans where the account has the same permissions.  

If I switch users to another account I am able to publish on the original project / plan I was trying to modify.  

What could be going wrong, what else should I check? I have the following permissions set on the project and plan:  

![plan permission inheritance.png](/t5/image/serverpage/image-id/55515iAF60EAFA40529842/image-size/large?v=v2&px=999 "plan permission inheritance.png")![plan permission.png](/t5/image/serverpage/image-id/55514iCBDAC4426C15F150/image-size/large?v=v2&px=999 "plan permission.png")![project permissions.png](/t5/image/serverpage/image-id/55516iB52D299702C0BE72/image-size/large?v=v2&px=999 "project permissions.png")


Answers:
author: Daniel Santos
body: Hi [@nigelgbanks](/t5/user/viewprofilepage/user-id/1166626)

This issue will probably require a deeper investigation.

First of all, I see that you posted this question 10 days ago. Do you still face this issue?Anyway, I would check this:

1. **What is different from this user if compared with the other ones?**   
   Check global permissions  
   Check if this user comes from a different user repository if compared with the other ones
2. **Is this user able to modify a simple config in this plan?**   
   Check if this issue is happening to a specific configuration that may require permission that is failing. I don't know what is the configuration you are trying to update. Depending on what is the update it may work or not. This would help us to identify the scope of the problem.
3. **Check the specs logs**   
   When running specs add the property "*-Dbamboo.specs.log.level=DEBUG* " or "*-Dbamboo.specs.log.level=TRACE*" to it and check if you get errors of more information before the permission issue.
4. **Check the Bamboo logs**   
   Check if you see any errors in *\<Bamboo_Home\>/logs/atlassian-bamboo.log* file.

I'll wait for your findings.


Tags: spec
Anyone know how to stop BambooSpec Scanning?
Asked by Edward_Burns:

Got all the build plans and deployment projects output to bambooSpec in java. They are located in a toplevel folder of the BitBucket (Git) Server repository named bamboo-spec. So after a successful build and commit of the java code in the repo I turned on the scan function of BambooSpecs. The UI showed it was scanning with a spinning wheel. That was 2 months ago and it's still spinning. Shut off scanning of BambooSpecs and restarted - now have two spinning wheels - ie scans running for last month.

Does anyone know what process is running these? any way to stop these scans? anyway to get the BambooSpec feature to work? Has anyone actually got the BambooSpec feature to work with java code?

Thanks in advance for your time.

Ted B


Answers:
author: Victor Debone
body: Hello [@Edward_Burns](/t5/user/viewprofilepage/user-id/2816495) welcome to the community!

Can you share with us what version of Bamboo are you currently in?

comments: author: Edward_Burns
body: 6.6.1


Tags: spec
Two Issues After Install - Cannot Create File & Bamboo Service Terminated
Asked by Tom:

Hello,

I've recently installed the latest Bamboo trial however I've encountered the following two issues

1. Whenever I attempt to create a build/project/anything which creates a file on the server I encounter some for of the below message

```
Could not check if existing access key is valid: java.lang.RuntimeException: java.io.IOException: Could not create file: C:\Atlassian\Bamboo\temp\bamboo-ssh.41538fd5.bat
```

I've tried Running the service as administrator but this didn't resolve it.

In regards to directory permissions, I cannot find anything which tells you what the folder permissions should be.

2. When I attempt to start the installed Bamboo service, the following is logged to the event viewer

```
The Atlassian Bamboo Bamboo service terminated with the following service-specific error: 
Incorrect function.
```

Can anyone point me in the right direction. I've googled for possible solutions and been unsuccessful so far.


Answers:
author: Jimmy Seddon
body: Hi [@Thomas_Renshaw](/t5/user/viewprofilepage/user-id/2974460),

Welcome to the Community!

My first question is how are you able to get to the point of trying to create a build plan/project when issue number two is that you can't get the service to start? Or is that the issue you are facing once you tried to switch to running the service as an admin user and the service won't start now?

While the event viewer doesn't show too much helpful information the Bamboo log files might be more helpful.

Are you able to take a look in the following location:

\<Bamboo_Install_Directory\>/logs - and take a look at the date time stamps around the time you tried to start the service and it failed for something that looks similar to: bamboo-stderr.2019-05-15.log

You can also look in \<Bamboo_Home\>/logs and see if it got far enough to create an atalssian-bamboo.log file and if there are any errors reported in there.

You could also look at this post here to see if any of the suggestions here help you, though I believe you have a different error than what was reported here: <https://community.atlassian.com/t5/Questions/Installing-Bamboo-for-the-first-time-cannot-get-service-to-start/qaq-p/82747>

I hope that helps get you started.

-James
Bamboo Home
Asked by somendu:

Hi,

I gave bamboo.home directory as

\<path\>/bamboo-home

which is totally different then Bamboo Installation as below

\<path\>/atlassian-bamboo-6.8.1

However when I started Bamboo server (using sudo su)

It created a directory inside installation path like this with a special character folder also getting created

\<path\>/atlassian-bamboo-6.8.1/??????/**\<path\>/bamboo-home**

I am following this documentation

<https://confluence.atlassian.com/bamboo0607/installing-bamboo-on-mac-os-x-966044823.html>

Can someone help me with this please?

Why it is creating folder inside installation directory?

Thanks,

Somendu


Answers:
author: Michiel Salters
body: The special character looks like it is a UTF-8 "BOM" (U+FEFF). Some editors including Notepad insert this character in text files when saving as UTF-8. Since this BOM is a zero-width space character, it's an invisible marker.

Solution: save as plan ASCII.


author: Daniel Santos
body: Hi [@somendu](/t5/user/viewprofilepage/user-id/172886)

Difficult to know what exactly is happening there, but lets double check the Bamboo home configuration.

The file to configure it is located at:

```
<path>/atlassian-bamboo-6.8.1/atlassian-bamboo/WEB-INF/classes/bamboo-init.properties
```

The line should be like:

```
bamboo.home=/<path>/bamboo-home
```

Please make sure you have an absolute path here. It should start with "**/** " and the folder **bamboo-home**does not need to exist.

Another observation is that you should not use **sudo su**to run the Bamboo process. The best option is to make sure the user running it is the owner of both Bamboo install and Bamboo home folders.

**Suggestion for moving forward**

1. Stop Bamboo process.
2. Remove the strange folder created from your installation directory.  
   ?? I'm assuming you can lose the data in there since this is a new install.
3. Make sure the user starting the Bamboo process is the owner of all installation files and it has permissions to edit the location where the bamboo-home will be created. You can use the command **chown** for this.
4. Edit the Bamboo home path in **bamboo-init.properties** . Make sure this file has the Bamboo home absolute path with a "**/**" at the beginning and use quotes if the path has spaces.
5. Start the process again.

If that does not solve the issue we will probably need to dig into your server logs.

comments: author: somendu
body: Hello Daniel,

Glad to hear from you. The problem got resolved automatically.

I deleted Atlassian setup.

Downloaded new and done all process, and bamboo-home folder got created properly.

Hope it works fine moving forward :)

Thanks,

Somendu


author: Daniel Santos
body: I'm glad that you are moving forward.  
If you have new questions don't hesitate to come back to our community =\]
Branch Status, Dedicate Agent not working on Bamboo Server 6.5 after HTTPS change
Asked by Rizwan Choudrey:

We updated Bamboo server to uses HTTPS. Since the change, when we go to Build-\>Branch Status and try to add a plan to build a branch, we get the following error

*An error occurred - not all plans added successfully.*

In addition, when we try to dedicate a remote agent to a build plan, clicking the Add button does not do anything.

Please advise.

Thanks,  
Riz


Answers:
author: Victor Debone
body: Hello [@Rizwan Choudrey](/t5/user/viewprofilepage/user-id/3222509) welcome to the community! :)

Did you make changes on Bamboo or Tomcat configuration after you've installed your HTTPS certificate? If yes, can you give a short description of what was changed?  

Victor

comments: author: Rizwan Choudrey
body: Hi Victor, thanks!

Our IT made the changes. This is what they say:

*Main change was to add an additional virtual host to the apache configuration (something like /etc/httpd/apache2.conf from memory). At the bottom is a vhost for port 443, which proxies to the real bamboo server on port 8085.*

*Only other change was firewall-related: we blocked access to port 8085 and then opened it back up for the remote agent boxes (GARBLA\*).*

*Configured the application path in Bamboo itself to <https://bamboo.garrison.local/> aintead of <http://bamboo.garrison.local:8085/>.*

Hope that helps?

Cheers,

Riz


author: Victor Debone
body: Surely do! From what you have described, there is a missing step.

You will also need to change the proxy configurations in Bamboo's Tomcat, you can find more details [here](https://jira.atlassian.com/browse/BAM-18063).

Did that help?


Tags: agent

branch

https

remote-agent

status
Should I create a project, plan, stage, job or a task?
Asked by mikayil-abdullah:

In Bamboo, we have projects, then we have plans, then we have stages, each stage has a list of jobs and finally, each job has one or more tasks. I know that jobs can run in parallel, tasks in a job run sequentially and stages also take place one after another. Now this gives us a lot of flexibility in terms of organizing our jobs. But besides providing this flexibility, is this classification meant to be so that each has it's own use case? Let me give you an example of a typical build process that we have:

Obviously, we have several git branches that correspond to different environments.

1. Check out the right branch from git repo
2. Compile, run unit tests and package it with maven. This is done with a single command.
3. Take the version of the artifact and keep it in a variable to use it in the later steps
4. Build the docker image based on the Dockerfile that's found in the project root
5. Run the image and push it to a kubernetes cluster.

Can you give an example on how to split this 5 step process into plans/stages/jobs/tasks. It's probably going to be in the same one plan. But again then, when do I create another plan. What's the use case for that? When do I create another project?


Answers:
author: Jimmy Seddon
body: Hi [@mikayil-abdullah](/t5/user/viewprofilepage/user-id/2322161),

From what I have seen project are really good at grouping categories of plan together. Plans are listed alphabetically so projects allow you to group plans that belong together into their own groupings.

As for when you would create additional plans really comes down to how you want and choose to use Bamboo.

We have a number of small git repos that each have their own plan and build an artifact. We did it this way so that we are re-building the entire set of artifacts in the plan every time a change is made. We only re-build what was changed.

We then have another build plan (that is a child plan of all the other build plans) that collects the latest built version of the artifacts and bundles them into a deployment package.

I hope that helps provide some insight, I'm not sure if it helped answer your question or not.

-James

comments: author: mikayil-abdullah
body: You know, this question comes as a result of lack of enough CI/CD experience. Thanks for the answer
How do I get release versions related to particular build with Bamboo REST API?
Asked by ??????? ?????????:

I need to know if build already has a release version and create one if it doesn't. How can I check it?


Answers:
author: Daniel Santos
body: Hi [@??????? ?????????](/t5/user/viewprofilepage/user-id/1172048)  

There is no easy way to get this information through REST API. What we could do is to get it directly from the Bamboo DB.

This query should give you the information you need:  
?? It was designed for Postgres DB and might need adjustments to work with a different database type.

```
WITH    latest_builds AS    (SELECT CONCAT(build_key, CONCAT('-',max(build_number))) build, plan_name    FROM buildresultsummary    WHERE build_type LIKE '%CHAIN%'    GROUP BY build_key, plan_name),    versions AS    (SELECT CONCAT(dvp.plan_key, CONCAT('-',dvp.build_number)) build, dv.plan_branch_name, dr.deployment_state    FROM deployment_version dv    LEFT JOIN dep_version_planresultkeys dvp      ON dv.deployment_version_id = dvp.deployment_version_id    LEFT JOIN deployment_result dr      ON dv.deployment_version_id = dr.version_id)SELECT lb.*, v.plan_branch_name, v.deployment_stateFROM latest_builds lbLEFT JOIN versions vON lb.build=v.build
```

**Explanation**

The first part of the query will list the latest builds from all plans.

```
    SELECT CONCAT(build_key, CONCAT('-',max(build_number))) build, plan_name    FROM buildresultsummary    WHERE build_type LIKE '%CHAIN%'    GROUP BY build_key, plan_name
```

The second part will list all the builds that have versions, deployed or not.

```
    SELECT CONCAT(dvp.plan_key, CONCAT('-',dvp.build_number)) build, dv.plan_branch_name, dr.deployment_state    FROM deployment_version dv    LEFT JOIN dep_version_planresultkeys dvp      ON dv.deployment_version_id = dvp.deployment_version_id    LEFT JOIN deployment_result dr      ON dv.deployment_version_id = dr.version_id
```

The third part will join the results of the queries above. It should give you a consolidated table with all latest builds with or without version/deploy.

I hope that will helps you to move forward.
how to change or update department list in bamboo
Asked by Yuri Kundin:

how to change or update department list in bamboo


Answers:
author: Daniel Santos
body: Hi [@Yuri Kundin](/t5/user/viewprofilepage/user-id/3220331)

I'll need your help to understand the issue you are trying to solve.  
Can you give me more details about it?  
What Bamboo feature is related to this issue? (deployment, build, reports etc)