youngmon/atlassian-qna huggingface dataset:
How do you define deployment environment variables at the workspace level?
Asked by Ben Orgil:

All of our bitbucket pipelines for all our repos use the same environments and same secrets. I suspect this is common for many other users too.

I don't want users to have to add these same environment variables to every repo they create because they could all be the same and be defined at the workspace level once.

How do you do this? When I look at the PIPELINES setting at the workspace level I see only:

\* Workspace runners  
\* Workspace variables

Where is "Workspace environments" ?


Answers:
author: Mark C
body: Hi [@Ben Orgil](/t5/user/viewprofilepage/user-id/434064),

Thanks for reaching out to the community.

Unfortunately, we do not have a setting where you can add deployment environment variables at the workspace level.  
However, I do believe it is a useful feature to be able to set/add that at the workspace level.  
For this, I went ahead and created a feature request for it that can be located through this link. - <https://jira.atlassian.com/browse/BCLOUD-22012>  
You can upvote and watch it for now so that you'll be notified of any updates from our team when the feature becomes available on Bitbucket Cloud.  
![](https://getsupport.atlassian.com/images/icons/emoticons/information.png) Please do note that we don't have an exact ETA for the feature request as all new features will be implemented according to our policy [here](https://confluence.atlassian.com/support/implementation-of-new-features-policy-201294576.html).

As a workaround, instead of using deployment environment variables, you can add your variables to the [Workspace level environment variables](https://support.atlassian.com/bitbucket-cloud/docs/variables-and-secrets/#Workspace-variables) instead.  
For now, you'll have to manage the variable naming based on your environments (e.g. for Staging/test, production).

Do let me know if you have further questions.

Regards,  
Mark C


Tags: bitbucket-cloud

cloud
Timeout on API request to create Pull Requests
Asked by Mike:

All of a sudden, all of our API-based requests to create Pull Requests are failing. When trying to make the request via Postman, I get a 504 Gateway Time-out. These integrations have been working fine for years. Is there a temporary issue on the Bitbucket side?

Request body:

```
{
  "title": "Staging merge to Release Candidate",
  "source": {
    "branch": {
      "name": "staging"
    }
  },
  "destination": {
    "branch": {
      "name": "release-candidate"
    }
  }
}
```

Response:

```
<html>
<head>
    <title>504 Gateway Time-out</title>
</head>
<body>
    <center>
        <h1>504 Gateway Time-out</h1>
    </center>
</body>
</html>
```


Answers:
author: Mike
body: I've been made aware that a bug has been filed with the Bitbucket development team: <https://jira.atlassian.com/browse/BCLOUD-22009>


author: Eli Lindahl
body: My team is seeing the same issue. We are using some script listeners through Jira's ScriptRunner to create PRs and we are seeing timeouts. Some appear to be making the request successfully though, while others are hung for 60s before timing out.


author: Rodrigo Prates
body: Same here.


author: Sascha Reinhold
body: I can confirm that, this is also the case for us. Bitbucket pull requests are unbearably slow and even have timeouts.


Tags: bitbucket-cloud

cloud

integration

pull-request

rest-api
Artifact fails to copy into original folder
Asked by Patrick Bye:

I tried to make an artifact of my node_modules. The artifact has all the files in it but after extracting, it fails on copying the same file every time. I think the windows runner thinks it's a directory instead of a file. I've watched the folders while the step was running and the artifact directory had all the files but the copy stops part way through with this error. It's always this file every time

Copy-Item : Could not find a part of the path 'E:\atlassian\atlassian-bitbucket-pipelines-runner\temp\82885005-9ced-516  
5-a84d-a1b4d3b8ddab\1657559674402\artifact\2f585524-6ec1-49b0-b5ee-01b9e600ebe3\Trader.UI\node_modules\@babel\plugin-bu  
gfix-safari-id-destructuring-collision-in-function-expression\LICENSE'.  
At E:\atlassian\atlassian-bitbucket-pipelines-runner\temp\82885005-9ced-5165-a84d-a1b4d3b8ddab\1657559674402\tmp\setupA  
rtifacts17884213904454524061.ps1:3 char:1  
+ Copy-Item -Path "E:\atlassian\atlassian-bitbucket-pipelines-runner\bi ...  
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  
+ CategoryInfo : WriteError: (LICENSE:FileInfo) [Copy-Item], DirectoryNotFoundException  
+ FullyQualifiedErrorId : CopyDirectoryInfoItemIOError,Microsoft.PowerShell.Commands.CopyItemCommand


Answers:
author: Mark C
body: Hi [@Patrick Bye](/t5/user/viewprofilepage/user-id/2558551),

Thanks for reaching out to the community.

I've confirmed this with our Bitbucket Pipelines team and this appears to be a limitation with the Windows maximum path length.  
You can check this link for more information: [Windows - Maximum Path Length Limitation](https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=cmd)

I've also gone ahead and created a public bug ticket for this that can be located through this link so that we can track it. - <https://jira.atlassian.com/browse/BCLOUD-22022>

As a workaround, you can try:

* Using a short file path location (e.g. "E:\\r\\tmp"); or
* Change the default maximum characters in Windows (For Windows 10) - See relevant links below  
  <https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=cmd>  
  <https://knowledge.autodesk.com/support/autocad/learn-explore/caas/sfdcarticles/sfdcarticles/The-Windows-10-default-path-length-limitation-MAX-PATH-is-256-characters.html>

Hope it helps and do let me know how it goes.

Regards,  
Mark C


Tags: bitbucket-cloud

cloud
Delete Bitbucket repository that failed to import?
Asked by Kevin Rodden:

I have been importing repositories from Gitlab to Bitbucket as part of my company's migration to Atlassian.

During this process one of the repositories failed to import and eternally "loads" the repository landing page. Due to this, I cannot access the sidebar or repository settings to delete the repository so I can recover the repository.


Answers:
author: Mark C
body: Hi [@Kevin Rodden](/t5/user/viewprofilepage/user-id/4984283),

Welcome to the community.  
I can see that you have the repository that was stuck in the "Importing" state.  
For this, I went ahead and deleted it on our end.

You can now import the repository again.  
Hope it helps and do let me know if you have further questions.

Regards,  
Mark C


Tags: bitbucket-cloud

cloud
Ho to change/Make avatar appear with commits
Asked by Artur ?migielski:

Hi, I have question about avatars on commits list with all my repos, there is only my firast name latter A, no main avatar. Can i change it ?


Answers:
author: Mark C
body: Hi [@Artur ?migielski](/t5/user/viewprofilepage/user-id/4984127)

Welcome to the community.

Yes, indeed, you can change your avatar.  
You can change this from your Atlassian account's settings.  
You can navigate to this link to change your Atlassian account's avatar. - <https://id.atlassian.com/manage-profile/profile-and-visibility>

Hope it helps and let me know how it goes.

Regards,  
Mark C

comments: author: Artur ?migielski
body: Thank you though it was the first thing I did, unfortunately it doesn't help :-)


author: Mark C
body: Hi [@Artur ?migielski](/t5/user/viewprofilepage/user-id/4984127)

Thanks for that information.  
Would it be possible for you to check if you're using the same email address as the commit's author?  

You can check this by:

1. Going to the repository **Commits** tab
2. Click a commit hash with the avatar that shows "A"
3. Click **View raw commit**(On the right side)
4. Check the commit's author email with the format "**From: Some Name \<some_email@domain.com\>**"

Let me know how it goes.

Regards,  
Mark C


author: Artur ?migielski
body: No, it's diffrent email :-)

It will be enough to add email as alias in Atlassian account ?


author: Mark C
body: Hi [@Artur ?migielski](/t5/user/viewprofilepage/user-id/4984127)

Thanks for that confirmation.  
Another question, if you hover to the commit avatar (with the name letter "A"), does the tooltip shows the message "***This user cannot be matched to an Atlassian account***"?

If yes, you can go ahead and add the email address as an [email alias](https://support.atlassian.com/bitbucket-cloud/docs/set-email-aliases/) to your Bitbucket Cloud account.

But if it doesn't show that, you'd need to log in to <https://id.atlassian.com/> using that email address to change your avatar. - <https://id.atlassian.com/manage-profile/profile-and-visibility>  
This would mean that you have 2 Bitbucket Cloud accounts in this case.

Let me know how it goes.

Regards,  
Mark C


author: Artur ?migielski
body: I've already added email as alias and everything works perfectly :-)

Thanks.


Tags: bitbucket-cloud

cloud
Can i buy this product for one user?
Asked by Pranav.as:

we are very new to the bitbucket.planning to buy premium plan.so my question is that possible to buy this product for one user for checking\& study .and later i can add members.

what is the process and steps to be followed for buying this product.

?


Answers:
author: Nic Brough -Adaptavist-
body: No, because it's free for up to 5 users!

See <https://www.atlassian.com/software/bitbucket/pricing>


Tags: bitbucket-cloud

cloud
Large pull request: "Can't load files"
Asked by Kobus Myburgh:

Hi,

I have a very large pull request affecting 1688 files and 300k lines of code (280k deletions of dead code and 20k of new code (a two month refactoring process).

When I create the pull request on Bitbucket Cloud, it creates successfully, with the message:

"**This is a large pull request.** Large pull requests can only be viewed by loading files individually."

However, when I click on the files tab on the right (where it has the tabs "Details \| Files \| Activity"), I simply get "Can't load files. Try again." Trying again does nothing.

I have reloaded the page. I have cleared cache. I have tried different browsers, I do not know what to do. Please advise.


Answers:
author: Patrik S
body: Hello [@Kobus Myburgh](/t5/user/viewprofilepage/user-id/2037305) ,

Thank you for reaching out to Atlassian Support.

From the description you have provided, your pull request is reaching the limit for viewing the content in the UI.

According to our [documentation](https://support.atlassian.com/bitbucket-cloud/docs/limits-for-viewing-content-and-diffs/), diffs can't exceed the following limitations in order to be properly rendered in the UI:
> * A file's diff cannot exceed 2000 changed lines or 102,400 bytes (100 KB) of raw diff data.
> * The entire diff cannot exceed 8000 changed lines.
> * The maximum number of files in a single diff is limited to 200.

Since these limits exist in order to secure stability in our platform for all users, I'd recommend you to check the diff for this specific PR locally using the following commands:
> 1. Check which files have changed on this branch with the following command:  
>
>    ```
>    $ git diff --stat <source_branch> <destination_branch>
>    ```
>
> 2. You can filter through these files with a simple grep piping  
>
>    ```
>    $ git diff --stat <source_branch> <destination_branch> | grep myFile.txt
>    ```
>
> 3. If you need to check for the diff of a specific file, you can use this command  
>
>    ```
>    $ git diff <source_branch> <destination_branch> myFile.txt
>    ```

We also have a feature request in our public issue tracker to implement the functionality of loading all the changed files of a Pull Request on the file tree navigation shown in the UI :

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

I would 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)

Thank you, [@Kobus Myburgh](/t5/user/viewprofilepage/user-id/2037305) .

Kind regards,

Patrik S

comments: author: Kobus Myburgh
body: Thank you, [@Patrik S](/t5/user/viewprofilepage/user-id/4603309). I have added my vote to the feature request. Your hints on finding diffs manually is also very helpful. Thanks!


Tags: bitbucket-cloud

cloud
Pipeline artifacts not deployed
Asked by Jacob Leech:

Hi there, I have a bitbucket-pipeline.yml file setup as below:  

```
definitions:
  caches:
    node: wp-content/themes/$THEME_NAME/node_modules
  steps:
    - step:  &npm
      name: Build frontend
      image: node:16
      caches:
        - node
      script:
        - cd wp-content/themes/$THEME_NAME
        - npm ci
        - npm run build
      artifacts:
        - wp-content/themes/$THEME_NAME/dist/**
    - step: &deploy
      name: Deploy to staging
      deployment: staging
      script:
        - pipe: atlassian/rsync-deploy:0.7.1
          variables:
            USER: $FTP_USER
            SERVER: $FTP_STAGE_ADDRESS
            REMOTE_PATH: $FTP_STAGE_PATH
            LOCAL_PATH: $BITBUCKET_CLONE_DIR
            EXTRA_ARGS: "-rvz --exclude=.vscode --exclude=.htaccess --exclude=.gitignore --exclude=wp-config.php --exclude=wp-includes/ --exclude=wp-admin/ --exclude=wp-content/uploads/ --exclude=wp-content/languages/ --exclude=node_modules/ --exclude=wp-content/themes/*/node_modules/ --exclude=.git/ --exclude=wp-content/themes/*/src/ --exclude=wp-activate.php --exclude=wp-blog-header.php --exclude=wp-comments-post.php --exclude=wp-config-sample.php --exclude=wp-cron.php --exclude=wp-links-opml.php --exclude=wp-load.php --exclude=wp-login.php --exclude=wp-mail.php --exclude=wp-settings.php --exclude=wp-signup.php --exclude=wp-trackback.php --exclude=xmlrpc.php --exclude=*.scss --chown=www-data:www-data"

pipelines:
  branches:
    develop:
      - step: *npm
      - step: *deploy
```

The pipeline runs successfully, but the compiled artifacts defined in the npm step aren't deployed with the rest of the required files.  
Just wondering why this might be happening? The artifacts file path is relative to the $BITBUCKET_CLONE_DIR.  
Cheers.  
JL  
UPDATE:  
To update, I have also tried using this:  

```
artifacts:
- dist/**
```

still no artifacts are generated... but if I run  

```
script:
- cd wp-content/themes/$THEME_NAME
- npm ci
- npm run build
- ls -l dist
```

it prints out the contents of the dist directory.. confusing


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

I think the issue is that the file path in the artifacts block cannot render variable names.

We have a bug report about this in our issue tracker:

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

Until this is this fixed, you can either replace $THEME_NAME in the artifacts path with the actual value of the variable or use a path like the following:

```
artifacts:
  - wp-content/themes/**/dist/**
```

The latter one will work well if there is only one directory in wp-content/themes (the $THEME_NAME directory) with a subdirectory named dist. If there are more directories in wp-content/themes with a subdirectory dist, then they would all be uploaded as artifacts, so you may want to use the value of the variable instead.

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
POSTs to /pullrequests results in 504/timeouts
Asked by Peter:

(UPDATE: Atlassian have opened <https://jira.atlassian.com/browse/BCLOUD-22009> for this issue. Only seems to happen when a PR is opened with no changes to merge into the destination branch):

*"Creating an empty pull request via API 2.0 endpoint currently hangs with a 504 gateway error."*

*** ** * ** ***

Hi folks,

We are seeing 504s/timeouts for POSTs to **/pullrequests** API over the weekend and today. May be effecting other APIs but not sure.

Is this known or has access to this and similar APIs changed(maybe via whitelisting etc)?

```
b'<html>\r\n<head><title>504 Gateway Time-out</title></head>\r\n<body>\r\n<center><h1>504 Gateway Time-out</h1></center>\r\n</body>\r\n</html>\r\n'
```

Status page at the time of writing looks green <https://bitbucket.status.atlassian.com/>

Thanks!

Peter


Answers:
author: Peter
body: Raised support ticket(I didnt realise that was an option!):

<https://support.atlassian.com/requests/BBS-188867> (may not be visible to everyone)

comments: author: Mike
body: Thanks [@Peter](/t5/user/viewprofilepage/user-id/4983959) - we're unable to submit tickets because we're on the free tier. Would love to know what they say! (can't see the ticket, I believe it's private to you and support)


author: Peter
body: Yeah, they opened a bug with development team. That ticket can be found here: <https://jira.atlassian.com/browse/BCLOUD-22009>


author: Peter
body: This seems to be working for me now, at least POSTs to the pullrequests API is working again.

comments: author: Peter
body: Scratch that, maybe only worked because my PR had changes to merge into the destination branch.

I was made aware of a new bug by Karthick S:

*I also suspect you might be impacted by a bug that is related to the creation of an empty pull request through the API 2.0 endpoint, which crashes with the gateway error 504. That is when trying to create a pull request which has no changes, instead of receiving a message saying "There are no changes. The source and destination are the same.", error 504 is occurring.*

*We already have an open bug with our development team. You can track this bug through this link BCLOUD-22009.*


author: Mike
body: Experiencing the same thing. Didn't see your post before posting my own: <https://community.atlassian.com/t5/Bitbucket-questions/Timeout-on-API-request-to-create-Pull-Requests/qaq-p/2075742>


author: Renato
body: We have been experiencing this same issue since Friday with POST requests. We already tested GET requests and those are working fine. Any help on this would be appreciated.


Tags: bitbucket-cloud

cloud
Someone has already added that SSH key.
Asked by Konstantinos Kallipolitis:

I have two bitbucket accounts and want to access them via ssh from my laptop.When I add the ssh key to the second account i get "Someone has already added that SSH key". Cant I use the same ssh key in both the accounts?


Answers:
author: Nic Brough -Adaptavist-
body: Welcome to the Atlassian Community!

You should not be sharing keys or certificates between different people (accounts), it's not secure and not what they are for.

So, no, Bitbucket won't let you use the same key for two accounts.


Tags: bitbucket-cloud

cloud

ssh
Issues grabbing source from Bitbucket within AWS CodePipeline
Asked by aakhan2021:

When trying to Release a change from AWS CodePipeline (we have an existing Bitbucket integration), we started getting error now.

"Action execution failed  
\[Bitbucket\] Bitbucket returned an Internal Error exception. Please retry shortly. If the issue continues it may be reported on the Bitbucket status page at <https://bitbucket.status.atlassian.com/>"


Answers:
author: Norbert C
body: Hi Everyone,

Thank you for contacting Atlassian Community. My name is Norbert and I'm a Bitbucket Cloud Support Engineer, it's nice to meet with you!

I would like to inform you that we had a small incident which was affecting the Downloads section in Bitbucket Cloud. As AWS CodePipelines wasn't able to download the repository through the "Downloads" section, the builds were failing on AWS side. I'm happy to inform you that this incident has already resolved.

Can you try to re-run the AWS CodePipelines build and let me know whether if the build is working for you?

I'm looking forward to hear from you.

Best Regards,  
Norbert  
Atlassian Bitbucket Cloud Support

comments: author: Dawid Tomkalski
body: Thanks for the info, I can confirm that it works fine


author: Norbert C
body: Thank you for your confirmation [@Dawid Tomkalski](/t5/user/viewprofilepage/user-id/232501) . I'm glad to hear the issue got resolved for you.

Have a great day ahead!

Stay safe!

Best Regards,  
Norbert  
Atlassian Bitbucket Cloud Support


author: aakhan2021
body: Its resolved. Thanks


author: Dawid Tomkalski
body: I have the same problem


Tags: bitbucket-cloud

cloud
Unable to login to my old Bitbucket account
Asked by Frank Geronimo:

Dear support team,

I'm unable to login to an old bitbucket account, this account was created on 2020 before may with the following info:

* user: \<user_removed\>
* email: \<email_removed\>

I want to if it's possible to recover that account by changing to another email because i lose access to that email.

Beforehand, thanks for your time and don't hesitate to contact me if you need further information.

Atte. Frank Geronimo


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

Just a heads up, I removed the user and email details from your post to comply with our privacy policy.

I'm afraid that we cannot change the primary email of an account if the request is coming from an email that is not associated with said account.

If you remember the account's password, you can change its email after logging in by going to your avatar \> **Personal settings** \> Update your avatar, name, email address, and password or delete your account through your **Atlassian account**.

Otherwise, the only way to get access to the account would be by regaining access to its email, so you can request a password reset email via <https://id.atlassian.com/login/resetpassword>

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
copy specific repo content to another repo and update it
Asked by Maxi:

Hello,

Currently I'm working on a project with multiple repository's:

* one blueprint repository with various config directories for different topics and/or devices
* Multiple customer repository's - one for each customer

I would like to copy selected config directories from the blueprint repository to a customer repository - only the ones that are needed and not everything.

The configs in the customer repositories won't be edited or changed. Customer specific data/config will be provided by additional files. Currently I accomplish this task with a python script.

And here is my problem:

When something in the blueprint repository has changed that is also present in the customer repository the customers configs will be not like the blueprint - the datas are not consistent.  

Is there a way or tool to accomplishes the copy task form blueprint repository to a customer repository with selected files and or directories and also checks for changes in the blueprint repo and e.G. pushes the new config in a new branch to the customer repo?


Answers:
author: Christian Glockner
body: Hi Maxi,

It sounds like Git Submodules (see <https://www.atlassian.com/git/tutorials/git-submodule>) might be what you're looking for. It's a way of including other repositories within one repository.

Cheers,

Christian

Premier Support Engineer

Atlassian


Tags: bitbucket-server

server
Can you re-activate my account, please?
Asked by plagelao:

I think my account is not active, do you mind activating it?


Answers:
author: Fabio Racobaldo _Herzum_
body: Hi [@plagelao](/t5/user/viewprofilepage/user-id/4983200) ,

you need to raise a ticket to Atlassian team here <https://support.atlassian.com/contact/#/>

Hope this helps,

Fabio


Tags: bitbucket-cloud

cloud