youngmon/atlassian-qna huggingface dataset:
bash: jq:command not found
Asked by nazia_akhtar:

I am working on bitbucket pipelines using javascript/nodejs as the language.

I need 'jq' command in my script but it throws error of jq: command not found

Below is my bitbucket pipelines.yml file

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


Answers:
author: Oleksandr Kyrdan
body: Hi [@nazia_akhtar](/t5/user/viewprofilepage/user-id/4059964) ,

Thank you for your question!

You can add it with the next command before using jq:

```
apt-get install -y jq
```


author: samarth adhikari
body: ![jq error.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/167877i1C783D93734E566D/image-size/large?v=v2&px=999 "jq error.PNG")

Hi this is part of a script I am running to attach an image to a page. However, I am getting these errors:

line 10: jq: command not found

line 12: \[: =: unary operator expected

Line 10 is ATTACHMENT_TITLE=$(curl -u $USER_NAME:$USER_PASSWORD \\ -X POST \\ -H "X-Atlassian-Token: nocheck" -F "file=@${ATTACHMENT_FILE_NAME}" -F "comment=File attached via REST API" \\ ${CONFLUENCE_BASE_URL}/rest/api/content/${PAGE_ID}/child/attachment 2\>/dev/null \\ \| jq -r '.results\[\].title')

Line 12 is if \[ ${ATTACHMENT_TITLE} = ${ATTACHMENT_FILE_NAME} \]; then

Am not sure what is causing this error as I got this script from an atlassian page. Please let me know how I can fix and run this?


author: Luca Bottoni
body: ```
image: node:10.15.3
pipelines:
  default:
    - step:
        name: "prova default"
        script:
          - echo "Deploying version is $VERSIONRELEASE"
          - ls
          - mkdir build
          - touch build/test.json
          - ls build
          - apt-get install -y jq
          - declare -x VERSION=$(jq -r '.version' package.json)
          - echo "package.json version is $VERSION"
```

<br />

<br />

+ apt-get install -y jq  
Reading package lists...  
Building dependency tree...  
Reading state information...  
E: Unable to locate package jq

sorry, but does not work

comments: author: koanplaned
body: Hi Luca,

I had the same issue.

Before you can install jq, you have to make an "apt-get update"

Example:

```
- apt-get update 
- apt-get -y install jq
```


author: Shailesh Gupta
body: ```
 apt-get update  this part is required
```


Tags: atl-gruland

bitbucket-cloud

bitbucket-pipelines

cloud
Firebase pipeline authentication error
Asked by Reza B:

Hi community

I am trying to auto-deploy my Vue.js app to Fireabse hosting, so I created a pipeline for that in my Bitbucket repo, with the following content, but the issue is right after building the app and deploying it to Firebase I get this error:

? Error: HTTP Error: 401, Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See <https://developers.google.com/identity/sign-in/web/devconsole-project>.

I am sure my access token is valid, as I generated it with login:ci .

Why am I getting an authentication error?

bitbucket-pipelines.yml {#toc-hId--1324970310}
----------------------------------------------

image: node  
pipelines: default:

- step: name: Test

script: - npm install \&\& npm test

- step:

name: Build

script: - npm install \&\& npm run build

artifacts: - build/\*\*

- step:

name: Deploy to Firebase deployment: production

script: -

pipe: atlassian/firebase-deploy:0.2.1

variables:

FIREBASE_TOKEN: $1XXXXXXXXXXXX

PROJECT_ID: $XXXXXXXXXXXXX


Answers:
author: tomcatbuzz
body: I recently had the same problem. Many others solved this by doing firebase logout and firebase login to refresh their credentials in the cli. I actually had to run firebase login:ci which regenerates a new TOKEN you can use in your project Bitbucket repo under Repository Settings \> Repository Variables. I deleted my old token and just Created a new one with the new token and it worked again. Hope this helps if you haven't solved it yet.

comments: author: Venkatesh Bachu
body: Thanks alot for the answer. I saw this happen again to me today. Indeed regenerating a new TOKEN using $firebase login:ci helped.

Seems like the TOKEN gets expired after a few days (inactivity) maybe ?

Is there a way someone figured out, how to avoid this happening again ?


author: tomcatbuzz
body: As far as I know the token should not expire. I recently sent a push using the pipeline and everything seemed to be working still. I also keep my global firebase-tools updated on my pc, but that should only effect my working environment. There is a possibility of some updates occurring, like sometimes Bitbucket updates their templates we use to deploy to firebase hosting, etc. In 1 project I have the pipe for atlassian/firebase-deploy:0.3.4 and a newer project it is 1.2.0. But I doubt that has any effect on the TOKEN giving in the cli, that basically grants access to run the deploy. I googled for answers and still did found WHY that happens yet.


Tags: atl-gruland
Bitbucket Pipeline for nginx on Ubuntu
Asked by mayursaner:

I have my angular and nodejs app hosted on Azure VM (Linux (ubuntu 18.04)) using nginx and pm2 respectively. Now I want to create pipeline by which i can deploy my code to the nginx root folder.  
Same for nodejs. I have node hosted using pm2. Is there any reference links or any solution over this ?  
I searched a lot but couldn't find any proper solution.It will be helpful if you provide the steps.


Answers:
author: mayursaner
body: I got the answer from bitbucket cloud support,

Actually, the App ID required there for "azure-vm-linux-script-deploy:1.0.1" pipe, is of the service principal. Its not to a Web App. So I referred to this documentation on how to create a service principal. - <https://support.atlassian.com/bitbucket-cloud/docs/deploy-to-microsoft-azure/>

Hope this can be helpful to anyone in future!


Tags: angular

bitbucket-server

nginx

node.js

server
is the mercurial repo data still available?
Asked by Dima Pasechnik:

I see slugs of my mercurial bitbucket repos still available. I just realized that I still need data from one of them.

Is it possible to get it?


Answers:
author: Theodora Boudale
body: Hi everyone,

Atlassian made a decision to move away from maintaining and supporting Mercurial repositories in 2019.

This was announced in community:

* <https://community.atlassian.com/t5/Bitbucket-articles/What-to-do-with-your-Mercurial-repos-when-Bitbucket-sunsets/ba-p/1155380>

and on our blog:

* <https://bitbucket.org/blog/sunsetting-mercurial-support-in-bitbucket>

Bitbucket Cloud Support team is no longer able to restore those repositories.

If you are looking for a Mercurial repository that was public, all the public repos were archived by Software Heritage:

* <https://bitbucket-archive.softwareheritage.org/>

We will not be able to meet any further requests for recovery of private HG repositories and users will need to recover those from local copies only.

Kind regards,  
Theodora


author: Ana Retamal
body: Hi [@Dima Pasechnik](/t5/user/viewprofilepage/user-id/4059223), welcome to the Community!

Mercurial repositories became read-only as of July 1st. As a read-only repo, you should still be able to clone it..

You can find some tips on what to do with your Mercurial repos in our article [Sunsetting Mercurial support in Bitbucket](https://bitbucket.org/blog/sunsetting-mercurial-support-in-bitbucket). If you browse this Community, you'll also be able to find other threads where people shared their experiences and tips for the migration.

Hope that helps! If you have any other questions, please let us know and we'll be happy to continue helping you.

Regards,  
Ana

comments: author: dimpase
body: hg clone does not work though on this url though, how am I supposed to clone it?

It is a public repo, you know.


author: dimpase
body: ```
hg clone https://bitbucket.org/dimpase/qcode
http authorization required for https://bitbucket.org/dimpase/qcode
realm: Bitbucket.org HTTP
```

It is a public repo, but still... Can you open it up? Neither my current Atlassian password with the username dimpase

nor my ssh keys work


author: dimpase
body: specifically, with ssh I have

```
$ hg clone ssh://hg@bitbucket.org/dimpase/qcode
remote: Repository is in read only mode.
abort: no suitable response from remote hg!
```


Tags: bitbucket-cloud

cloud
Had no computer access for a year. How do I access my mercurial repositories and migrate them?
Asked by sprgn:

I need to get my mercurial repositories downloaded and converted to git. How do I still do that?


Answers:
author: Ana Retamal
body: Hi [@sprgn](/t5/user/viewprofilepage/user-id/4058694), welcome to the Community!

Since July 1st, all Mercurial repositories are in read-only mode. As a read-only repo, you should still be able to clone it and convert it to Git.

You can find some tips on how to migrate and export in our article [Sunsetting Mercurial support in Bitbucket](https://bitbucket.org/blog/sunsetting-mercurial-support-in-bitbucket). If you browse this Community, you'll also be able to find other threads where people shared their experiences and tips for the migration.

Hope that helps you! If you have any questions, let us know and we'll be happy to continue helping you.

Best regards,  
Ana


Tags: bitbucket-cloud

cloud

mercurial
How to apply simple approval workflow within small team?
Asked by Mark:

We have a BitBucket server in a small team. There are several repositories and seldom update. In order to meet company compliance, all the code changes required a "maker/checker" review. That means every change by developer A, require developer B to review and sign (approval). Developer B's change can be approved by any one in the team, depends on who is on duty.

Because our changes tend to be very simple, I would like to avoid using "branch". We would like to keep only one main stream.

Without using branch, is there any OOTB way to apply approval workflow?


Answers:
author: Ana Retamal
body: Hi [@Mark](/t5/user/viewprofilepage/user-id/4058812), welcome to the Community!

My understanding is that you'd like to have your developers working directly on master, and have someone else review their changes before they're actually pushed to master. It looks like you're describing the behavior of pull requests and merge checks, with the caveat that branches are required for that kind of workflow. In that scenario, your developer would make his change in a separate branch and whenever he's ready to merge his changes he'd make a pull request, then the changes would wait to be reviewed by another colleague, and only when approved the changes will appear in master.

'Merge checks' is a feature provided by Bitbucket and that allows for a set of conditions to be required before the changes are merged with the main branch. One of the merge checks included with Bitbucket is 'minimum approvers', which requires at least the specified number of approvals before the changes can be merged. You can learn more about this feature at [Checks for merging pull requests.](https://confluence.atlassian.com/bitbucketserver/checks-for-merging-pull-requests-776640039.html)

There are different ways of working with branches and it doesn't have to be complicated. You can find some useful examples like the [Gitflow workflow](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow)or [Feature-branch workflow](https://www.atlassian.com/git/tutorials/comparing-workflows/feature-branch-workflow), but you can also work together with your team and come up with the workflow that would work better for you.

I hope that helps you, Mark. If you have any questions regarding this feature, let us know and we'll be happy to help you.

Best regards,

Ana

comments: author: Mark
body: test


author: Mark
body: Hi Ana,

Thanks for answer. I have configure Minimum approvals = 1 in project settings and the repository settings have inheritance enabled.

However I have tried merge several branches. All of them can be merged without any restriction. No approval request is triggered. Am I missed something?

I am too green to BitBucket. Could you suggest me a simple scenario to trigger a simple approval workflow/request?


Tags: approver

bitbucket-server

server

workflow
Convert existing bitbucket repo to fork
Asked by kevinmoll14:

I have two repositories hosted on bitbucket server where one of them should have been created as a fork of the other, rather than an independent repository (i.e., they share common branches/commits as can be seen in git when the working directory contains the two corresponding remotes). Unfortunately, when I push changes to the "downstream" repository, I can't create pull requests into the "upstream" repository because it wasn't created as a fork (the upstream repo doesn't appear in the drop down box of destination repositories). Is it possible to assign the "downstream" as a fork of the "upstream" after it's been created? I know I can erase the "downstream" and create a new one as a fork (repopulating the git data by cloning the original downstream before erasing it), but my understanding is that would lose all the existing bitbucket meta data like pull requests.

Thanks.


Answers:
author: Mikael Sandberg
body: The short answer is no, you cannot convert a repository to be a fork instead.

And your understanding is correct, if you remove the repository you will loose any Bitbucket data associated with it.

comments: author: kevinmoll14
body: Thanks Mikael for confirming my suspicions.


Tags: bitbucket-server

server
Will Bitbucket Cloud add a feature to remove people from the Recent list on a pull request?
Asked by catapult-sam:

When I create a pull request, there is a list of Recent Reviewers (which is a great feature).

However there are people who have left the team who still show up on the recent list for every new pull request and I don't want to them to.

It seems it is not currently possible to remove names from this list.

Is there any plan to add this feature and if so, when?


Answers:
author: catapult-sam
body: (deleted)


author: seanaty
body: Are they public repositories by any chance? If so they'd technically still have access. If they're private repositories than this sounds like a bug.

comments: author: catapult-sam
body: Private repositories, to which they still have access, we just don't want them in the list because they've moved to another team.


Tags: bitbucket-cloud

cloud
Can I change user name ?
Asked by Glory Mercy:

Just want to know if I can change the user name on BitBucket. If so, does it effect the repositories already committed in the project?


Answers:
author: Tyler T
body: Yes, you can change your username here: <https://bitbucket.org/account/settings/username/change/>
> Changing your Bitbucket username changes the credential you use for basic authentication, including cloning a repository over HTTPS.

Changing your username does not affect repository URLs (if that is your concern).

comments: author: Pamfile Alex
body: How can I change the repository URL?


author: Tyler T
body: Change the workspace ID/slug. Go to the workspaces settings and change the slug to update the repository URL.

The URL will look like this:

```
https://bitbucket.org/<workspace-id>/workspace/settings/change-id
```


Tags: bitbucket-cloud

cloud
onprem bitbucket integrate with AWS Codepipeline
Asked by ?????:

Hi,

I'm trying to get AWS Codepipeline to pull from our onprem instance of Bitbucket server. It's not working. Steps to reproduce:

1. Created a repo in the onprem Bitbucket project

2. In AWS Developer Tools created a new Connection to the Bitbucket project using my credential.

3. Created a new AWS CodePipeline

4. In configuring the Source Stage, I specify Action Provider Bitbucket and select the Connection created above.

5. In the Respository Name field, the repo should populate. But this is where it fails.

Even if I manually type in the name of the project and repo, it fails to find the branch, in the next step.

I have this working with my own personal Bitbucket (Cloud) account. I made no special changes to the clean Bitbucket repo that I created just for testing this.

Thanks


Answers:
author: Steffen Opel _Utoolity_
body: Hi [@?????](/t5/user/viewprofilepage/user-id/4058115),

Welcome to the Atlassian Community!
> 2. In AWS Developer Tools created a new Connection to the Bitbucket project using my credential.

This type pf connection is based on [AWS CodeStar Connections](https://docs.aws.amazon.com/dtconsole/latest/userguide/welcome-connections.html), which is indeed a feature to *"connect AWS resources such as AWS CodePipeline to external code repositories"*.

However, so far this feature [only supports **Bitbucket Cloud**](https://docs.aws.amazon.com/dtconsole/latest/userguide/connections.html) (unfortunately the AWS docs are not exactly clear about that), and GitHub Enterprise - the AWS integration with GitHub Cloud predates this dedicated SPI though).

While I would expect AWS to also add CodeStar Connections support for Bitbucket Server down the road, you can already achieve this today via their custom webhooks based solution:

* Blog: [Integrating CodePipeline with on-premises **Bitbucket Server**](https://aws.amazon.com/blogs/devops/integrating-codepipeline-with-on-premises-bitbucket-server/)
* Source: [aws-codepipeline-bitbucket-integration](https://github.com/aws-samples/aws-codepipeline-bitbucket-integration)


Tags: aws

aws-code

bitbucket-server

server
Unable to Clone using Tortoise Hg
Asked by ashharali:

I was trying to close my repository in my local PC using Tortoise Hg, But every time an error occurs that **SSL error: sslv3 alert handshake failure.** The screenshot has been also attached to my question please review and help me, please.![bitbucket.PNG](/t5/image/serverpage/image-id/107325i523368324EA5FB12/image-size/large?v=v2&px=999 "bitbucket.PNG")


Answers:
author: Mikael Sandberg
body: Hi [@ashharali](/t5/user/viewprofilepage/user-id/4057643),

Welcome to Atlassian Community!

What URL are you posting as the source in TortoiseHg? You should only include the URL, not the git clone part that you see in Bitbucket.
Test retrieve user : Failed
Asked by Babar Munir:

i am using v7.5, and when i test Active directory connection, it shows error:

Test basic connection : Succeeded

Test retrieve user : Failed User \<test@test.com\> does not exist

c.a.c.d.s.c.UsnChangedCacheRefresher Found \[ 372 \] user GUIDs in cache, \[ 372 \] user GUIDs in remote directory  
\[Caesium-1-2\] c.a.c.d.s.c.UsnChangedCacheRefresher scanned and compared \[ 0 \] users to delete, \[ 0 \] users to add, \[ 0 \] users to update in DB cache in \[ 94ms \]


Answers:
author: Nic Brough -Adaptavist-
body: I'd want to try testing with a user in your AD that exists.

comments: author: Babar Munir
body: user does exist in AD and how can you test ?

apologize i am newbie to bitbucket


author: Nic Brough -Adaptavist-
body: There are two things this could be.

First, your connection from Bitbucket to AD is configured with some sort of filter which limits the accounts to a subset of people in the directory (for example in a multinational company with 100,000 people, you might want to do something like "only show us people in the UK organisation"). If you are using a filter like that, then it may be excluding the user you are testing with.

The default setting for the filter is blank, which means "return everyone in AD".

Second, the user really does not exist. Do you really have a test user with that name? Are you using email addresses as user ids in AD?


author: Babar Munir
body: Thanks we are a small company around 300 plus users and the specific user exists in AD and even i can see all the AD users in "User" section:

we are using \<username\>@domain as a user id not an email id.

my filters are as set by default:

user object filter = (\&(objectCategory=Person)(sAMAccountName=\*))

user name attribute: sAMAccountName


author: Nic Brough -Adaptavist-
body: How are you doing the user test in bitbucket?


Tags: bitbucket-server

server
I bitbucket the right tool for a project requirement documentation?
Asked by Shivangi Gupta:

I'm working to understand if Bitbucket will be the correct tool for documenting a customer journey from a Business analyst or Product Owner Perspective?

Can I upload and work on Word/Excel documents collaboratively?

Is it Product Manager friendly?


Answers:
author: Ste Wright
body: Hi [@Shivangi Gupta](/t5/user/viewprofilepage/user-id/4048290)

[Bitbucket](https://www.atlassian.com/software/bitbucket) is a Git code management tool - in Cloud, it's also a tool for collaboration on code, testing and deploying (i.e CI/CD). It's designed as a development tool rather than mapping out the customer journey.

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

If you're looking to track delivery of products - such as issue \& project tracking, release planning, agile boards - you're best to look at [Jira](https://www.atlassian.com/software/jira).

Or if you're looking for collaborative knowledge management, documentation with more detail - you're best to look at [Confluence](https://www.atlassian.com/software/confluence).

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

I'd check those two out as more closely aligned to your need above :)

Ste

comments: author: Shivangi Gupta
body: Stephen, many thanks for your answer! Just needed to ratify my understanding of bitbucket.

I've been trying my hands on Confluence as well :)


author: Ste Wright
body: Hi [@Shivangi Gupta](/t5/user/viewprofilepage/user-id/4048290)

You're welcome :) - let us know if you need any further information!

Ste


Tags: bitbucket-cloud

cloud
Blog Template
Asked by Yuval Konstantini:

Hello community, I have a use case I would like to ask you a question about + hear your thoughts.

We need to document data each day (like a summery of events we manually write). We were thinking about creating a blog for each day. We encountered this issue: we must use a specific template for a blog post to document our summary.

1. Is there a way to create template for a blog?

2. Can you think of a better solution for our use case? I would like to hear if there are, as I'm new to the product.

Thank you very much, and happy holidays!


Answers:
author: Andy Gladstone
body: [@Yuval Konstantini](/t5/user/viewprofilepage/user-id/5099814) Welcome to the Atlassian Community.

Blog posts cannot be templated in Confluence Cloud (or Server and Data Center for that matter, but there are Marketplace Apps for those platforms that create the functionality).

There are over 130 templates for **pages** available in Confluence Cloud. Does your use case noty fit any of them? If not, you can design your own **page** template that can be used to create a uniform daily log for you to publish the information you need to capture.

I would also recommend weekly/monthly pages where the data can be updated, rather than creating a new page each day - after a short time administration will become a nightmare. Obviously it depends on the total volume of content you will be publishing each day - so my suggestion may not be one size fits all.

I hope this helps.

comments: author: Yuval Konstantini
body: Hey Andy, thank you very much!

So I understand that we need to route our task to the pages and not blogs.

Create a template for a page sounds great, but for some reason I can't find how. Can you please assist me with that?

Thank you very much for the advice!


author: Yuval Konstantini
body: Hey, we found out how to do it. thank you!


author: Katie McDaniel
body: Is this feature on the roadmap? I can't understand why template functionality isn't available for blog posts.


Tags: blog

cloud

confluence-cloud

document

summary

template