youngmon/atlassian-qna huggingface dataset:
Automation/Integration with Teams failed (400 - Webhook Bad Request - null or empty eventType)
Asked by Hubert Bartkowiak:

Hi,

I've tried to run an automation integrating with Teams. I've created and used a webhook: <https://myname.webhook.office.com/webhookb2/>... (created on Teams channel level).

But my automation fails with an error:  
Error communicating with the API  
400 - Webhook Bad Request - null or empty eventType  
What's the issue here? Is it on Jira or Teams side?


Answers:
author: Eric
body: Hi [@Hubert Bartkowiak](/t5/user/viewprofilepage/user-id/4939766)

Based on your description sounds like there could be a problem with the request payload you're sending from Jira. Sounds like the payload needs eventType but it's not specified?

Cheers,

Eric

comments: author: Hubert Bartkowiak
body: I don't use field named like that in automation.   
I worry that might be some permission on teams/office level?


author: Hubert Bartkowiak
body: What I check or trouble-shoot here?


author: Eric
body: Hi [@Hubert Bartkowiak](/t5/user/viewprofilepage/user-id/4939766)

Apology for my previous response. I think I misunderstood your original question.

Could you please take a look at this community question: <https://community.atlassian.com/t5/Bitbucket-questions/Jira-Automation-Microsoft-Teams-Message-with-Error-400/qaq-p/1341087> ? I think it's the same problem as yours, perhaps you could try the suggested solution.

Eric


author: Hubert Bartkowiak
body: Thank you. Strange I couldn't search for it... I cannot see this webhook, but I will continue topic there.


Tags: ms-office

ms-teams
Why does the MacOS Runner fail with 401 or 409 error randomly?
Asked by trittmueller:

I am really desparate right now, because the runner seems to be very instable.

It randomly throws the following error:

*** ** * ** ***

\[2024-03-26 08:42:54,961\] Updating runner state to "ONLINE".

\[2024-03-26 08:42:55,000\] An error occurred whilst updating runner state to "ONLINE".

com.atlassian.pipelines.stargate.client.core.exceptions.StargateUnauthorizedException: Response Summary: HttpResponseSummary{httpStatusCode=401, httpStatusMessage=Unauthorized, bodyAsString={"code":401,"message":"Unauthorized"}}

at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:62)

Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:

Error has been observed at the following site(s):

\*__checkpoint ? 401 from PUT <https://api.atlassian.com/ex/bitbucket-pipelines/rest/internal/accounts>

*** ** * ** ***

Could it have to do with the following error, that also occured randomly? I know the error looks like that the runner was used by several parties at the same time. However, it is only used in one repository.

*** ** * ** ***

\[2024-03-25 15:49:26,275\] Updating runner state to "ONLINE".

\[2024-03-25 15:49:26,650\] An error occurred whilst updating runner state to "ONLINE".

com.atlassian.pipelines.stargate.client.core.exceptions.StargateConflictException: Response Summary: HttpResponseSummary{httpStatusCode=409, httpStatusMessage=Conflict, bodyAsString={"key":"agent-service.runner.conflict","message":"Simultaneous state updates were attempted for runner with id:

*** ** * ** ***

I couldn?t find any help for either of the errors anywhere, so I will be grateful for any advice.

If that is important: I am using the latest Java Version.

I tried both the latest runner version and an older one (1.508), just to see if that would change anything, but sadly no.


Answers:
author: Ben
body: Hi Tritt,

I can see that you are a member of a **Premium** company workspace (the name starts with a C).

Please raise a ticket directly with our support team using your company workspace URL with **Bitbucket Cloud** selected as the product and **Technical Issues \& Bugs**selected as the issue type so that we may gain access to your workspace and assist you further:

* <https://support.atlassian.com/contact/>

If you have issues raising a ticket, please let me know and I will do so on your behalf - I will need to know your timezone so I can get this routed to the team within your geographical location.

Cheers!

- Ben (Bitbucket Cloud Support)


Tags: bitbucket-cloud

bitbucket-runners

cloud
pipe atlassian/ssh-run:0.4.3 return error when running npm run build
Asked by anhtruc92cr:

Hello,

My pipeline return error on ssh-run step:

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

YML file:  

```
image: node:latest

definitions: 

  steps:

    - step: &build-test

        name: Build and test

        caches:

          - node

        script:

          - npm install

          - npm run build

        artifacts:

          - .next/**

    - step: &deploy

        name: Deploy artifacts using SCP to PROD

        script:

          - &deploy-script

            pipe: atlassian/scp-deploy:0.3.3

            variables: &deploy-variables

              USER: $USER

              SERVER: $SERVER

              REMOTE_PATH: '/var/www/html/'

              LOCAL_PATH: '${BITBUCKET_CLONE_DIR}/*'

          - &ssh-script

            pipe: atlassian/ssh-run:0.4.3

            variables: &ssh-variables

              SSH_USER: $USER

              SERVER: $SERVER

              COMMAND: 'cd /var/www/html && npm install && npm run build && npm run start'

pipelines:

  branches:

    develop:

      - step:

          <<: *build-test

          name: Build and test on develop

      - step: 

          <<: *deploy

    production:

      - step:

          <<: *build-test

          name: Build and test on production

      - step: 

          <<: *deploy

          deployment: production

          script:

              - <<: *deploy-script

                variables:

                    <<: *deploy-variables

                    SERVER: $SERVER_PRODUCTION

              - <<: *ssh-script

                variables:

                    <<: *ssh-variables

                    SERVER: $SERVER_PRODUCTION
```

Thank you in advance for any assistance!


Answers:
author: Ben
body: Hi [@anhtruc92cr](/t5/user/viewprofilepage/user-id/5463828)

The error does not appear to relate to Pipelines, that error is NPM specific and mentions the picocolors dependency, essentially the error means that the parser cannot interpret the code as there is an issue with the command syntax.

As you are using the latest node image, I'd suggest downgrading to a previous node version (if these commands were working in the past), or updating your version of the picocolors dependency.

Cheers!

- Ben (Bitbucket Cloud Support)


Tags: bitbucket-cloud

bitbucket-pipelines

cloud
Invitations endpoint return 404
Asked by Alejandro Petit:

Is the V1 API fully deprecated for Free plan? Getting 400 error, that do not have access to view the workspace even if i am the org owner.

Using endpoint: <https://api.bitbucket.org/1.0/users/{workspace}/invitations>


Answers:
author: Theodora Boudale
body: Hi Alejandro and welcome to the community!

This endpoint is available only for Bitbucket workspaces that are not managed at admin.atlassian.com.

If you have moved the administration from in Bitbucket Cloud to admin.atlassian.com then this endpoint will be disabled for that workspace, and you'll need to use the cloud admin APIs.

You can find more details here:

* <https://developer.atlassian.com/cloud/bitbucket/announcement-breaking-change-remaining-10-endpoints/>

The billing plan of the workspace doesn't have anything to do with this.

Kind regards,  
Theodora

comments: author: Alejandro Petit
body: Hello! And thank you. Coming back to review this setup. Is there a new endpoint that can be used for invitations in admin.atlassian.com?

Cheers


author: Theodora Boudale
body: Hi Alejandro,

At the moment, an invitation can be sent only if you also use JIRA Cloud (with the Jira APIs) or if you use User Provisioning with an Atlassian Guard (formerly known as Atlassian Access) subscription.

If you also use Jira Cloud, you can use the following API endpoint to create and invite a user:

* <https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-users/#api-rest-api-3-user-post>

You can use **"products": \[\]** in the request's data, so that the new user doesn't gain access to Jira, like this:

```
--data '{
"emailAddress": "some-email@domain.com",
"products": []
}'
```

You can then use the Org Directory APIs to add or remove a user from groups:

* <https://developer.atlassian.com/cloud/admin/organization/rest/api-group-directory/#api-group-directory>

You can also find some tutorials here (navigate to the different tutorials from the left sidebar):

* <https://developer.atlassian.com/cloud/admin/organization/>

If you use User provisioning, the API to create a user is the following:

* <https://developer.atlassian.com/cloud/admin/user-provisioning/rest/api-group-users/#api-scim-directory-directoryid-users-post>

I went ahead and created a feature request for the ability to create / invite a new org user via API (for customers who don't use Jira Cloud or User Provisioning):

* <https://jira.atlassian.com/browse/ID-8663>

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
Unable to connect to postgres database
Asked by Zohreh Servati:

We are moving are bitbucket data center onto another host which connects to a new PostGres databae. We have replicated database and bitbucket app+bitbucket-home folders, plus other necessary setups. However the bitbucket cannot connect to the new PostGres DB

Here is the error seen in the log:

2024-03-26 16:15:13,120 DEBUG \[spring-startup\] org.postgresql.Driver Connection error:  
org.postgresql.util.PSQLException: Could not find a server with specified targetServerType: primary  
at org.postgresql.Driver$ConnectThread.getResult(Driver.java:417)

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

Here is the db properties set in bitbucket.properties

jdbc.driver=org.postgresql.Driver  
jdbc.url=jdbc:postgresql://\<hostname\>.idanalytics.com:5432/\<db name\>  
jdbc.user=\<user\>  
jdbc.password=\<passwd\>


Answers:
author: Rad Jandric
body: After some poking around I've added

```
host all all 0.0.0.0/0 md5
```

to my pg_hba.conf which allowed the connectivity from the web server (or pretty much from any host) , also check the user grants and if the bitbucket user password is correct one. Bitbucket comes with a bundled postgresql driver already. Check the ports on which Postgres is running on something like:

```
netstat -tulpn | grep postgres
tcp 0 0 0.0.0.0:5432 0.0.0.0:* LISTEN 1239460/postgres
tcp6 0 0 :::5432 :::* LISTEN 1239460/postgres
```

Just to see if port 5432 is the one in use because during migration from lower to higher Postgres version the new cluster takes new port, like 5433 for example and config file for Bitbucket expects default 5432.


author: Rad Jandric
body: I have the exact same problem, when I test the connectivity to the databsze host using command line tools it all works just fine:

```
bitbucket@remote-www-host: psql -h 192.168.98.11 -p 5432 -U bitbucketuser bitbucket
Password for user bitbucketuser:
psql (14.11 (Ubuntu 14.11-0ubuntu0.22.04.1), server 11.22 (Debian 11.22-0+deb10u1))
SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, bits: 256, compression: off)
Type "help" for help.

bitbucket=> \l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------+---------------+----------+-------------+-------------+-----------------------
bitbucket | bitbucketuser | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
test_db | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
test_db2 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
(6 rows)
```

But when the app starts up I get the same error.


Tags: bitbucket-data-center

data-center
1 commit behind "release"
Asked by Sara Carlile:

Hello. Our workflow involves 3 main branches and then feature branches. We have

1. Release branch
2. Master branch
3. Develop Branch

Right now our Master branch is 1 commit behind Release. We are getting requested to Synch now. However the code between the branches is identical, and the difference between the branches is the commit:

"Merge branch 'master' into release"

We had the opposite issue where Master was ahead of Release due to the merge commits, so we merged Master into Release. It seems like we will always be chasing our tail if the merge commits cause our branches to be out of synch. We did not have this issue before.

Does anyone have any suggestions?


Answers:
author: Theodora Boudale
body: Hi Sara,

Master branch being 1 commit behind release means that there is one commit on release branch that is not reachable by the tip of master. This doesn't mean that the code on the two branches is necessarily different and it is expected behavior when you merge with merge commits or squash.

If you merge master branch into release with merge commit, the tip of release will be that merge commit. However, master's tip will not change and that merge commit is not reachable by the tip of master.

You could use fast-forward merges, but this is only possible when there is a linear path from the current branch tip to the target branch. You can read more on git merge here:

* <https://www.atlassian.com/git/tutorials/using-branches/git-merge>

If the source code between the two branches is the same, you can ignore the prompt to sync branches.

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
Bitbucket Pipeline won't finish the Build Setup
Asked by Mario Brino:

Today we noticed that the bitbucket pipelines were starting but not finishing, basically getting stuck in the build setup. Typically we would see the pipeline running for 5-15 minutes, but it takes 1-2 hours to fail in the build setup. We are using a private image from Docker Hub. Other repositories are working just fine.
> This was working just fine a couple of days ago, and today we cannot start the pipeline, otherwise it will fail after 120 minutes.

Any ideas what the possible problem with this is?


Answers:
author: Theodora Boudale
body: Hi Mario and welcome to the community!

**1.** Are you running these pipelines builds on Atlassian infrastructure or are you using a self-hosted Linux Docker runner?

**2.** Does the build log for affected builds show any info at all in the **Build Setup**? If so, can you post it here?

**3.** Is there any error displayed next to the build log, right below the build number? If so, could you let me know what error is displayed there?

**4.** If you are using a self-hosted Linux Docker runner, can you please check the runner log and share the entries at the time of the failed build? (make sure to sanitize any private/sensitive data prior to sharing)

The runner log can be found in this path:

```
<runner_working_directory>/<runnerUuid>/runner.log
```

The default working directory for the runner is the **/tmp** directory.

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
Credentials Error with OAuth Consumer Integration
Asked by John Saputo:

I am trying to integrate a Bit Bucket Cloud repo to platform.sh

I am following the instructions here - <https://docs.platform.sh/integrations/source/bitbucket.html#bitbucket-cloud>

The first step is to create an OAuth consumer. I created one with these settings -

![bitbucketsettings.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/314881i0855F29B4D8C8A10/image-size/large?v=v2&px=999 "bitbucketsettings.jpg")

The instructions then say to run this command -

    platform integration:add \  --project PROJECT_ID \  --type bitbucket \  --repository OWNER/REPOSITORY \  --key CONSUMER_KEY \  --secret CONSUMER_SECRET

I am using "\<repo_details_edioted_for_privacy\>" as my repository. I am doing this because it is in the URL of my repo. Also if I run git command -v it returns

\<repo_details_edioted_for_privacy\>

My command looks like this -

    platform integration:add \  --project platformprojecthere \  --type bitbucket \  --repository <repo_details_edioted_for_privacy> \  --key keyhere \  --secret secrethere

With the "platformprojecthere" replaced with the correct platform sh project ID

"keyhere" with the Key from OAuth consumers page

"secrethere" with the Secret from the OAuth consumers

I get this error in terminal -

Invalid Bitbucket credentials  
Ensure that the OAuth consumer key and secret are valid.  
Additionally, ensure that the OAuth consumer has a callback URL set (even just to <http://localhost>).

If I use the GUI I get this error -

We have trouble accessing the remote repository at Bitbucket: unknown exception

Is there a something else I need to set up with the Bit Bucket repo?


Answers:
author: Theodora Boudale
body: Hi John and welcome to the community!

If you have confirmed that the OAuth consumer key and secret are correct, I would suggest reaching out to platform.sh support team. This integration is not built by Atlassian and we cannot provide much assistance.

The following page has info on how to get support:

* <https://docs.platform.sh/learn/overview/get-support.html>

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
error with bitbucket login.
Asked by Prakash Ramachandran:

I am not able to login to bitbucket i get the error

----  

We couldn't log you in {#toc-hId--381101035}
--------------------------------------------

You may run into this issue when you use specific browsers or add-ons that hide the referer header for id.atlassian.com and other Atlassian sites. Check for these and then try logging in again.

-----

this is across multiple browsers i tried.

i can login using id.attlasian.com and then i am able to login to trello. but bitbucket gives this error.

raising request as mentioned in <https://community.atlassian.com/t5/Bitbucket-questions/Can-t-log-in-to-my-bitbucket-account/qaq-p/1971607>


Answers:
author: Laurie Sciutti
body: Hi [@Prakash Ramachandran](/t5/user/viewprofilepage/user-id/5463457) and welcome to the Community! Your account may be inactive so you'll need Atlassian Support assistance. Maybe [@Patrik S](https://community.atlassian.com/t5/user/viewprofilepage/user-id/4603309) or [@Theodora Boudale](https://community.atlassian.com/t5/user/viewprofilepage/user-id/818086) can assist.

comments: author: Ben
body: Hi [@Prakash Ramachandran](/t5/user/viewprofilepage/user-id/5463457)

I've just re-activated your account so you should be able to login now, please clear your browser cache and perform the login process again. Your account was marked DORMANT as you had not logged in via the UI in quite a few years.

Cheers!

- Ben (Bitbucket Cloud Support)


author: Prakash Ramachandran
body: [@Ben](/t5/user/viewprofilepage/user-id/4537226)thank you able to login now.

[@Laurie Sciutti](/t5/user/viewprofilepage/user-id/1137433)thaank you for the quick triaging.


Tags: bitbucket-cloud

cloud
'Upload App' link is missing on the 'Manage Apps' page post upgrade to 8.9.11
Asked by GSHerber:

'Upload App' link is missing on the 'Manage Apps' page post upgrade to 8.9.9 to 8.9.11, anyone have an idea why?


Answers:
author: GSHerber
body: Never mind, this was a change made in 8.9.10.


Tags: bitbucket-data-center

bitbucket-server

data-center

server
Anyone using Bitbucket DC on Kubernetes that scaled more than 1?
Asked by Mark Hubers:

Does anyone have this working where you have more than one Bitbucket server (HA), and how did you deal with helm PersistentVolumeClaim?

The other idea I am thinking of is using one Helm release per Bitbucket instance on Kubernetes to get around this problem. This may even give me the option to upgrade one at a time or take one down when needed rather than using a rolling update that can go wrong and take down all the HA servers.

Any ideas/tips/examples?


Answers:
author: Yevhen
body: [@Mark Hubers](/t5/user/viewprofilepage/user-id/250113) of course it is possible to scale Bitbucket StatefulSet to as many replicas as you need. What issues with a PVC do you face?

comments: author: Mark Hubers
body: The 2nd instance stays in pending mode as it says the PVC is used by another pod. I have to setup the PVC outside of helm so that we can use EBS-CSI with snapshots and to never lose that data if someone delete the PVC.

I pass this to helm:  
values = \[  
\<\<-EOT  
volumes:  
sharedHome:  
mountPath: "/var/atlassian/application-data/shared-home"  
customVolume:  
persistentVolumeClaim:  
claimName: ${local.pvc_shared_name}

localHome:  
mountPath: "/var/atlassian/application-data/bitbucket"  
customVolume:  
persistentVolumeClaim:  
claimName: ${local.pvc_localhome_name}  
EOT  
\]  

It seems if I use "  
additionalVolumeClaimTemplates: \[\]" that it create the PVC for me and I have no control over how that PV would be setup and if someone did a helm delete all our data is gone.  
Am I crazy to overthink this? :)


author: Yevhen
body: Shared home PVC must be RWX, yours is RWO - that's why the second pod can't mount it.


author: Mark Hubers
body: The shared home is RWX and that one is getting mounted on the 2nd pod. It is the local home that is RWO, as each bitbucket pod needs its own.   

bitbucket-sharedhome-pv 2Gi RWX Retain Bound bitbucket/bitbucket-sharedhome-pvc efs-sc 47h  
pvc-c24e8df7-3b7d-4e98-95b6-8c2a4df18b35 20Gi RWO Delete Bound bitbucket/bitbucket-localhome-pvc ebs  

I cannot find a way to give each bitbuket pod it own localhome using ebs-csi driver


author: Mark Hubers
body: Or should I even care if the localhome gets deleted at times as I not clear what happens to things like cache data etc.


author: Yevhen
body: <https://github.com/atlassian/data-center-helm-charts/blob/main/src/main/charts/bitbucket/values.yaml#L223> you need to set this to true which will enable volumeClaimTemplates in Bitbucket sts spec.


Tags: bitbucket-data-center

bitbucket-server

data-center

server
I cannot login in to my bitbucket account even i have token key from authy ,please Hel me its urgent
Asked by preeti:

I cannot login in to my bitbucket account even i have token key from authy ,please Hel me its urgent


Answers:
author: Theodora Boudale
body: Hi [@preeti](/t5/user/viewprofilepage/user-id/5075356),

You can check the following page, section **Troubleshooting two-step verification**, for common issues with Bitbucket 2FA:

* <https://support.atlassian.com/bitbucket-cloud/docs/enable-two-step-verification/#Troubleshooting-two-step-verification>

If none of the suggestions there work for you, you can disable 2FA for your account (and you can enable it again afterwards). You can find steps in the following knowledge base article:

* <https://confluence.atlassian.com/bbkb/how-to-disable-reset-2fa-on-bitbucket-cloud-and-atlassian-account-1236932929.html>

Please keep in mind that the 2FA recovery email is sent 24 hours after you request it.

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

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud