youngmon/atlassian-qna huggingface dataset:
Removed AWS_ACCESS_KEY_ID yet it still builds
Asked by rraboy:

Hi, I'm trying to figure out why my build uses a different AWS_ACCESS_KEY_ID.

Here are the things I've tried so far

* I've created an AWS user for bitbucket pipeline and set AWS_ACCESS_KEY_ID(whenever I refer to this, it also includes the secret var) in the repo's Repository Variables
* at the beginning of the pipeline, I print what was the identity awscli was using by \`aws sts get-caller-identity\`. I got a completely different identity!
* So I removed AWS_ACCESS_KEY_ID from the Repository Variables. Same thing, still getting the wrong identity.
* I checked the workspace variables, AWS_ACCESS_KEY_ID is not set there.
* I checked my repo for all AWS related variables/script/configurations/passwords/etc but nothing. I don't commit keys in the repo.

So where else could variable AWS_ACCESS_KEY_ID be set? Am I missing something here?

Here is a snippet of my pipeline:

```

pipelines:
default:
- step:
name: Build & Deploy
image: node:14
caches:
- node
script:
- //do build
artifacts:
- dist/**
- step:
name: Deploy to S3
image: amazon/aws-cli
deployment: production
script:
- aws sts get-caller-identity
- ls -ltR dist/
- aws s3 sync ... --acl=public-read
- aws cloudfront create-invalidation ...
```


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

I can see that the step where you use the "aws sts get-caller-identity" command is a deployment step.

It is possible that there is a deployment variable with the name AWS_ACCESS_KEY_ID for the environment 'production', which would explain the behavior you are seeing. If the same name is used for repository, workspace, and deployment variables, the order of overrides is Deployment \> Repository \> Account \> Default variables.

If you navigate to this repo in Bitbucket UI, select **Repository settings** \> then select the option **Deployments** (it is right above the **Repository variables** option) \> expand the environment named 'production', can you see any variable named AWS_ACCESS_KEY_ID for that environment?

Kind regards,  
Theodora


Tags: bitbucket-pipelines
Cannot create Bitbucket Pipeline without SSH key
Asked by Jan Kammerath:

Hi community,  

I was in total shock today as I wanted to enable a pipeline for a new repository. I have 16+ git repos currently in BB and so far everything was absolutely excellent. Today I just wanted to enable pipelines, as I always did, and encountered a weird message:

**[Two-step verification](https://bitbucket.org/account/settings/two-step-verification/manage) is required to enable Pipelines**

This is weird, because I have 2FA through SSO with Microsoft AAD already and my other repos did not throw any error message like this. In essence the error means that I can no longer use push/pull through HTTPS together with pipelines and are forced to use SSH. This is a huge no-go for me and would cost me days and weeks to implement in my current setup.

Also this change came with no prior warning shots and the documentation's guidelines on how to disable Atlassians 2-step thingy doesn't work at all.

It ruined my day completely and any help is highly appreciated!

Many thanks in advance, Jan


Answers:
author: Theodora Boudale
body: Hi Jan,

We recently started testing two-step verification on Bitbucket users enabling Pipelines in new workspaces as part of our ongoing efforts to prevent abuse of the service by cryptocurrency miners. We're testing these measures ahead of a large-scale release in the coming weeks.

Unfortunately, we ran into some unexpected bugs, which we suspect may have caused the issues you experienced. So, for now, we've rolled back the verification requirement.

We apologize for the confusion and the impact on your business.

Kind regards,  
Theodora


author: Jan Kammerath
body: I finally found a workaround after wasting 3 hours of my Sunday afternoon which should've been 15 minutes.

The workaround is to create an SSH key pair in Sourcetree, insert it into Bitbucket, activate the two-step verification. This process worked although two-step verification is disabled in my Atlassian account.

After the SSH keys were present and two-step verification activated in Bitbucket, I was able to create the pipelines and still use HTTPS for push.

I don't think this is expected behaviour and keep my fingers crossed that my accounts will survive this without any issues.

comments: author: Bitwise DEVS
body: Actually you can still use HTTPS with 2FA and SSH enable altogether by using App Password, thus your HTTPS will be in this format

    https://<username>:<password>@bitbucket.org/<username>/<repo>.git


Tags: bitbucket-pipelines

cloud
Is it safe to include bitbucket-pipelines.yml on project level when compiling APK for release?
Asked by Bitwise DEVS:

This is the sample project

![Screenshot 2021-06-20 040747.png](https://community.atlassian.com/t5/image/serverpage/image-id/148169i31A645CDAC09F66E/image-size/large?v=v2&px=999 "Screenshot 2021-06-20 040747.png")


Answers:
author: Mark C
body: Hi [@Bitwise DEVS](/t5/user/viewprofilepage/user-id/3162676)  

Thanks for reaching out to the community.  

It should be safe to include your YAML file while compiling your project as long as you're not using any sensitive information in your YAML file (e.g. passwords, usernames, host/IP addresses etc.).  

In case you have that sensitive information in your YAML file, make sure you're using [Bitbucket Cloud environment variables as secured](https://support.atlassian.com/bitbucket-cloud/docs/variables-and-secrets/) to hide them.  

Hope it helps and let me know if you have further questions.

Regards,  
Mark C

comments: author: Bitwise DEVS
body: Yes, currently using environment variable for such cases. Thanks


Tags: android

bitbucket-cloud

bitbucket-pipelines

cloud

development

gradle
Git push fails with error: Cannot lock ref 'HEAD': Unable to create xxxx/HEAD.lock: File Exists
Asked by Abhinav Bezgam:

Hi All, I am seeing below error when trying to push to master:

$ git push

Total 0 (delta 0), reused 0 (delta 0)

remote: **error**: cannot lock ref 'HEAD': Unable to create '/nfs/bitbucket/data/repositories/xxxx/./HEAD.lock': File exists.

remote:

remote: Another git process seems to be running in this repository, e.g.

remote: an editor opened by 'git commit'. Please make sure all processes

remote: are terminated then try again. If it still fails, a git process

remote: may have crashed in this repository earlier:

remote: remove the file manually to continue.

I don't see any .git/HEAD.lock or .git/index.lock files in my repository

Any suggestions on what I can do to resolve this?


Answers:
author: Caroline R
body: Hi, [@Abhinav Bezgam](/t5/user/viewprofilepage/user-id/4444019)! Welcome to the community!

I saw you created a ticket with our support related to the same question, so to avoid any possible misunderstandings or miscommunication that may arise from discussing the same matter on two different platforms, let's focus on the ticket instead.

Feel free to share the resolution here to help other community members that may have the same issue.

Kind regards,  
Caroline

comments: author: jarkko_lietolahti
body: Hi,

We're seeing this same issue. Under what support ticket is the discussion progressing?


author: Theodora Boudale
body: Hi [@jarkko_lietolahti](/t5/user/viewprofilepage/user-id/4530073) and welcome to the community.

A support ticket is visible only to the user that created it and Atlassian staff, it's not publicly visible.

There hasn't been any progress in the support ticket as the reporter hasn't engaged in the discussion.

My suggestion would be that you create a separate question for your issue, providing details on the errors you see and also whether it concerns a Bitbucket Cloud or Bitbucket Server repo. We generally encourage users to create a new question for their issue instead of posting on someone else's question, because 1) the root cause and resolution may be different for each case 2) a question can become cluttered and difficult to follow if we try to troubleshoot multiple users' issues in it.

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

Kind regards,  
Theodora


author: N-Y Corp
body: Hello I have the same issue


author: Theodora Boudale
body: Hi [@N-Y Corp](/t5/user/viewprofilepage/user-id/4537013) ,

I would like to ask if you could please create a new question for your issue, providing details on the errors you see and also whether it concerns a Bitbucket Cloud or Bitbucket Server repo.

We generally encourage users to create a new question for their issue instead of posting on someone else's question that they have the same issue, because 1) the root cause and resolution may be different for each case 2) a question can become cluttered and difficult to follow if we try to troubleshoot multiple users' issues in it.

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

Kind regards,  
Theodora


Tags: bitbucket-server
Export of issues doesn't work
Asked by DocMoebiuz:

I am trying to export my issues using Settings \> Import \& Export feature.

The modal dialog shows up and it says "Issue Export - preparing for export..." but nothing else happens.


Answers:
author: Juan Manuel Ibarra
body: Hello, how many issues are you trying to export? It may happen that when faced with a very large number of issues, the process takes a long time and even fails due to timeout.

comments: author: DocMoebiuz
body: It turned out that i received an email notification after some time that the export had finished and ready to download.

The lack of UI feedback was confusing.

The generated zip file was reported corrupt but 7z was still able to extract the content.

It were 367 issues.


Tags: bitbucket-cloud

cloud
How to configure a submodule to point to a specific tag/commit
Asked by Dimitri Tcherukine:

Hi,

Let's say we have two repositories Main and Common, Common has been added as a submodule of Main. Commits of Common get tagged on master when Common is in a state it can be used by Main. Common might be developed ahead of Master such that when Main integrates Common, it is not interested in the head of Common on master but in an older commit that has been tagged.

I'm new to git and used to Allchange or PTC integrity version controls solutions where I'm used to this functionality.

How would you go about doing this in git/bitbucket? I can't find a simple command to do this and a work around I am considering is creating a branch of Common instead of a tag and point Main to that branch.

Note that I'm using Bitbucket v5.11.1

Regards,

Dimitri


Answers:
author: Ulrich Kuhnhardt _IzymesCo_
body: If it is an option I suggest to create a versioned library or some sort of versioned artefact out of common that is consumed by Main. Main can choose which version of Common it needs. This way Main and Common can be maintained independently.


Tags: bitbucket-server

server
How to get a list of files in a given repo with the rest api?
Asked by JA:

Hi, I have a project with 20 repos. I would like to get a list of file names for each repo (in the main branch -some are called 'master', some 'main'-).

How do I go about doing this?

I saw [this answer](https://community.atlassian.com/t5/Bitbucket-questions/Get-file-list-of-a-branch-using-Bittbucket-API/qaq-p/817341#M59133) in another question, but it didn't really work for me. This is specifically what I tried (to get all the files in one repo's master branch):

/rest/api/1.0/projects/{projectName}/repos/{repoName}/master/files?limit=1000

Where am I going wrong? Ideally I would like to get all files under all repos inside a given project in one call, but if that's not possible I can settle for making an API call per repo to get each of their list of files. I don't need the content, just the file names.

Thanks!


Answers:
author: JA
body: Alright, in the end I just devised a way to do it via JS from the browser (couldn't find any way to do this directly with the Bitbucket API):

```
//The way to run this script is through DevTools (Ctrl+Shift+i) > Sources > '>>' > Snippets > New snippet > copy paste the script there 
//> run it (while in https://<your-bitbucket-domain>/projects/<your-project-name>

//STEP 1: extracts the urls of all repos under <your-project-name>
let array = document.getElementsByClassName("repository-name");
let links = Array.from(array).map(x=>x.outerHTML.match(/<a[^>]+href=\"(.*?)\"[^>]*>(.*)?<\/a>/)[1]);
// console.log(links); // (25)?["/projects/<your-proj>/repos/<repo-name>/browse"...]

let repoNames = links.map(x=>x.split("/").slice(-2,-1)).flat(); //["repoA", "repoB", "repoC", ...]
console.log( repoNames)
links.forEach((x,idx)=>fetchEachRepo("https://<your-bitbucket-domain>"+x,repoNames[idx]));

//STEP 2: fetches the html of a given url and extracts repo file names 
function fetchEachRepo(url,repoName){
let parser = new DOMParser();
let htmlDoc;
let res;
fetch(url)
.then(response => response.text())
.then(data=>{
htmlDoc = parser.parseFromString(data, 'text/html');
res=Array.from(htmlDoc.getElementsByClassName("file file-row")).map(x=>x.dataset.itemName);
res.unshift(repoName);
console.log(res);
})
.catch((err)=>console.log(err));
}


//NOTES
// $('') is an alias for document.querySelector
// $$('') is an alias for document.querySelectorAll
```

The end result looks like:

\['repoA', 'readme.md', 'contributing.md'...\]

\['repoB', '.gitignore', ...\]

...

Hope it helps


Tags: bitbucket-server

rest-api

server
schedule pipeline in from monday to saturday on daily
Asked by Hardik Patel:

Hello Team,

I want to schedule pipeline that run on monday to saturday on daily bases.

Is it possible to schedule in cron manner?

Thx.


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

It is possible to trigger a pipeline using our API:

* <https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D/pipelines/>

You can create a script that triggers the pipeline you want via API, and then set up a cron job to run it the days and times you want.

It is also possible to create schedules via Bitbucket UI:

* <https://confluence.atlassian.com/bitbucket/scheduled-builds-for-pipelines-933078702.html>

At the moment it is not possible to select certain days of the week only. We have a feature request about this in our issue tracker:

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

The 'Daily' option we provide would run it from Monday to Sunday. You could potentially create 6 'Weekly' schedules (one for each day from Monday to Saturday) if you'd like to make use of that feature.

Otherwise, you can a script using our API and a cron job will also work.

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

Kind regards,  
Theodora


Tags: bitbucket-pipelines
Firebase Test Lab using gcloud CLI on pipelines
Asked by Bitwise DEVS:

Good day first time here, I am enjoying working with Bitbucket Pipeline as it is simple and easy to understand with good and clear documentation. However I need to deploy/upload the apk from a step artifact using `gcloud` command and I can't see any related article or topic on this yet.

This is the Firebase Test Lab documentation using gcloud CLI.  
<https://firebase.google.com/docs/test-lab/android/command-line>

So far I just received a message from Twitter that I should refer to this

<https://support.atlassian.com/bitbucket-cloud/docs/deploy-to-google-cloud/>

But as far as I can tell this documentation is about deploying an app to Google App Engine which is not in my case.

How about this?

<https://cloud.google.com/sdk/docs/scripting-gcloud>


Answers:
author: Bitwise DEVS
body: Already manage to do it, based on this awesome [gist](https://gist.github.com/adilsoncarvalho/e0e8da81dbf52bf90c671887ef7e04d3).


Tags: bitbucket-cloud

bitbucket-pipelines

cloud

firebase
repository with git lfs, and pipeline attempting to push a tag
Asked by Jason Harrison:

We have a bitbucket repository with a custom pipeline to tag the repo with the current version. I have had to add steps to install git-lfs. Why is git-lfs not already installed in the pipeline image (python 3.6.9) and is there a better way to perform this installation?

```
custom: # Pipelines that can only be triggered manually 
  deployment-to-prod:
   - step: 
       name: Tag git 
       script: 
         - curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash 
         - apt-get -y install git-lfs zip 
         - package_version=$(cat VERSION)
         - git_tag="v$package_version"echo "Git tag=$git_tag"
         - git tag --force --annotate --message "$git_tag from ${BITBUCKET_BUILD_NUMBER}" $git_tag
         - git push --tags --force
```


Answers:
author: Theodora Boudale
body: Hi Jason,

Bitbucket Pipelines supports any public and private Docker images hosted on Docker Hub, AWS, GCP, Azure, and self-hosted registries accessible on the internet. Atlassian has built a Docker image that can be used for Pipelines builds if it suits your needs (<https://hub.docker.com/r/atlassian/default-image/>), however, we don't own every Docker image hosted in each of the above registries, like e.g. the python one. The owner of each Docker image decides what tools/applications are pre-installed in that image.

Checking the documentation on the Git LFS repo, the instructions for installing Git LFS in Debian and Ubuntu seem to be the ones you are using in your yml file as well:

* <https://github.com/git-lfs/git-lfs/wiki/Installation>

One thing you can do is look if there is a publicly available Docker image that has all the tools you need pre-installed. If you cannot find one, you can also create your own custom Docker image that has all the tools you need for your build (including Git LFS) and use that instead. If you'd be interested in that, you can check the links we have in our documentation:

* <https://support.atlassian.com/bitbucket-cloud/docs/use-docker-images-as-build-environments/#Creating-a-custom-build-environment>

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

Kind regards,  
Theodora

comments: author: Jason Harrison
body: Thank you. I have copied the script into my repository to avoid foreign script execution attacks.

I will consider building a docker image. The trade offs between downloading a custom docker image vs download and installing a smaller set of code are worth exploring.


author: Theodora Boudale
body: You are welcome, Jason. Please feel free to reach out if you ever need anything else!

Kind regards,  
Theodora


Tags: bitbucket-cloud

bitbucket-pipelines

cloud
import word document without office connector
Asked by wangshuo:

I have a confluence version 6.10.0. In order to solve the CVE-2019-3396 vulnerability, I disabled the Widget Connector macro, and automatically disabled the office connector. Is there a way to use other plug-ins to import word documents? Or is it a security risk to enable the office connector alone?


Answers:
author: Fabio Racobaldo _Herzum_
body: Hi [@wangshuo](/t5/user/viewprofilepage/user-id/5202501) and welcome,

unfortunately Office Connector is the module for word import. My suggestion is to upgrade to 6.10.3 version that fixs vulvenrability (<https://jira.atlassian.com/browse/CONFSERVER-57974>)

Fabio


Tags: confluence-server

server
My email ID or username not listed at all for my team members to add me. How hould I get access to??
Asked by Meenupriya Periakaruppan:

1. My email address (Enterprise ID) or user name is not at all listed in Innersource - BitBucket portal.
2. Then how will my project members add me in ?
3. How can I access the repo?
4. I even don't have privileges to create a new project so that I can atleast add my members.
5. Can you provide a solution for this so that I can access the repo ??


Answers:
author: Dave Liao
body: [@Meenupriya Periakaruppan](/t5/user/viewprofilepage/user-id/4439254) - your Bitbucket admin will need to assign you a Bitbucket license. You might need to be part of a group that is allowed access to your Bitbucket app.

Once this is done, you'll be "seen" within Bitbucket and able to be added to Bitbucket projects.

comments: author: Meenupriya Periakaruppan
body: **[@Dave Liao](/t5/user/viewprofilepage/user-id/523242) Thanks for reply. How should I find Bitbucket admin? My organisation redirected me to seek atlassian support. Who is the bitbucket admin at Atlassian Site??**


author: Dave Liao
body: [@Meenupriya Periakaruppan](/t5/user/viewprofilepage/user-id/4439254) - I see your reported this issue as a Bitbucket Server issue, so you would have to check with your Innersource Bitbucket contacts. What's the URL of your Bitbucket?


author: Meenupriya Periakaruppan
body: <https://innersource.accenture.com/dashboard>


author: Meenupriya Periakaruppan
body: [@Dave Liao](/t5/user/viewprofilepage/user-id/523242) Who are the Innersource Bitbucket contact? How should I reach out to them?? I have provided the link as well. Please check that too


author: Dave Liao
body: [@Meenupriya Periakaruppan](/t5/user/viewprofilepage/user-id/4439254) - hi Meenupriya! You'll need to contact your Accenture point of contact, as they maintain that stack. Unfortunately I don't know who that is. ?


Tags: bitbucket-server

server
Verified email, then this
Asked by David O'Hara:

Clearly this is not correct. My homepage doesn't seem to have set up properly.

![IMG_5774.jpeg](/t5/image/serverpage/image-id/253365iBEDEE7961A81F973/image-size/large?v=v2&px=999 "IMG_5774.jpeg")

please help,

Dave O'Hara


Answers:
author: Nic Brough -Adaptavist-
body: This is an odd one - it's not a Confluence problem, it's something in your network or browser.

As Brant says, try another browser, but if the same occurs, you're going to need to start doing network tracing - try "nslookup" on the server address, and then "trace route" tools to see if your browser can actually reach the server.

comments: author: David O'Hara
body: ![IMG_5794.jpeg](https://community.atlassian.com/t5/image/serverpage/image-id/253631iA94264E992C47BE0/image-size/large?v=v2&px=999 "IMG_5794.jpeg")Tried it on Chrome on iPhone. This is the error this time.

Dave


author: Nic Brough -Adaptavist-
body: "error name not resolved" means that your network is unable to look up or connect to the IP address the URL is for.

Either your network is not resolving it, or the URL does not exist.


author: David O'Hara
body: Thanks for your reply Nic.

My network has no trouble resolving web addresses. The url has been served to me and will not resolve, which echoes my original assertion that it is malformed in some way.

I've tried it with two different browsers as requested. It just doesn't work, therefore I could not really rely on the program for my needs.

Dave


author: Brant Schroeder
body: [@David O_Hara](/t5/user/viewprofilepage/user-id/5202364) Welcome to the Atlassian community

Try logging out clearing your cache and seeing if you can access the Confluence space after you log back in.

comments: author: David O'Hara
body: Hi Brant, thanks for the reply.

I've tried what you suggested and this time it forces me to login again, which works, but then I get the same error message once the system accepts my login criteria.

Dave


author: Brant Schroeder
body: [@David O_Hara](/t5/user/viewprofilepage/user-id/5202364) what if you use a different browser?


Tags: server
How to add Bangladeshi payment gateway named bkash to my confluence page?
Asked by Md. Rajib Hasan:

**Dear Concerned,**

I have my site named "<https://letstplaywithjira.atlassian.net/>"

I would like to add a payment gateway of Bangladesh named as bkash.

bkash site: <https://www.bkash.com/en/business>

How can I add it to any one of my confluence page.

Thank you in advance.


Answers:
author: Nic Brough -Adaptavist-
body: That does not explain what you are trying to do.


author: Angela Deleon
body: Try to use that payment gateway API.


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

What do you mean by "add a site to a confluence page"? Could you explain what you are hoping to see?


Tags: cloud

confluence-cloud