youngmon/atlassian-qna huggingface dataset:
how we can achive trigger-pipeline using BitBucket pipeline with repository under VPN
Asked by abhishek.singh:

Hi   

We want trigger a BitBucket pipeline through another BitBucket pipeline. but our BitBucket repo restricted with VPN(we can access only through vpn)


Answers:
author: Mark C
body: Hi [@abhishek_singh](/t5/user/viewprofilepage/user-id/4881165)

Thank you for reaching out to the community.

When you trigger a Pipelines build from another Pipelines build, would it be possible for you to confirm if you're using the Pipes script [atlassian/trigger-pipeline](https://bitbucket.org/atlassian/trigger-pipeline/src/master/) or you're using an API endpoint manually?

Regards,  
Mark C

comments: author: abhishek.singh
body: Hi [@Mark C](/t5/user/viewprofilepage/user-id/1210823)   
we are using API endpoint  
using below script we want to trigger another bitbucket pipeline  

```
#!/bin/bash
```

```
?
```

```
client_id="XXXXYYYYZZZ
```

```
secret="xxxyyyzz"
```

```
access_token=`curl -X POST https://bitbucket.org/site/oauth2/access_token   -d grant_type=client_credentials   -u  $client_id:$secret | jq  '.access_token'`
```

```
?
```

```
curl -X POST -is -u  $client_id:$secret \
```

```
   -H "Authorization: Bearer $access_token" \
```

```
  -H 'Content-Type: application/json' \
```

```
 https://api.bitbucket.org/2.0/repositories/xyz/ \
```

```
 -d '{
```

```
  "target": {
```

```
    "ref_type": "branch",
```

```
    "type": "pipeline_ref_target",
```

```
    "ref_name": "master"
```

```
  },
```

```
?
```

```
  "variables": [
```

```
      {
```

```
        "key": "file",
```

```
        "value": "testFile"
```

```
      }
```

```
    ]
```

```
}'
```


author: abhishek.singh
body: Hi [@Mark C](/t5/user/viewprofilepage/user-id/1210823)

Any solution ?


author: Mark C
body: Hi [@abhishek_singh](/t5/user/viewprofilepage/user-id/4881165)

In your second CURL POST command, could you try removing the "**-u $client_id:$secret**" part?

```
curl -X POST -is -u $client_id:$secret \ ..........
```

I do believe it won't be necessary because you're using an authentication bearer (access token) in this case. After that, try it again.

If the issue still persists, you can try using the Pipes script [atlassian/trigger-pipeline](https://bitbucket.org/atlassian/trigger-pipeline/src/master/) instead of using the CURL command.

Let me know how it goes.

Regards,  
Mark C


author: abhishek.singh
body: HI [@Mark C](/t5/user/viewprofilepage/user-id/1210823) ,  

I'm not able to trigger bitbucket pipeline from another bitbucket pipeline because of vpn restrictions.  
How to achieve this task without removing vpn security


author: Mark C
body: Hi [@abhishek_singh](/t5/user/viewprofilepage/user-id/4881165)  

For us to further check, would you be able to share the error message you're getting when you try to use the CURL command and the Pipes script [atlassian/trigger-pipeline?](https://bitbucket.org/atlassian/trigger-pipeline/src/master/)  

Regards,  
Mark C


Tags: bitbucket-cloud

cloud

vpn
Unable to login to new bitbucket account
Asked by John Fryer:

![bitbucketLogin.JPG](https://community.atlassian.com/t5/image/serverpage/image-id/193193i9B2C23F716106EDB/image-size/large?v=v2&px=999 "bitbucketLogin.JPG")  

I recently signed up for Jira and Confluence for some hobby projects. Tried to setup Bitbucket as well and I can't seem to login to it. Reading various posts here in community, and I'm wondering if maybe my email is tied to old work account from years ago. Is someone able to check and reactive/unlink if that is the case? If it's not, any other ideas?


Answers:
author: Caroline R
body: Hi, John! Welcome to the community!

I confirmed that there was a Bitbucket account linked to the email you used to raise this question that was created in 2013 and it was set as inactive, so I reactivated it.

Could you please try to access it now and let me know how it goes?

Looking forward to hearing from you.

Kind regards,  
Caroline

comments: author: John Fryer
body: Awesome, thank you Caroline! Looks to be working.


author: Caroline R
body: Thanks for your confirmation, John! I'm glad to know it's working.


Tags: bitbucket-cloud

cloud

login
Kindly clarify this, is you refer to CRLF to LF conversion while check-in code to bitbucket?
Asked by amit kadam:

Documentation mentions as Note that: Whenever you create a branch from Bitbucket or from an issue in Jira Software, Bitbucket removes characters that are invalid in references, file systems or shell, and replace them with a valid substitute.

Kindly clarify this, is you refer to CRLF to LF conversion while check-in code to bitbucket?


Answers:
author: Theodora Boudale
body: Hi [@amit kadam](/t5/user/viewprofilepage/user-id/4014437),

This does not refer to CRLF to LF conversion in source code.

It refers to ++certain special characters in branch names++ . For example, some of these characters are **#** , **%** , **\&**. If you try to use such a character in a branch name (when you create a branch from Bitbucket UI or Jira), this character will get omitted or replaced.

The same documentation page also mentions a ++safe++ default set of characters to use for branch names:

* <https://support.atlassian.com/bitbucket-cloud/docs/branch-a-repository/>

Please note that this concerns Bitbucket Cloud (<https://bitbucket.org/>).

Kind regards,  
Theodora
Can I import a local (no url address) git project into bitbucket?
Asked by Xavier Boucher:

Can I import a local (no url address) git project into bitbucket?


Answers:
author: Craig Castle-Mead
body: Hi Xavier,

I assume this means you're running a git server on your local machine and want to move that repository to Bitbucket?

If so, you cannot use Bitbucket's UI based import function (unless you're also running Bitbucket on the same machine, but I'm assuming this is not the case).

But if you run the below commands on the machine running the git repo you want to move, the clone will give you a full history of the code (code, branches, tags) and the push command will then commit everything to your new target repository. These commands will NOT include meta data such as Pull Requests.

`git clone --verbose --bare https:``//olduser@localhost/scm/OLDPROJECTNAME/oldreponame.git`

`git push --mirror https:``//newuser@newgitserver/scm/NEWPROJECTNAME/newreponame.git`

`CCM`


Tags: bitbucket-cloud

cloud
Pipeline chrome DriverConfigurationError
Asked by Dayasankar.Kancharla:

We are trying to execute Serenity tests using Bitbucket pipeline by installing chrome and not able to run chromedriver.

Build log shows following -

-------------------------

It is using google-chrome-stable - 100.0.4896.127-1 and chromedriver 100.0.4896.60 (resolved driver for Chrome 100)

-------------------------

Caused by: net.thucydides.core.webdriver.DriverConfigurationError: Could not instantiate new WebDriver instance of type class org.openqa.selenium.chrome.ChromeDriver (Could not start a new session. Response code 500. Message: unknown error: Chrome failed to start: exited abnormally.  
(unknown error: DevToolsActivePort file doesn't exist)  
(The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)  
Build info: version: '4.1.1', revision: 'e8fcc2cecf'  
System info: host: 'a7c30361-578e-4621-ab4b-4e72c9da7548-vlf95', ip: '10.39.188.89', os.name: 'Linux', os.arch: 'amd64', os.version: '5.13.0-1017-aws', java.version: '1.8.0_292'  
Driver info: org.openqa.selenium.chrome.ChromeDriver  
Command: \[null, newSession {capabilities=\[Capabilities {acceptInsecureCerts: false, browserName: chrome, goog:chromeOptions: {args: \[--start-maximized, --test-type, --no-sandbox, --ignore-certificate-errors, \\n --disa..., --disable-default-apps, --disable-extensions-file-a..., \\n --inco..., --disable-infobars,--disabl...\], extensions: \[\]}}\]

-------------------------

Following is script from bitbucket-pipelines.yml -

-----------------------------------

image: maven:3.6.3  
image: atlassian/default-image:2

pipelines:  
default:  
- parallel:  
- step:  
name: Build and Test  
services:  
- docker  
caches:  
- maven  
script:  
- apt-get update \&\& apt install wget unzip xvfb  
- apt-get install -y libasound2 libnspr4 libnss3 libxss1 xdg-utils unzip libappindicator1 fonts-liberation  
- apt-get -f install  
- wget <http://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb>  
- dpkg -i google-chrome\*.deb  
- mvn clean verify -Dmaven.wagon.http.pool=false

----------------------------------

lease help me resolve this issue.


Answers:
author: Davinder Rakkar
body: Hi were you able to resolve this issue? I am getting the exact same


Tags: bitbucket-cloud

cloud
Request for Garbage Collection
Asked by d.perez.urruti:

We trying to reduce the size of one of my repositories which is just over 2GB. We have identified large binary files in old commits whcih were taking up too much space and have deleted many branches but the the size has not been reduced. I have the Labs Delete dangling commits when over size limit enabled on my profile but this does not appear to be cleaning anything up even after pushing.

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

This is the workspace: \<information removed due to privacy reasons\>

and the repository is called \<information removed due to privacy reasons\>


Answers:
author: Caroline R
body: Hi, [@d.perez.urruti](/t5/user/viewprofilepage/user-id/4879495), welcome to the community!

I ran the GC against your repository and managed to reduce its size to 232.1 MB.

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


author: Robert Wen_ReleaseTEAM_
body: Hello [@d.perez.urruti](/t5/user/viewprofilepage/user-id/4879495) . Let me get this request visible to someone from Atlassian.

comments: author: d.perez.urruti
body: Thank you Robert! It's my first question/post so I was not sure how to or if I can make it visible for them when creating it.


author: Robert Wen_ReleaseTEAM_
body: Welcome to the community! You did the right thing.


Tags: atl-rvw

atlassian-support

bitbucket-cloud

cloud
Unable to pull private projects list with API call
Asked by puru kovvuri:

Hello all,

I'm unable to **pull private projects** and repos list using the api <https://api.bitbucket.org/2.0/workspaces/UUID/projects>. When i do a API call, i'm getting only public projects list within my organization workspace.

Thanks in advance!!


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

Could you please confirm which type of authentication you are using when making this request?

In case you are using Basic Auth, we have [deprecated account passwords](https://bitbucket.org/blog/deprecating-atlassian-account-password-for-git-and-bitbucket-api-activity), so you need to use an [app password](https://support.atlassian.com/bitbucket-cloud/docs/app-passwords/) (if you are not using one already). If you are using an app password, make sure it has all the necessary permissions. And if you use OAuth, permissions could also be an issue.

This is an example (utilizing an app password) you can follow:

```
curl -X GET -u username:apppassword https://api.bitbucket.org/2.0/workspaces/{workspaceID}/projects
```

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

Kind regards,   
Caroline

comments: author: puru kovvuri
body: Thank you !!


author: Ed Gaile _Atlanta_ GA_
body: What are you passing in as the user/auth for the REST API call?


Tags: bitbucket-cloud

cloud
How do I find development mode to enable Sentry with Bitbucket Cloud?
Asked by Nick Perkins:

I found this cloud article about enabling \`Development mode\` on my workspace.

<https://support.atlassian.com/bitbucket-cloud/docs/enable-bitbucket-cloud-development-mode/>  

I go to Settings and there is no option to enable this mode to connect Sentry to Bitbucket.

Has something changed with Jira / Bitbucket that this article is now inaccurate?   

\[Update 4.15.22 12:26pm EST\]  
More context. Was able to add Sentry in the Jira Marketplace, but still see Sentry has Bitbucket not linked. Jira is good to go though.


Answers:
author: seanaty
body: Go to you Workspace settings \> "Installed Apps" \> Look to the bottom of the page and see "Enable development mode"

comments: author: Nick Perkins
body: [@seanaty](/t5/user/viewprofilepage/user-id/1301071) sadly I can't find a setting in the Workspace settings called \`Installed Apps\`


author: seanaty
body: Here is the direct link:

<https://bitbucket.org/>\<your_workspace\>/workspace/settings/addon-management

Just replace "\<your_workspace\>" with your workspace slug.


author: Nick Perkins
body: [@seanaty](/t5/user/viewprofilepage/user-id/1301071) I get this. I am an admin for the entire jira account. why can't I see this.  
![Screen Shot 2022-04-18 at 1.14.35 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/193303i8B2F918E869BB072/image-size/large?v=v2&px=999 "Screen Shot 2022-04-18 at 1.14.35 PM.png")  


author: Nick Perkins
body: [@seanaty](/t5/user/viewprofilepage/user-id/1301071) any ideas here about this not found issue?


author: seanaty
body: It could be that you're not an admin. Tell me what settings pages are you able to see?


author: Nick Perkins
body: [@seanaty](/t5/user/viewprofilepage/user-id/1301071) I am a Site Admin in Atlassian. I can see the company workspace in bitbucket.

![Screen Shot 2022-04-21 at 9.13.28 AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/193986i0DFC50FD761AA2E5/image-size/large?v=v2&px=999 "Screen Shot 2022-04-21 at 9.13.28 AM.png")


author: Nick Perkins
body: [@seanaty](/t5/user/viewprofilepage/user-id/1301071) is this developer mode a Standard feature in Jira? That is the plan we have.


author: Nick Perkins
body: Ok getting concerned that this is my problem....oh man  

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


author: seanaty
body: It looks to be that issue I'm afraid. All that said, seeing our screenshot reminds me, perhaps you don't need to enable development mode.

Can you try going to Jira under Atlassian integrations and see if you can connect to a Jira instance there?


author: Nick Perkins
body: ...


Tags: bitbucket-cloud

cloud

development

integration
How can I push a new project to a new git remote on bitbucket?
Asked by sunil:

I can no longer push new projects to newly-created repos on bitbucket.  

When attempting to push for the first time, I'm asked for a password.  
Upon entering my password I'm told that passwords are no longer supported.  

My public key has been installed within the settings of my bitbucket account.   

To make sure something hasn't corrupted the record of my pubkey, I exported it and re-installed it to my bitbucket settings.  

This hasn't helped: I'm still asked for my password, and on submitting my password I receive the message telling me that passwords aren't used anymore.  

What could be going wrong?


Answers:
author: Karthick S
body: Hello [@sunil](/t5/user/viewprofilepage/user-id/3554464)

Thank you for reaching out to the Community!

As per the Bitbucket [communication](https://bitbucket.org/blog/deprecating-atlassian-account-password-for-bitbucket-api-and-git-activity#:~:text=Deprecating%20Atlassian%20account%20password%20for%20Bitbucket%20API%20and%20Git%20activity,-September%2003%2C%202021&text=Starting%20Sep%2013%2C%202021%2C%20new,to%20use%20Bitbucket%20app%20passwords.), Atlassian account passwords are deprecated for Bitbucket API calls and HTTPS git activity (clone, push, pull and fetch), and are being replaced by App Passwords.

* You will have to use your **App Password** alongside your username separated with a ":" character.
* Therefore if you are authenticating to **GIT over HTTPS** to perform actions you will need to update your remote URLs to include the **App Password** :  

  ```
  git remote set-url origin <https://USERNAME:APP_PASSWORD@bitbucket.org/username/reposlug.git>
  ```

* The same applies when performing git clone:  

  ```
  git clone https://USERNAME:APP_PASSWORD@bitbucket.org/username/reposlug.git
  ```

I hope this helps!  

Kind regards,  
Karthick S

comments: author: sunil
body: Thanks Karthick.  

I'm having trouble getting access to a private repo. I think it's because I'm having trouble composing the right URI string.  

I might be getting the 'reposlug' part wrong.  

What is a reposlug? How do I find it for a particular repo?  


Tags: bitbucket-cloud

cloud
Why does Git ignore certain files and ALL directories, even with empty .gitignore?
Asked by Emilio Ferreira:

I started Git in the root directory of the project, WITH GITIGNORE EMPTY, downloaded Wordpress and added it to the root of this project. The problem is that after using Git Status, the list to add tracking does not show hundreds of files and all Wordpress root directories.

What am I doing wrong? I wanted to start the project with all the Wordpress files and then push them to the repository. Only after that will I add files and directories to be ignored by Git.

tks


Answers:
author: Theodora Boudale
body: Hi Emilio and welcome to the community.

It is possible that there is a global gitignore file on your machine, which includes patterns to be ignored for all repositories.

I would suggest running the command

```
git config --list
```

and check if the variable **core.excludesFile** is displayed in the output, and if so, what is its value. This configuration variable is used to set a global gitignore, and if set, you can check the patterns in that file.
> I wanted to start the project with all the Wordpress files and then push them to the repository. Only after that will I add files and directories to be ignored by Git.

Please keep in mind that if you first commit e.g. \*.jpg files in a repo, and then you add a .gitignore with \*.jpg, the .jpg files that you already committed will not be ignored.

Kind regards,  
Theodora


Tags: git

git-ignore

wordpress
How to configure granted scopes to 3rd party app ?
Asked by vlad:

We use the Atlas Bot 3rd party application that requires several scopes on our Bitbucket tenant.

* Read your account information
* Read your repositories' issues
* Read your repositories and their pull requests
* Read your team membership information

We would like to only grant it access to the webhooks.

Also - we not want to grant access to the repository contents, but only to the pullrequests.

Is there a way to choose which of the required scopes is granted ?

Is it possible to only grant access to webhooks ?

ref:

<https://developer.atlassian.com/cloud/bitbucket/bitbucket-cloud-rest-api-scopes/>


Answers:
author: seanaty
body: Do you have more information about Atlas bot and which type of authentication it uses?

Typically apps request certain scopes which you can approve or reject wholesale. You cannot pick and choose which scopes you give them (only you can choose whether or not to install the application).

That said, some apps might work with App Passwords which you provide to them, in that case you can provide them an app password with whatever scopes you decide. That said the application may or may not work if it needs some of those scopes.


Tags: bitbucket-cloud

cloud
Using APIs to manage user access to repositories
Asked by Nalin M:

Hi,

We wanted to reduce our interaction with Bitbucket UI and also setup a process to generate audit reports to better understand which users have access to which repositories and at what level of permissions.

I have been able to identify APIs that allow me to get the information needed to generate the audit reports, but I was unable to find any API that would allow us to give a specific user read/write/admin access to a repository.

Asking here just in case I missed something.

Thanks!


Answers:
author: Karthick S
body: Hello [@Nalin M](/t5/user/viewprofilepage/user-id/315065)

Thanks for the update and for providing more context. You may use the [Invitation endpoint API](https://support.atlassian.com/bitbucket-cloud/docs/invitations-endpoint/) to add the user directly to the repository. The user will receive an invitation mail and they need to accept it.

Sample CURL call:

```
curl -u? username:AppPassword?--request POST https://api.bitbucket.org/1.0/invitations/workspace_ID/repo_slug --data permission=write --data email="emailID"
```

I hope this helps.

Kind regards,  
Karthick S

comments: author: Nalin M
body: Thanks for getting back with another solution [@Karthick S](/t5/user/viewprofilepage/user-id/4557546) .

This solution only works partially. I am trying to manage all aspects of user access via APIs. I can only invite a user to join a repository via this API endpoint, but I can not:

* Change the level of access, i.e. promote it from read to write or demote it from admin to read only etc.
* Revoke access completely to a repository for a user directly given access to the repository (not via groups).

I understand these operations are possible on groups, but not on individual users. We'll basically like to be able to do CRUD on an individual user's permissions to repositories.

End goal is to manage user and group permissions via configuration stored outside of Bitbucket and using that configuration with Bitbucket APIs to manage user and team access to various repositories. We have many teams and no one to manage the day to day requests to grant/revoke repository access.


author: Karthick S
body: Hello [@Nalin M](/t5/user/viewprofilepage/user-id/315065)

Thank you for reaching out to Atlassian Community.

Currently, you may use [group endpoint API](https://support.atlassian.com/bitbucket-cloud/docs/groups-endpoint/) to modify the permissions of a group. For example, the below CURL call would update the permissions for a given group.  

```
curl --request PUT --user "username:Apppassword" --header "Content-Type: application/json" https://api.bitbucket.org/1.0/groups/WORKSPACE_ID/GROUP_SLUG --data '{"name":"group_slug","permission":"read","auto_add":true}'
```

I hope this helps.

Kind regards,  
Karthick S

comments: author: Nalin M
body: Thanks for the reply Karthick, but unfortunately, that doesnt help.

Question above is about giving permissions to a "specific" user, not a group. Apologies if it wasn't clear.


Tags: api

bitbucket-cloud

cloud