youngmon/atlassian-qna huggingface dataset:
Bitbucket pipelines integrations with AWS CodeArtifact via OIDC
Asked by Oren Shvalb:

Hi guys,

I'm following this [article](https://support.atlassian.com/bitbucket-cloud/docs/deploy-on-aws-using-bitbucket-pipelines-openid-connect/) to make Bitbucket pipelines work with AWS Codeartifact but having troubles with it.

I've

1. Created "Identity Provider" with URL \& Audience from Bitbucket's OIDC settings.
2. Created a AWS role with `AWSCodeArtifactAdminAccess` permissions and associated it with the Identity Provider
3. Defined 2 Bitbucket's repository variables: `AWS_REGION` \& `AWS_ROLE_ARN`.
4. Created `bitbucket-pipelines.yml` file that looks like this:

    image:  name: XXXXXXXXXX.dkr.ecr.us-east-2.amazonaws.com/bitbucket-docker:1.0.0  aws:    oidc-role: arn:aws:iam::XXXXXXXXXX:role/bitbucket-pipelinesoptions:  max-time: 30 # per-step timeout in minutespipelines:  branches:    develop:      - step:          oidc: true          script:            - export AWS_WEB_IDENTITY_TOKEN_FILE=$(pwd)/web-identity-token            - echo $BITBUCKET_STEP_OIDC_TOKEN > $(pwd)/web-identity-token            - aws sts assume-role-with-web-identity --role-arn arn:aws:iam::XXXXXXXXXX:role/bitbucket-pipelines --role-session-name build-session  --web-identity-token "$BITBUCKET_STEP_OIDC_TOKEN" --duration-seconds 1000            - mvn verify deploy -e -DskipTests

When I run the pipelines I can see that I'm able to access the ECR docker image, but getting 401 authentication error when trying to deploy the maven artifacts (jar file).

I'm under the impression that I don't need to call `aws codeartifact get-authorization-token` since I authenticate via OIDC.

Here is the logs from CloudTrail:

```
"eventSource": "codeartifact.amazonaws.com",
"eventName": "PublishPackageVersion",
"awsRegion": "us-east-2",
"sourceIPAddress": "35.160.177.10",
"userAgent": "Apache-Maven/3.6.3 (Java 11.0.9; Linux 5.10.101)",
"errorCode": "AccessDenied",
"errorMessage": "Unauthenticated: request did not include an Authorization header. Please provide your credentials.",
```

Any idea what am I missing here?


Answers:
author: Saxea _Flowie_
body: I'm not familiar AWS CodeArtifact, but I think you need the token for Maven... The OIDC is for the AWS, not the repository, kind of how you still need a credential for DBs too.

Have you tried the using the the `aws codeartifact get-authorization-token? `Is it not working?

comments: author: Oren Shvalb
body: Yeah,

You're right - I was missing a call to \`codeartifact get-authorization-token\` - so I've added a call in the script and exported a \`CODEARTIFACT_AUTH_TOKEN\` variable for maven to pickup by the \`settings.xml\` file .

\`\`\`  
\<server\>  
\<id\>modules\</id\>  
\<username\>aws\</username\>  
\<password\>${env.CODEARTIFACT_AUTH_TOKEN}\</password\>  
\</server\>  
\`\`\`  
but still it doesn't work... any idea?


author: Oren Shvalb
body: Another question,

In order to get temporarily CODEARTIFACT credentials I call

\`aws sts assume-role-with-web-identity\` with the ARN of the web-identity provider, but for the \```--role-session-name` I input an arbitrary name - is that OK ?``


Tags: bitbucket-cloud

cloud
Delete User
Asked by Dale Jones:

I get this message when I attempt to delete a user. I am by no means an expert in Bitbucket. Any Ideas?

![Screenshot 2023-08-03 092041.png](/t5/image/serverpage/image-id/273011i18C3AD6C416275CF/image-size/large?v=v2&px=999 "Screenshot 2023-08-03 092041.png")


Answers:
author: Theodora Boudale
body: Hi [@Dale Jones](/t5/user/viewprofilepage/user-id/4221793),

This error shows up when you try to remove a user from their own personal workspace.

Up until a few months ago, when someone created a Bitbucket Cloud account, Bitbucket would automatically create a workspace for their user. That was a user's personal workspace. We have since changed this functionality and now Bitbucket doesn't automatically create a personal workspace when someone creates an account. However, the personal workspaces before this change was introduced still remain.

I'm afraid that it is not possible to remove a user from their own personal workspace. What you can do is create a new workspace, transfer all the repositories from the existing workspace to the new one, and set up user access there.

You can check the following documentation on how to transfer repos:

* <https://support.atlassian.com/bitbucket-cloud/docs/transfer-repository-ownership/>

If that personal workspace is on a paid billing plan, you can downgrade it to Free and then upgrade the billing plan of the new workspace.

If you have any integrations e.g. with Jira or with other third-party tools, you will also need to reconfigure them so that they point to the new workspace.

Please feel free to let me know if you have any questions.

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
Auto Upgrade On Prem Runners
Asked by Michael Adams:

Hi, We are running windows runners on prem. Since new versions come out frequently we are investigating maybe scripting auto installing the latest runner. I looked through the API to see if there were anything there I could use but didn't find anything. We have the script to do the actual download and install but for complete automation we are missing a few steps:

* Know there is a new version available (parse the log of the latest run? not ideal)
* Get the version # of the latest version (parse the log of the latest run? not ideal)
* Know if the runner is actively "running" or is idle (parse log of latest run? nasty)
* Request runner to shut down cleanly (Maybe OS soft kill flag instead of hard kill)

Anyone know of any ways to accomplish the above (other than all the freaking log parsing)?

Thanks.


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

I'm afraid that we don't have any API endpoints to get this information.

We have feature requests for providing API endpoints for runners and also for providing auto-update options:

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

I would suggest adding your vote to these feature requests (by selecting the **Vote for this issue** link) to express your interest. 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 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 requests.

In the meantime, parsing the logs would be the way to get this info programmatically.

Kind regards,  
Theodora


author: Marc-A (Nimbax)
body: If you really want to go that route maybe using a docker to implement jira could be a nice solution

I do it in a dev env using docker-compose

Using the   
atlassian/jira-software:latest docker image.

It's been a long time but here is the doc on how we did it.

<https://www.digitalocean.com/community/tutorials/how-to-automatically-update-docker-container-images-with-watchtower-on-ubuntu-22-04>

(container is ubuntu but replace with jira container and it's the same logic )


Tags: bitbucket-cloud

cloud
when I try to push my source code to bitbucket I receive an authentication error
Asked by Jazib Khan:

while running this command I get this error and I am unable to understand and solve this

git push -u origin --all

git@bitbucket.org: Permission denied (publickey).

fatal: Could not read from remote repository.

Please make sure you have the correct access rights

and the repository exists.


Answers:
author: Theodora Boudale
body: Hi [@Jazib Khan](/t5/user/viewprofilepage/user-id/5284142) and welcome to the community!

There are different possible causes for this error.

**1.** One possibility is that you don't have access to the repo.

**2.** Have you already set up SSH keys? If so, where did you add the public SSH key?

In case the public key was added to your account's settings and you have at least write access to the repo, then this is not an issue. In case the public key has been added as an **Access key** to a project or repo, these types of keys provide read-only access.

**3.** If the public key has been added to your account, then the private SSH key may not be offered during the git push operation.

I would suggest creating a file named **config** in your **\~/.ssh** folder and adding the following lines (if the file exists, just add the following content)

```
Host bitbucket.org
    AddKeysToAgent yes
    IdentityFile ~/.ssh/id_rsa
```

where **\~/.ssh/id_rsa** replace with the path and name of the private SSH key, whose public key you have uploaded to Bitbucket.

This will ensure that the correct SSH key is used when connecting to Bitbucket.

Reference: <https://support.atlassian.com/bitbucket-cloud/docs/set-up-personal-ssh-keys-on-macos/#Add-your-key-to-the-SSH-agent>

Please feel free to let me know how it goes and if you need further assistance.

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
atlassian/npm-publish:0.2.0 ? Resource temporarily unavailable
Asked by Patrick P.:

Hi, the package gets published, but why do we get sometimes an error on *pipe: atlassian/npm-publish:0.2.0*?

```
...
Status: Downloaded newer image for bitbucketpipelines/npm-publish:0.2.0
INFO: Starting pipe execution...
INFO: Registry URL: https://registry.npmjs.org
INFO: Setting npm auth configuration...
INFO: Publishing package...
npm publish xy --access=restricted
/usr/bin/common.sh: line 43: echo: write error: Resource temporarily unavailable
npm notice
...
```

Thanks


Answers:
author: JoeKusnir
body: Did you ever fix this? We are experiencing the same error message.

\*\*\*Upgrading atlassian/npm-publish to 1.0.0 solved the problem\*\*\*


Tags: bitbucket-cloud

cloud
Update sonarcloud pipelines to Java 17
Asked by V?ctor Salvans:

Hi, I'm currently using the image sonarsource/sonarcloud-scan:1.4.0 to run my sonarcloud analysis through bitbucket pipelines.  

```
image: atlassian/default-image:4
definitions:
    services:
        docker:
            memory: 4096
    caches:
        sonar: ~/.sonar/cache # Caching SonarCloud artifacts will speed up your build
    analyze: &analyze
        - step:
          name: "Analyze on SonarCloud"
          size: 2x
          caches:
              - sonar
          script:
              - pipe: sonarsource/sonarcloud-scan:1.4.0
                variables:
                   SONAR_SCANNER_OPTS: -Xmx1024m
             - pipe: sonarsource/sonarcloud-quality-gate:0.1.6
               variables:
                   SONAR_SCANNER_OPTS: -Xmx1024m
pipelines:
    pull-requests:
        '**':
             - <<: *analyze
```

I got the following warning message from sonarcloud:
> The version of Java (11.0.3) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17. Read more

Does Atlassian plan to update this image with Java 17?


Answers:
author: Oleksandr Kyrdan
body: Hi [@V?ctor Salvans](/t5/user/viewprofilepage/user-id/5283954)

Thank you for your question!

The pipe is maintained by sonarsource team, please follow the link in the [Support section of the README.md](https://bitbucket.org/sonarsource/sonarcloud-scan) and suggest to do all needed updates.

Best regards,  
Oleksandr Kyrdan

comments: author: V?ctor Salvans
body: Thanks, I've found someone asking the same in sonarsource  

<https://community.sonarsource.com/t/sonarcloud-sonar-scan-bitbucket-pipe-1-4-0-uses-deprecated-java-11/96863>


author: J_ Stolp
body: update  

```
sonarsource/sonarcloud-scan:1.4.0
```

<br />

to:  

```
sonarsource/sonarcloud-scan:2.0.0
```


Tags: bitbucket-cloud

cloud
service docker exceeded memory limit
Asked by Suthakar Ganeshamoorthy:

Service docker exceed the memory limit, how to fix the following issue ?

![Docker Failed.png](/t5/image/serverpage/image-id/272905i20D099807C82460A/image-size/large?v=v2&px=999 "Docker Failed.png")


Answers:
author: Theodora Boudale
body: Hi [@Suthakar Ganeshamoorthy](/t5/user/viewprofilepage/user-id/5227741),

Regular build steps have 4096 MB of memory in total, while large build steps (which you can define using [size: 2x](https://support.atlassian.com/bitbucket-cloud/docs/step-options/#Size)) have 8192 MB in total. Service containers get 1024 MB memory by default if you haven't specified a different memory limit in your bitbucket-pipelines.yml file.

The error means that your Docker service does not have enough memory. You can increase the memory of the service in your bitbucket-pipelines.yml file.

If the service is used in a regular step, its memory can be increased up to 3072 MB. If the service is used in a large step (with the **size: 2x** option), its memory can be increased up to 7128 MB.

You can check the following documentation for more information and also an example of how to configure memory for a service:

* <https://support.atlassian.com/bitbucket-cloud/docs/databases-and-service-containers/>

All the above applies to builds that run in Atlassian infrastructure. If you are using a self-hosted Linux Docker Runner you can configure 4x and 8x steps (if the host machine has that memory), which means you can increase the service memory up to 15360 MB and 31744 MB respectively.

Please feel free to let me know if you have any questions.

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
How to push jar from local system to Bitbucket?
Asked by Sumit Patel:

Can someone help me to copy Jar file from local system to Bitbucket? I can able to copy other files but jar not showing on list, but in folder i can see jar file. Is Git not allowed to add jar into bitbucket?


Answers:
author: Theodora Boudale
body: Hi [@Sumit Patel](/t5/user/viewprofilepage/user-id/5269487) and welcome to the community!

It sounds like there might be a **gitignore** file either in the repo or elsewhere in your system. The gitignore specifies which files should be ignored by Git.

Please see the info on the following page from Git documentation regarding the location of the file and how it is used:

* <https://git-scm.com/docs/gitignore>

If there is a gitignore and the extension .jar is added to it, this explains why Git cannot see it.

Removing this extension from the gitignore should solve the issue. However, if you do not need to version the .jar files, ++I would not recommend doing that++ . Git was designed to work with text files. While you can commit and push binary files as well, this may affect the performance of the repo. If you are using Bitbucket Cloud, you could upload the jar file to the **Downloads** section of the repo.

In case you do need to version the jar file, I would recommend looking into using Git LFG instead (the documentation is specific to Bitbucket Cloud, which I see you are using):

* <https://support.atlassian.com/bitbucket-cloud/docs/manage-large-files-with-git-large-file-storage-lfs/>

Please feel free to let me know if you have any questions.

Kind regards,  
Theodora


Tags: unknown-hosting-type
Time out Exception - ESOCKETTIMEDOUT
Asked by Suthakar Ganeshamoorthy:

***`How to resolve the following exception ?`***  
[2/4] Fetching packages...  
96
info There appears to be trouble with your network connection. Retrying...  
info If you think this is a bug, please open a bug report with the information provided in "/app/yarn-error.log".  
110
info Visit <https://yarnpkg.com/en/docs/cli/install> for documentation about this command.  
111
error An unexpected error occurred: "[https://registry.yarnpkg.com/@blueprintjs/icons/-/icons-4.16.0.tgz:](https://registry.yarnpkg.com/@blueprintjs/icons/-/icons-4.16.0.tgz) ESOCKETTIMEDOUT".  
112
info There appears to be trouble with your network connection. Retrying...  
113
The command '/bin/sh -c yarn install' returned a non-zero code: 1


Answers:
author: Theodora Boudale
body: Hi [@Suthakar Ganeshamoorthy](/t5/user/viewprofilepage/user-id/5227741) and welcome to the community!

There are some suggestions about this issue in the following knowledge base article, **Scenario 5.1** :

* <https://confluence.atlassian.com/bbkb/troubleshooting-bitbucket-pipelines-1141505226.html#TroubleshootingBitbucketPipelines-scenario5>

Do the suggestions there help to resolve the issue?

Kind regards\<  
Theodora


Tags: bitbucket-cloud

cloud
Can't run atlassian/trigger-pipeline pipe with the existing BITBUCKET_ACCESS_TOKEN
Asked by Alexander Lavrentyev:

Hello!  

Starting from July'10, 2023 can't run "atlassian/trigger-pipeline" pipe with the existing BITBUCKET_ACCESS_TOKEN.   

Error:  

    Status: Downloaded newer image for bitbucketpipelines/trigger-pipeline:5.1.3

    ? API request failed with status 401. Check your account and app password and try again.

`Token was revoked and I've got the same result. And status of token using is "never". Looks like it's trying to use"`BITBUCKET_USERNAME`" and "`BITBUCKET_APP_PASSWORD`" instead of "`BITBUCKET_ACCESS_TOKEN`".`  
`Pipe is the following:`

```
- step: &project-name
    name: Deploy Project-name
    script:
      - pipe: atlassian/trigger-pipeline:5.1.3
        variables:
          BITBUCKET_ACCESS_TOKEN: "$INTERNAL_PIPELINE_TOKEN"
          REPOSITORY: "repository-name"
          CUSTOM_PIPELINE_NAME: deploy-to-dev
          WAIT: "true"
          PIPELINE_VARIABLES: >
            [{
              "key": "Stand",
              "value": "$Stand"
            }]
```

Token permissions: `Pipelines Write, ``Repositories Read`

Variable exists in the pipe (env):

```

--env=BITBUCKET_ACCESS_TOKEN="$INTERNAL_PIPELINE_TOKEN" \
```


Answers:
author: Alexander Lavrentyev
body: Resolved.

It was incorrect value of token in workspace vars.


Tags: bitbucket-cloud

bitbucket-pipelines

cloud

trigger
run logic before I can upstream commit to bitbucket. commit push should fail on logic failure.
Asked by Pramod Bisht:

run logic before I can upstream commit to bitbucket. commit push should fail on logic failure. Maybe some kind of hook, which triggers logic?


Answers:
author: Mateus T
body: Hi [@Pramod Bisht](/t5/user/viewprofilepage/user-id/4754189)

Looks like the best way to achieve this would be to create a pre-push hook to run this logic and refuse the push if it fails.

For now, Bitbucket does not provide an option to manage server-side hooks, this is currently under consideration for the following Feature Request:

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

With this in mind, you would need to perform this action on client-side hooks. We have an article explaining how you can achieve this:

* <https://confluence.atlassian.com/bbkb/standardize-git-hooks-across-a-repository-1188414983.html>

Cheers,

Mat


Tags: bitbucket-cloud

cloud
BitBucket?????????
Asked by ?? ????:

???????BitBucket???????????????????????????????

BitBucket????????????????SourceTree????????????????????????????????????????????????

???????????????????????

???????BitBucket???????????????????

???BitBucket??????????????????????????????


Answers:
author: Ai Hirama
body: ?????????????????????????

??????????????????Bitbucket???????????????????????????????????????????????

????????????????????????????????????????????????????????

comments: author: ?? ????
body: ????????????????????????????

????????????????????????????????????????????????

??????????????????BitBucket???????????![????????? 2019-08-29 11.28.10.png](https://community.atlassian.com/t5/image/serverpage/image-id/64655i7551C99FE286EC56/image-size/large?v=v2&px=999 "????????? 2019-08-29 11.28.10.png")![????????? 2019-08-29 12.01.57.png](https://community.atlassian.com/t5/image/serverpage/image-id/64656iBB3D8433400D08F5/image-size/large?v=v2&px=999 "????????? 2019-08-29 12.01.57.png")


author: Nobuyuki Mukai
body: ????????????????????????????????????

Bitbucket Server????????????SourceTree?????????????????????SourceTree???????????????????????????????????

<https://ja.confluence.atlassian.com/sourcetreekb/how-to-wipe-sourcetree-preferences-412484640.html>

???????????????????????????????????????


author: ?? ????
body: ?????????????

?????????????????????????????


Tags: language-ja
Why does your Support website not have help for Mercurial Merging???
Asked by Bruce_Holm:

I forget to do a Pull in SourceTree (Hg) and Push changes. Boom! Conflict due to two heads.

This is a common mistake. WHY do I find no Help on your Support site???

I made a Search for "Mercurial merge branches" and got NOTHING! That sucks!

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


Answers:
author: Bruce_Holm
body: What is even worse is I search for just "merge" and got this.

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


Tags: atlassian-support
GitHub auth totally broken on SourceTree for Mac
Asked by kevinfoley:

GitHub authentication is totally broken in all recent versions of SourceTree for Mac

1. If you save your GitHub account with Basic authentication, SourceTree asks for your password 3 - 5 times each time you commit or pull. There is a "save password to keychain" checkbox, but this does not function correctly, and SourceTree always asks for your password
2. If you save your GitHub account with OAuth, SourceTree does not request the correct permissions. It only requests permission to read public repositories. It does not request write permission for public repositories, nor any permissions for private repositories. This makes SourceTree completely useless, as it cannot commit files to GitHub nor interact with private repositories in any way.


Answers:
author: Stephen Sifers
body: Hello Kevin,

We see you have a comment on a pre-existing post. We'll reference that post here to avoid duplication of the topic and help centralize feedback and updates. This post is a duplicate of the following: <https://community.atlassian.com/t5/Sourcetree-questions/Sourcetree-for-Mac-GitHub-account-permissions/qaq-p/961120>

Regards,  
Stephen Sifers
Please Re-open SRCTREEWIN-7189
Asked by Shane DiDona:

Please Re-open SRCTREEWIN-7189 The bug is back in version 3.2.6 and is highly disruptive to my team. -Shane


Answers:
author: Stephen Sifers
body: Hello Shane,

Thanks for reporting this possible regression. I've added this post to the reported bug. We're working with the team to review the closed bug report.

Regards,  
Stephen Sifers

comments: author: Shane DiDona
body: oh ok; any progress? The bug remains as of sep 12 2019
Push menu does not show any branch
Asked by valeriuo:

I am using Sourcetree v3.2.6 on Win10, but I noticed this issue a few versions ago.

When I press the Push button, the push menu pops up, but there is no branch listed on any of the remotes. I can push from the terminal, but it is more convenient to do it from the GUI. I checked my credentials in the Authentication menu and all looks fine.

Any suggestions?

![SourcePush.PNG](/t5/image/serverpage/image-id/64591i29962174E12882B4/image-size/large?v=v2&px=999 "SourcePush.PNG")


Answers:
author: valeriuo
body: I see there is another issue (probably more) on the same topic that has gained more traction.

<https://community.atlassian.com/t5/Sourcetree-questions/Push-does-not-work-since-3-2-5/qaq-p/1152545>


author: Viviane Garcia
body: Same happens to me. :(


Tags: windows