youngmon/atlassian-qna huggingface dataset:
Running Python Scripts inside Bamboo?
Asked by Trivikram Belagod:

Is there a way i can run a python script directly inside Bamboo, not as a file, but as an inline script, by remote connecting to a server? For example, to run a shell script I can use the "SSH Task" option in Bamboo to connect to the host server and type out the SSH commands and run them as I am running on a terminal. Can this be done with Python scripts by connecting to a host and loading python on that host?


Answers:
author: Sebastian Pastor
body: \*\*\*\* THIS DOESN'T WORK \*\*\*\*

For a script running in a Linux machine you can use the "hash-bang" to specify python as the interpreter. Typically, in Linux the "#!/bin/bash" is used, so changing it to "#!/bin/python" should do the trick for a python module. Take a look at [this StackOverflow question](http://stackoverflow.com/questions/8967902/why-do-you-need-to-put-bin-bash-at-the-beginning-of-a-script-file).

However, it doesn't work in Bamboo because the hash-bang is ignored, the same reason we can't use BASH instead of SH. [This JIRA issue](https://jira.atlassian.com/browse/BAM-10320) tracks a change request for that.


Tags: python
"Invoke-Command " in powershell script doesn't work when invoke it from bamboo task only
Asked by Andrey AndreySh:

"Invoke-Command " in powershell script doesn't work from bamboo plan invocation.

I have a script task (Run as Powershell script) that invoce powershell file with some parameter.

And magik is that it failed on line when i try to Invoke-Command -ComputerName ... on remote host with credentils previously created. Code powershell like this:

\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>

$cred = New-Object System.Management.Automation.PSCredential -ArgumentList @($ServiceUser,(ConvertTo-SecureString -String $ServicePassword -AsPlainText -Force))

Invoke-Command -ComputerName $serverName -ArgumentList $force,$WebAppPoolName,$ManagedRunTimeVersion -Credential $cred -ScriptBlock {

some actions .... }

\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>

And bamboo task is failed with error:

|----------------------|------------------------------------------------------------------------------------|
| 5:05                 | Invoke-Command : An internal error occurred.                                       |
| 04-Dec-2013 20:45:05 | At C:\\build-dir\\QOIP-QI-JOB1\\CIAF\\Bamboo\\PS\\ConfigureIIS.ps1:56 char:15      |
| 04-Dec-2013 20:45:05 | + Invoke-Command \<\<\<\< -ComputerName $serverName -ArgumentList $force,$WebAppPo |
| 04-Dec-2013 20:45:05 | olName,$ManagedRunTimeVersion -Credential $cred -ScriptBlock {                     |
| 04-Dec-2013 20:45:05 | + CategoryInfo : InvalidOperation: (:) \[Invoke-Command\], PSInvali                |
| 04-Dec-2013 20:45:05 | dOperationException                                                                |
| 04-Dec-2013 20:45:05 | + FullyQualifiedErrorId : InvalidOperation,Microsoft.PowerShell.Commands.I         |
| 04-Dec-2013 20:45:05 | nvokeCommandCommand                                                                |

But magik is that when i run the same powershell scrip on bamboo instance manualy with the same parameters and under the same "Bamboo" user i didn't recived such error and this script work correctly.

So this issue reproduced only when try to run powershel stuff by bamboo and for command Invoke-Command when trying to do something on remote host under appropriate permissions.

Any suggestion how to fix this issue ?


Answers:
author: Andrey AndreySh
body: No i didn't


author: Omprakash Thamsetty
body: Did you found the solution for this? I am having the same issue.

Thanks,

Om
How do I get the filename of a shared artifact?
Asked by Steven T. Snyder:

We have a plan which builds a tarball artifact that needs to be used in a later stage. The tarball filename depends on some numbers internal to the application source code. We can't calculate this name from Bamboo variables.

I need to untar the file and deploy the application to the server in a later stage in the plan, but I can't figure out how to get the artifact name into the deployment job. Since there is only one tarball artifact I tried using a wildcard with tar. This of course works in bash, but not from Bamboo.

I can't find any Bamboo variable that stores the name of the artifact.

How can I get the exact filename of a certain artifact so I can refer to it in a later stage?


Answers:
author: Przemek Bruski
body: You can't do it directly. You can download the artifact to a separate directory and assume everything under it is your artifact. Then just use script tasks to do whatever you need.


Tags: artefact

jira
Elastic agent not starting on boot on official Ubuntu image
Asked by Dario d:

I've created a new Elastic Instance in Bamboo, and I've tied it to the official Ubuntu Raring image, but elastic agents are not starting automatically on boot. I have to ssh into the instance and start them manually.

Not sure waht could be the reason for this. I've checked /etc/rc.local, it's executable and contains the bambo startup script:

```
# Bamboo agent startup. /opt/bamboo-elastic-agent/etc/rc.local
```

But it doesn't seem to execute. (Troubleshooted by adding a simple command to /etc/rc.local which prints output to disk, didn't execute at all).

Any help would be more than welcome.

Thanks.


Answers:
author: Dario d
body: This was the issue: /etc/rc.local has -e set in its' shebang (#!/bin/sh -e) meaning that the script exits on first error.

The error happened on this line, since the destination file didn't exist:

```
sed -i -e s/.*ssh-rsa/ssh-rsa/ -e s/.*ssh-dss/ssh-dss/ /home/ec2-user/.ssh/authorized_keys
```

Solution was to update this line with an asterisk after /home/ubuntu/.ssh

```
cp -a /home/ubuntu/.ssh/* /home/ec2-user/.ssh
```


author: Przemek Bruski
body: Try using ami-bd9cb5d4 . We'll get it shipped in one of the Bamboo 5.3.x updates.  


Tags: cloud

remote-agent

ubuntu
Bamboo onDemand and instance types
Asked by Salman Sayyed:

I don't seem to find enough information on bamboo's computation requirements for running builds on amazon instance, and what instance types are suffiecient for a certain Job demands?   

Also, where does Bamboo store artifacts after a build is done?


Answers:
author: Przemek Bruski
body: That depends entirely on the builds you're running, there's very little overhead coming from the agent.

The artifacts will be stored on Atlassian's OnDemand infrastructure.


author: Salman Sayyed
body: Thanks.


Tags: aws

elastic-agent
connecting bitbucket to Elastic agent in AWS
Asked by Salman Sayyed:

Hi,  

I have been reading the onDemand documetation for Bamboo, which runs build in elastic agents in the Amazon EC2. Now, I have some security concerns regarding this subject.   

It says in the documenation that bamboo will automatically establish a secure tunnel SSL connection to the elastic agent. However, the elastic agent requires a connection to the VCS (which in my case is Bitbucket), I also would like this connection to be secured.   

Now, my question is. what are the possible ways of establishing this connection, and could it be done if the elastic agent is placed in a VPC?


Answers:
author: Przemek Bruski
body: If you use HTTPS to connect to Bitbucket, that's the connection that the agent will use too. You can use this setup in VPC, provided that the instance has outgoing access to the Internet (e.g. by using elastic IPs or gateway).


Tags: aws

bitbucket-cloud

cloud

security
REST API to search a given code or text on Commit Message in Bitbucket Cloud
Asked by felis paul:

Currently in Bitbucket Cloud, there is rest api to search a given code or text in a workspace which brings output based on commit file name and its content but not on commit message.

For ex. /2.0/workspaces/felisklera/search/code?search_query=IPA-3738

This API will bring result if IPA-3738 text is present in commit file name or the content of commit file or in any other entity but not bringing any result if this text is present on a commit message.   

Therefore we need an API in Bitbucket Cloud which can search a given code or text in commit message.


Answers:
author: Theodora Boudale
body: Hi [@felis paul](/t5/user/viewprofilepage/user-id/4747739),

There is a feature request about this in our issue tracker:

* <https://jira.atlassian.com/browse/BCLOUD-18364>

The feature request was closed a few months ago due to inactivity, but I would suggest adding your vote and comment in that feature request, as our Product Managers continue to monitor even closed requests at <https://jira.atlassian.com/>

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
bitbucket stopped sending emails notifications
Asked by Mohammad Ratrout:

i stopped receiving any emails about PRs im assigned to as a reviewer or mentioned in, it was working just fine till the last three months and I need to check them manually which makes the experience a little bit harder to follow what's going on.

I've checked previous threads on how they fixed the issue but nothing seems to be working, im watching the repos that should send me emails and i was informed that i wasnt added to a black list or something.

can you please help?


Answers:
author: Theodora Boudale
body: Hi [@Mohammad Ratrout](/t5/user/viewprofilepage/user-id/1978832),

Your email address is not in any of our suppression lists.

I also checked our email logs and I can see several emails related to Bitbucket Cloud PRs that have been sent to your email address, all of them show to have been delivered to your mail server.

I would suggest:

* checking your Spam folder, in case our emails ended up there
* checking if you have certain filters in your email account that would make our emails skip your Inbox
* talking with the administrator of your mail server and ask them to investigate why these emails do not make it from your mail server to your Inbox

If you need any further info, please feel free to let me know.

Just a heads up, I removed your email from your post to protect your privacy.

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud

email
Force managed account personal workspaces to be private?
Asked by Ben L:

We have a BB Cloud with managed users (i.e. managed by the Organisation and Organisation Admin(s)).

We want to require these personal workspaces to be private; is there any way to enforce such a policy? Alternatively, can we disable them?

(our actual problem is that staff have occasionally accidentally created repos in their personal workspace without realising they are public)


Answers:
author: Caroline R
body: Hi, [@Ben L](/t5/user/viewprofilepage/user-id/1155694), thank you for reaching out to Atlassian Community.

Currently, it's not possible to enforce this policy. The information available on a personal workspace is specific to the user and hence a second person cannot access it, even the org admin of this account.

However, we do understand your business case, so we already have 2 feature requests to our dev team to give more control over accounts under a specific domain, as you can see here:

* [Corporations need complete control over accounts with their domain](https://jira.atlassian.com/browse/BCLOUD-16609)

* [Provide Organization Admins with granular control over managed Bitbucket accounts](https://jira.atlassian.com/browse/BCLOUD-20097)

One of the Bitbucket PMs has informed in one of the feature requests above that our engineering team is actively working on improving the project settings and project permissions model with Bitbucket. They expect the improvements to be complete this year and this should address many of the issues related to this subject.

I would suggest that you add your vote there (by selecting the **Vote for this issue** link) as the number of votes helps the development team and product managers better understand the demand for new features.

You are more than welcome to leave any feedback, and you can also add yourself as a watcher (by selecting the **Start watching this issue** link) if you'd like to get notified via email on updates.

Implementation of new features is done as per our policy [here](https://confluence.atlassian.com/support/implementation-of-new-features-policy-201294576.html) and any updates will be posted in the feature request.

Kind regards,   
Caroline


Tags: bitbucket-cloud

cloud
i'm not receiving any recovery link to my email
Asked by Tommy Dwi Putranto:

Hello,  

I'm trying to access my account with this email and i'm not receiving any recovery link emails from **Atlassian** .Can anyone from the support team check if that email got "blocked" in your system ?  

Thanks in advance.


Answers:
author: Caroline R
body: Hi, [@Tommy Dwi Putranto](/t5/user/viewprofilepage/user-id/3526543), thank you for reaching out to Atlassian Community.

I confirmed that you are not blocked on our server. So, could you please confirm what recovery email you are referring to? Is it a password reset or 2FA recovery email?

Please feel free to share any additional information regarding this case.

Kind regards,   
Caroline


author: edwin vasquez
body: Hello [@Tommy Dwi Putranto](/t5/user/viewprofilepage/user-id/3526543)   

Have you checked that its not caught in a spam filter or accidentally deleted by a rule?

comments: author: Tommy Dwi Putranto
body: nothing is in spam and any rule is free. [@edwin vasquez](/t5/user/viewprofilepage/user-id/3017728)
How to Access Bitbucket from a HostPapa VPS
Asked by kiusau:

The following procedure for cloning my Bitbucket repository to the HostPapa server does not work:

$ ssh -T git@bitbucket.org  
Enter passphrase for key '/home/thege0/.ssh/id_rsa':  
authenticated via ssh key.

You can use git to connect to Bitbucket. Shell access is disabled

$ git clone git@bitbucket.org:kiusau/deflation-made-simple.git  
fatal: could not create work tree dir 'deflation-made-simple': Permission denied  
$

Please advise.

Roddy


Answers:
author: kiusau
body: The problem was overcome when I by-passed the password for the private-key with the following SHELL commands and realized that cPanel's GIT Version Control feature and Bitbucket are incompatible.

$ eval $(ssh-agent)  
Agent pid 11772  
$ ssh-add \~/.ssh/id_rsa  
Enter passphrase for /path/to/private/key/id_rsa:  
Identity added: /path/to/private/key /id_rsa

After insuring that I -- not root -- owned the new directory that I created to hold my cloned repository I entered the destination folder with the SHELL cd command. While in the folder I followed with the following Bitbucket git command.

git clone git@bitbucket.com:kiusau/deflation-made-simple

I suppose that I must now create a repository out of the cloned files and folders with the

git init

and subsequent commands.

Roddy


Tags: bitbucket-cloud

cloud
Pipe 'Slack Notify' throws 'invalid_payload' error
Asked by Hasan Toprakkaya:

We tried every example on [Slack Notify pipe](https://bitbucket.org/atlassian/slack-notify/src/master/) but we always got the error message "HTTP Response: invalid_payload"

Example pipeline;

```
image: atlassian/default-image:3
pipelines:
default:
- step:
script:
- pipe: atlassian/slack-notify:2.0.0
variables:
WEBHOOK_URL: $WEBHOOK_URL
MESSAGE: 'Hello, world!'
```

The error message;

```
Status: Downloaded newer image for bitbucketpipelines/slack-notify:2.0.0
INFO: Sending notification to Slack...
INFO: HTTP Response: invalid_payload
? Notification failed
```

Any suggestions to solve this problem?


Answers:
author: Hasan Toprakkaya
body: Ok. We figured it out.

We used the Slack's old Incoming WebHook URL and because of that we got this error message.

Now, we created an app on Slack and enabled the WebHook and use that WebHook URL and it worked.


Tags: bitbucket-cloud

cloud

slack
I want to upgrade the bitbucket from 7.6.12(Current LTS) to 7.17.5 (LTS).
Asked by karandaid:

hi,

I am using the bitbucket server 7.6.12 and I want to upgrade to version 7.17.5 LTS

- Do I need to make any database upgrades?

- Will there be any problems to upgrade from one LTS to another LTS?

- Are there any things, I need to look for or should consider?

Thanks


Answers:
author: Robert Wen_ReleaseTEAM_
body: Hello [@karandaid](/t5/user/viewprofilepage/user-id/30779)

Take a look at the Upgrade Guide. It'll help you out as far as OS, database, and other things.

<https://confluence.atlassian.com/bitbucketserver/bitbucket-server-upgrade-guide-776640551.html>


Tags: bitbucket-server

server

upgrade
Deploying to multiple environments in parallel??
Asked by Jim Priest:

It's 2022 and it's very common to deploy to multiple machines? Is this not supported?   

We have redundant prod machines and would like to be able to deploy to all of them in one parallel step. Not through a multi-step process which is very tedious and time consuming.   

I'm trying to do something like this - and would like to see one "Promote" button to push to deploy to both Prod environments but instead I seem to be forced to deploy to Prod 1, then Prod 2.   

Would be nice if there was a trigger at the parallel level which would then kick off all the parallel steps together.

```
- parallel:
  - step:
    name: Deploy to Production 1
    trigger: manual
    <<: *deployment-tarball
    deployment: Production 1
  - step:
    name: Deploy to Production 2
    trigger: manual
    <<: *deployment-tarball
    deployment: Production 2
```

```


```


Answers:
author: Eduardo Asenjo
body: As a workaround you can always have a dummy single manual step before your Parallel steps:

```
- step:
  name "Init deploy"
  trigger: manual
  script: echo "Init deploy for the parallel steps!"
- parallel:
  - step: *deployToEnv1
  - step: *deployToEnv2
  - step: *deployToEnv3
```


author: Patrik S
body: Hello [@Jim Priest](/t5/user/viewprofilepage/user-id/4737644) ,

Welcome to Atlassian Community!

From my understand you would like to have the option to trigger multiple manual parallel steps using a single button. If that is the case, unfortunately at this moment this option is not available on Bitbucket Pipelines. However, we already have a feature request on our public issue tracker to implement that functionality, which you can find in the following link:

* <https://jira.atlassian.com/browse/BCLOUD-21607>

I went ahead and linked this post to the feature request, but I would also suggest you to add your vote there, since this helps both developers and product managers to understand the interest. Also, make sure you add yourself as a watcher in case you want to receive first-hand updates from that ticket. Please note that all features are implemented with this policy in mind: <https://confluence.atlassian.com/support/implementation-of-new-features-policy-201294576.html>

Let us know in case you have any questions.

Thanks, [@Jim Priest](/t5/user/viewprofilepage/user-id/4737644) .

Kind regards,

Patrik S


Tags: bitbucket-cloud

bitbucket-pipelines

cloud
Bitbucket Webhooks expiration
Asked by Vladimir Efimenko:

We are using Bitbucket Cloud API to create webhooks. Everything works as expected but after some time (\~ 12 days) the webhooks are deleted on Bitbucket cloud side.

So the question is can webhooks be expired or removed on some unfortunate event? or on exceeding throttling limits?

Thanks a lot for your help


Answers:
author: Norbert C
body: Hi Vladimir,

Thank you for contacting Atlassian Community. I'm Norbert from Bitbucket Cloud Support Team, it's nice to meet with you! Welcome to the Atlassian Community!

I would like to inform you that we don't delete Bitbucket Webhooks automatically from repositories, this activity must be done by some app or by someone.

Can you let me know what's the name of the Workspace and Repository where you have this issue? I'm going to check the logs internally

I'd like to inform you that please mask the the name of the workspace and repository, for example: no\*\*\*\*\*\*\*\*\*\*\*\*\*\*rt/as\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*kl

Please let me know, we're here to help.

Best Regards,  
Norbert  
Atlassian Bitbucket Cloud Support

comments: author: Vladimir Efimenko
body: Hi Norbert,

Thanks a lot for your help and assistance.

Here is our workspace-slug/repo:   
ca\*\*\*\*\*\*\*\*\*ne/ce\*\*\*\*\*\*\*\*s

The time period the hooks worked was \~ from 18.01 to \~31.01 this year

Please let me know if you need more info.

Thanks!


author: Norbert C
body: Hi Vladimir,

Thank you for your reply. I couldn't find any Webhooks deletion event in your Workspace, thus I've enabled the "Max webhooks exempt" feature on this Workspace.

Can you test the Workspace/repository for a while and let me know if webhooks' are getting deleted/expired or not?

I'm looking forward to hear from you.

Best Regards,  
Norbert  
Atlassian Bitbucket Cloud Support


author: Vladimir Efimenko
body: Hi Norbert,

It works well so far, \~ 20 days without any interruption. We'll still keep an eye on it.

Thanks for your help


Tags: bitbucket-cloud

cloud
Request for Garbage Collection
Asked by dwilt_tns:

I am trying to reduce the size of one of my repositories which is just over 2GB. I have deleted many branches but the the size has not been reduced. I have the Labs Delete dangling commits when over size limit enabled but this does not appear to be cleaning anything up.

I believe that I need GC ran on my repository and since we have no way to do this ourselves I am creating this request.


Answers:
author: Caroline R
body: Hi, [@dwilt_tns](/t5/user/viewprofilepage/user-id/3298430), thank you for reaching out to Atlassian Community.

I found one repo owned by your workspace with a size of 2.0 GB, so I ran a git GC on it and its size is 1.6 GB now.

I also would like to share with you that we have a feature request to allow users to mark repositories for git GC, as you can check here:

* <https://jira.atlassian.com/browse/BCLOUD-11593>

Please consider adding yourself as a watcher to receive the updates as we make progress with this. If you are not familiar with our Feature Request Policy, you can read more about it [here](https://confluence.atlassian.com/support/implementation-of-new-features-policy-201294576.html).

Feel free to share any additional questions or concerns regarding this case.

Kind regards,   
Caroline

comments: author: dwilt_tns
body: [@Caroline R](/t5/user/viewprofilepage/user-id/3934006) thank you. I confirm that you have ran git GC on the correct repository.

I also have voted for the new feature you linked.


author: Caroline R
body: Hi, [@dwilt_tns](/t5/user/viewprofilepage/user-id/3298430),

Thanks for the confirmation! I'm glad to help.

Kind regards,  
Caroline


author: Pramodh M
body: Hi [@dwilt_tns](/t5/user/viewprofilepage/user-id/3298430)

Please refer the doc here

<https://community.atlassian.com/t5/Bitbucket-questions/Request-for-Garbage-Collection/qaq-p/1919585>

Adding [@Caroline R](/t5/user/viewprofilepage/user-id/3934006) for assistance

Thanks,  
Pramodh

comments: author: dwilt_tns
body: [@Pramodh M](/t5/user/viewprofilepage/user-id/3691224) yes I found that post and I am following the correct procedure, correct? We are not able to run GC ourselves and need to put in a support request to have this done. Am I missing something?


author: Pramodh M
body: Yes Atlassian Team will run the GC and update you [@dwilt_tns](/t5/user/viewprofilepage/user-id/3298430)


Tags: bitbucket-cloud

cloud
Bitbucket LFS encryption
Asked by Kate Lyapina:

Is there a standard way to encrypt the content stored in Bitbucket LFS (on-premises)?


Answers:
author: Pramodh M
body: Hi [@Kate Lyapina](/t5/user/viewprofilepage/user-id/4746746)

Welcome to Bitbucket!!

Here's a quick reference on LFS in Bitbucket

<https://confluence.atlassian.com/bitbucketserver/git-large-file-storage-794364846.html>

It's not Bitbucket, it's Git, so don't try to change the encryption method.

Instead, secure the server!!

Let me know if you have any queries

Thanks,  
Pramodh


Tags: encryption

bitbucket-server

git-lfs

server