youngmon/atlassian-qna huggingface dataset:
Why do i get this error? https://bitbucket.org/humblebee/happy-co-hive-12/pipelines/results/55/steps
Asked by Abdelilah Achir:

image: node:16

pipelines:  
default:  
- parallel:  
- step:  
name: Build  
caches:  
- node  
script:  
- npm install  
- step:  
name: Code linting  
script:  
- npm install eslint  
- npx eslint .  
caches:  
- node  
branches:  
master:  
- parallel:  
- step:  
name: Build  
caches:  
- node  
script:  
- npm install  
- apt update \&\& apt install zip  
#Debug  
- ls  
# Exclude files to be ignored  
- zip -r app-$BITBUCKET_BUILD_NUMBER.zip .  
#Debug  
- ls  
artifacts:  
- 'app-$BITBUCKET_BUILD_NUMBER.zip'  
- step:  
name: Security Scan  
script:  
- pipe: atlassian/git-secrets-scan:0.5.1  
- step:  
name: Deploy to Production  
trigger: manual  
deployment: Production  
script:  
- ls  
- pipe: atlassian/azure-web-apps-deploy:1.0.1  
variables:  
AZURE_APP_ID: ''  
AZURE_PASSWORD: ''  
AZURE_TENANT_ID: ''  
AZURE_RESOURCE_GROUP: '  
AZURE_APP_NAME: ''  
ZIP_FILE: 'app-$BITBUCKET_BUILD_NUMBER.zip'


Answers:
author: Mark C
body: Hi [@Abdelilah Achir](/t5/user/viewprofilepage/user-id/5344864)  

<br />

Welcome to the community.  

Would it be possible for you to let us know what specific error message you're getting?  

Regards,

Mark C

comments: author: Abdelilah Achir
body: Hi Mark,

I can't paste directly the error, but it says that there is no such file or directory app-58.zip


author: Igor Stoyanov
body: [@Abdelilah Achir](/t5/user/viewprofilepage/user-id/5344864) hi. The error points you that you don't have app-58.zip archive provided with your path. Ensure that you have this zip before pipe execution:

```
script:
  - echo ls -alt  # ensure your archive is present
  - pipe: atlassian/azure-web-apps-deploy:1.0.1
    ...
```

Regards, Igor


author: Abdelilah Achir
body: Thanks for answering Igor, as you can se at the pipeline, I do LS to see if the zip is present at the current directory. But is not, that's why I wonder why is not in there if it's been created at the previous step. And when I do a LS at the previous step I do see the zip file.


author: Mark C
body: Hi [@Abdelilah Achir](/t5/user/viewprofilepage/user-id/5344864)  

Thanks for that information.  

I can see now that this is because you used an environment variable as part of the artifacts folder. Unfortunately, we currently do not support environment variables as artifact paths.  

We do have an existing feature request for it that can be located through this link. - <https://jira.atlassian.com/browse/BCLOUD-21666>

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.  

As a workaround, please kindly use an exact folder artifacts folder path.  

Regards,  
Mark C


Tags: bitbucket-cloud

cloud
Failed to detect original file encoding. Cannot save commit with unknown encoding
Asked by Ahmad Jamal:

Hi

Why I get error for edit file?  
Failed to detect original file encoding. Cannot save commit with unknown encoding


Answers:
author: Patrik S
body: Hello [@Hossein Ali Reza Asgari](/t5/user/viewprofilepage/user-id/5344512) and welcome to the community!

This is usually caused when you copy/paste the filename which might bring some invalid UTF-8 characters causing the encoding error. If that is the case, you can try manually typing the name of the file instead and see if the error persists.

Another alternative is to clone the repository locally, make the changes to the file locally, and then push the changes back to Bitbucket Cloud.

Thank you, [@Hossein Ali Reza Asgari](/t5/user/viewprofilepage/user-id/5344512) !

Patrik S

comments: author: Gilbert ALBANIS
body: I had the same problem, but I didn't copy-and-paste the file name. The file name was:

```
main.c?
```

Very standard name. I don't understand what the problem is. Please help.


author: Theodora Boudale
body: Hi Gilbert,

What is the encoding of this file? Bitbucket tries to guess a file's encoding and, when it fails, issues like this may arise.

We have a feature request for the ability to specify a repository's encoding:

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

In the meantime, you can edit the file locally, commit and push to Bitbucket.

I would also suggest using UTF-8 encoding for files, if possible.

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
Search code API on private repository not working
Asked by codec:

Hello,

I am trying to search code via API but for some reason it won't return code that is not in a public repository. I have tried repo:repo_slug, but it still won't return it. It will return however code in public repositories of the workspace.

I am using the same token on other routes, and never had that issue between public and private repository.

Example request : {{protocol}}://{{host}}/{{basePath}}workspaces/:workspace/search/code?search_query=repo:{uuid} SearchQuery


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

Could you please let me know what kind of access token you are using for authentication?

There is currently a limitation with workspace access tokens, that cannot be used for authentication with the code search endpoint:

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

It should be possible to search using basic auth with username and app password or with an OAuth access token.

Kind regards,  
Theodora


author: codec
body: PS : it would work with Basic Auth, but not with bearer, is that intended ?


Tags: bitbucket-cloud

cloud

rest-api
My repository is missing
Asked by Rafa Gallego:

Hello.

I have logged in today to my workspace and I found that there is no repository in it. It should be one repo named "REDACTED". I worked on it a few weeks ago, pushing changes I made from VSC, and everything was fine, but today I have found this situation :(

PS: I have my repo on my computer too, but I need to have it on Bitbucket also.

Can you help me, please?


Answers:
author: Ben
body: Hi Rafa,

No need to stress! :)

I have taken a look at existing workspaces that match your name and have located the repository that you are looking for.

What has happened is that the email address you have used to raise this community support ticket is not the correct login email address for the workspace that this repository belongs to - please review our documentation below for further context:

* <https://confluence.atlassian.com/bbkb/email-address-transferred-to-a-new-account-1188411865.html>

Please login to your workspace using your other email address (hint: the domain for this email address contains part of your name in it). We cannot reveal any further information more specific than that as this is a public forum and it would not be appropriate to reveal your personally identifiable information here.

If you are still unable to track down your repository, please let me know and I will open a support ticket on your behalf :)

Cheers!

- Ben (Bitbucket Cloud Support)

comments: author: Rafa Gallego
body: Hello, Ben.

That was the problem! Pfff I think the problem is that I have an account for Trello and I'm using another email for that account, so I made a mistake when login to Bitbucket... FACEPALM!

Thank you very much for your help. I was so stressed! LOL

Regards!


author: Ben
body: Hahah no worries Rafa, it's a common mistake to make. I'm glad to hear that you are no longer stressed, and more importantly, have access to your content again! ;)

Cheers!

- Ben (Bitbucket Cloud Support)


Tags: bitbucket-cloud

cloud
nota able to connect bitbucket repo from jenkins
Asked by cheemakurthyteja:

Hello Team,

I'm facing the issue with Jenkins integration with bitbucket. i hve setup a job to sync code from bitbucket to AEM aacs, when i tried to take a pull from repo it was not accessible. i have tried multiple ways to access repo, there is no luck. can you please help me to sync code with jenkins.

Regards,

Teja


Answers:
author: Manoj Kumar Emmadi
body: Hi [@cheemakurthyteja](/t5/user/viewprofilepage/user-id/5344213) ,

Check the below things before retrying :

1) You have the read/write access to the Bitbucket repository which you are trying to access. (User with Bitbucket admin rights can check this).

2) Ensure the webhook created on Bitbucket for Jenkins integration is working.

Best Regards,

Manoj.


author: Weronika Spaleniak Appfire
body: Hey [@cheemakurthyteja](/t5/user/viewprofilepage/user-id/5344213) !  
You could also try using[Webhook to Jenkins for Bitbucket](https://marketplace.atlassian.com/apps/1211284/webhook-to-jenkins-for-bitbucket?hosting=cloud&tab=overview) plugin that is another way to stay connected between Bitbucket and Jenkins.   

If you'd like to chat about your use case and see how the app works, you can book some time in my [calendar](https://calendly.com/weronika-spaleniak/wjbb-demo) or you can just give it a try.  

Full disclosure- I work for Appfire, the plugin's developer.  
Best,  
Weronika


Tags: bitbucket-cloud

cloud
While create new project and repository fatal destination path error
Asked by MFP_Admin:

Error received when cloning : destination path already exists and is not an empty director

\<redacted for privacy\>


Answers:
author: Patrik S
body: Hello [@MFP_Admin](/t5/user/viewprofilepage/user-id/5343932) and welcome to the Community!

When git is cloning the repository, it will automatically create the local folder for you where the repository will be stored. If the folder already exists in the directory you provided and it's not empty, git will error out with the message you received "destination path already exists and is not an empty directory"

In this case, you will need to first delete the existing folder **F:\\eeasy\\Products\\posMonitorClient** then try to clone the repository again :)

You can try that solution and let us know how it goes!

Note: I've edited your post to remove the screenshot as it container private information.

Thank you, [@MFP_Admin](/t5/user/viewprofilepage/user-id/5343932) !

Patrik S


Tags: bitbucket-cloud

cloud
can we run pipes in a bash script ?
Asked by Irfan Nazer:

I have multiple steps that should be run on different conditions, and every step should run on the same deployment, so instead of using the inbuild condition which the bitbucket pipeline provided I've started checking within the scripts

- step: \&DeployUI  
oidc: true  
size: 2x  
name: Deploy UI  
caches:  
- node  
script:  
- \|  
if git diff-tree --no-commit-id --name-only -r HEAD \| grep -q "src" \|\| git diff-tree --no-commit-id --name-only -r HEAD \| grep -q "public"; then  
npm install  
CI=false npm run build  
pipe: atlassian/aws-s3-deploy:1.2.0  
variables:  
AWS_DEFAULT_REGION: $REGION  
AWS_OIDC_ROLE_ARN: "arn:aws:iam::$ACC_ID:role/Admin"  
S3_BUCKET: $content_bucket  
LOCAL_PATH: "build"  
pipe: atlassian/aws-cloudfront-invalidate:0.7.0  
variables:  
AWS_DEFAULT_REGION: $REGION  
AWS_OIDC_ROLE_ARN: "arn:aws:iam::$ACC_ID:role/Admin"  
DISTRIBUTION_ID: $cloudfront_dist_id  
but its not identifying this pipe what should I do


Answers:
author: Patrik S
body: Hello [@Irfan Nazer](/t5/user/viewprofilepage/user-id/5242861) and welcome to the Community!

Since pipes are a Bitbucket cloud's feature, their definition must be placed within the step's script YML attributes for it to be correctly identified by pipelines.

One route you could take for putting the conditions in the step while still being able to execute the pipe is to force the exit of the step if the condition is/is not met, as in the following example :

```
script:  - if [[ ! $CONDITION ]]; then exit 0 ; fi #if $CONDITION is not met, exit the step and goes to next step
  - npm install
  - pipe: atlassian/email-notify:0.11.0    variables:      USERNAME: 'myemail@example.com'      PASSWORD: $PASSWORD      FROM: 'myemail@example.com'      TO: 'example@example.com'      HOST: 'smtp.gmail.com'      PORT: 587      SUBJECT: 'Bitbucket Pipe Notification for your-bitbucket-brunch'      DEBUG: true
```

In the above example, if the boolean condition $CONDITION is not met, we will force the completion of the step with exit 0 (so the step will be completed with Success status), which will make the pipelines go to the next step in the build, if any, or complete the pipeline if there are no remaining steps.

On the other hand, if the boolean condition $CONDITION is true, it will continue the execution of the next commands in the step's script, which includes the npm install and the pipe execution.

Hope that helps! Let me know in case you have any questions.

Thank you, [@Irfan Nazer](/t5/user/viewprofilepage/user-id/5242861) !

Patrik S


Tags: bitbucket-cloud

bitbucket-development

bitbucket-pipelines

cloud
Default Reviewers now has a limit of 10 - Why
Asked by Corry Littlefair:

For both Project and Repo settings, I am trying to add the team members that are required as 'Default Reviewers' - This is for a min of 3 default to review and approve.

In previous repo's we have had quite a few, but now there is a limitation of 10-default reviewers. (Inherited from project or within repo).

Has this limit been recently applied and is there a way to change / remove it?

Cannot find anything on help / community or documentation.

Thanks


Answers:
author: Syahrul
body: G'day, [@Corry Littlefair](/t5/user/viewprofilepage/user-id/4843309)

The current limitation allows you to add up to 10 reviewers at a time. However, this doesn't mean you're limited to only ten reviewers. You can add the first ten reviewers and the next set; the system should not prevent you from doing so.

Therefore, the "Add Reviewer" form has a limitation of 10 users at a time but not a total of 10 users.

I hope this helps.

Regards,

Syahrul


Tags: bitbucket-cloud

cloud
pinelines gradle bitbucket
Asked by andrew nguyen:

gradle not found


Answers:
author: Ben
body: G'day Andrew!

Welcome to the Bitbucket Cloud community! :)

We will need a bit more context to understand the nature of the issue you are facing. My initial thoughts are that there is either an issue with the command that is being executed, the $PATH variable (if using self-hosted runners), or simply a change in the docker image that is being executed where gradle is no longer included in this image.

Please refer to our documentation below based on your setup and let me know if this helps:

* [Bitbucket Pipelines](https://confluence.atlassian.com/bbkb/bitbucket-pipelines-command-not-found-error-1267761733.html)
* [Bitbucket Pipelines (Self-Hosted Runners)](https://confluence.atlassian.com/bbkb/docker-command-not-found-error-while-running-docker-commands-in-self-hosted-runner-1206785605.html)

Cheers!

- Ben (Bitbucket Cloud Support)


Tags: bitbucket-cloud

cloud
Claiming the Bitbucket workspace which belongs to our organization.
Asked by Monish Dashora:

We are urgently looking forward to have some help on claiming the Bitbucket workspace which belongs to our organization.

The user who created this workspace has left the organization and we are unable to claim it now.


Answers:
author: Hana Ku?erov?
body: Hi [@Monish Dashora](/t5/user/viewprofilepage/user-id/5343176) ,

welcome to the Atlassian Community!

Please reach directly the Atlassian support with this, they will surely help you:

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


Tags: bitbucket-cloud

cloud
403 When trying to create an issue in a private issue tracker via cloud app JWT and cloud REST api
Asked by Joseph Potochny:

Hello,

I am trying to test the creation of issues on a private issue tracker in one of my workspaces. I am using our development cloud app to authenticate the calls, with the scopes "issue:write", "repository", "account", and "pullrequest". According to the docs: <https://developer.atlassian.com/cloud/bitbucket/rest/api-group-issue-tracker/#api-repositories-workspace-repo-slug-issues-post> all I should need is the "issue:write" scope.

I then tried adding more scopes to see if there was some other scope I needed, but even after re-installing the app on my workspace and completely removing/installing it, I still can't create the issues .

I tried exchanging the JWT I am creating for an access token in order to view the scopes, and the scopes don't seem to have the updated scopes I added to the descriptor (though it still has issue:write, account, and pullrequest)

I see the additional scopes when I am authorizing the install of the app, so it is strange to me that the JWT doesn't seem to get the new ones.

So I have 2 problems:

1. The "issue:write" scope doesn't seem to be enough to create issues on a private issue tracker, even combined with the "repository" scope.

2. I don't get updated scopes if I update my app and generate a new JWT. The app isn't on the marketplace, so I am using its install url directly.


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

I haven't been involved with app development so I don't know the answer to your questions. I just wanted to suggest posting your question in the developer community, as this is specifically for app development questions:

* <https://community.developer.atlassian.com/c/bitbucket-development/bitbucket-cloud/13>

Kind regards,  
Theodora

comments: author: Joseph Potochny
body: Oh, awesome I'll go post it there!


Tags: bitbucket-cloud

cloud
Verification email not received
Asked by francfruct:

Hi,

Trying to set up a new BitBucket account for my work but not receiving the verification email. Email address to check: \<email_removed\>


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

Just a heads up, I moved your post to a new question. Please create a new question if you need assistance to ensure visibility to the rest of my team, in case I am out of office, and also because an existing question can become difficult to follow if we try to help multiple different users. I also removed the email address from your post to protect your privacy.

I checked our email logs and this email address was in a suppression list because we received a hard bounce response from the mail server when we attempted to send an email, with the message

```
554 5.7.1 [internal] recipient address was suppressed due to customer policy
```

I went ahead and removed your email address from the suppression list, can you please try requesting a new verification email now?

Kind regards,  
Theodora

comments: author: francfruct
body: ok, now I have received the email.

Thank you


author: Theodora Boudale
body: That's good to hear, thank you for the update.

Please feel free to reach out if you ever need anything else!


Tags: bitbucket-cloud

cloud
Not able to publish npm package to public nexus repository
Asked by Pranshu:

Please find the configured pipeline below  

tags:  
'\*':  
- step:  
name: Init  
caches:  
- node  
script:  
- npm config set @apollo247:registry=\<Registry\>  
- npm config set _auth=$NPM_TOKEN  
- npm install  
- pipe: atlassian/npm-publish:1.0.0  
variables:  
NPM_TOKEN: $NPM_TOKEN  
DEBUG: 'true'  
NPM_REGISTRY_AUTH_URL: \<Registry\>

Find Error below from the pipeline  

npm notice  
740
npm verb stack Error: This command requires you to be logged in to $NPM_REGISTRY  
741
npm verb stack at Publish.exec (/usr/local/lib/node_modules/npm/lib/commands/publish.js:110:29)  
742
npm verb stack at async module.exports (/usr/local/lib/node_modules/npm/lib/cli-entry.js:61:5)  
743
npm verb cwd /opt/atlassian/pipelines/agent/build  
744
npm verb Linux 5.15.0-1044-aws  
745
npm verb node v18.18.0  
746
npm verb npm v9.8.1  
747
npm ERR! code ENEEDAUTH  
748
npm ERR! need auth This command requires you to be logged in to $NPM_REGISTRY  
749
npm ERR! need auth You need to authorize this machine using `npm adduser`  
750
npm verb exit 1  
751
npm verb code 1  
752  
753
npm ERR! A complete log of this run can be found in: /root/.npm/_logs/2023-10-17T08_46_19_082Z-debug-0.log  
754
+ status=1  
755
+ set -e  
756
+ [[ 1 -eq 0 ]]  
757
+ fail 'Failed to publish package "@apollo247/pharma-cart-sevice@1.0.0-alpha16".'  
758
+ echo -e '\e[31m? Failed to publish package "@apollo247/pharma-cart-sevice@1.0.0-alpha16".\e[0m'  
759
+ exit 1


Answers:
author: Igor Stoyanov
body: [@Pranshu](/t5/user/viewprofilepage/user-id/5342737) hi. Please, [check this article](https://stackoverflow.com/questions/75591566/npm-publish-error-you-need-to-authorize-this-machine-using-npm-adduser).

Regards, Igor


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

The README of the [pipe's repo](https://bitbucket.org/atlassian/npm-publish/src/master/) mentions the following:
> By default, the pipe publishes to [npmjs.com](https://npmjs.com/). You can publish to any other registry by adding a **publishConfig.registry** key in your **package.json** . See [npm documentation](https://docs.npmjs.com/cli/v10/using-npm/developers) for more details.

Are you publishing to a registry other than <https://npmjs.com/>? If so, have you configured the publishConfig.registry key in your package.json?

Kind regards,  
Theodora

comments: author: Pranshu
body: Yes, I'm publishing to a registry other than npmjs and some had been configured in publishConfig.registry key


Tags: bitbucket-cloud

cloud

npm
fatal: could not read Username for 'https://bitbucket.org': No such device or address
Asked by stuart.stephen:

We have a Jenkins pipeline that checks out the code from <https://bitbucket.org/company/repo.git>. This has been working fine for the last 3-4 years, but started failing over the weekend with the error "fatal: could not read Username for '<https://bitbucket.org>': No such device or address".

The issue does not occur during checkout, that seems fine, but instead when we run the command "git fetch --prune --prune-tags origin" on the checked out workspace.

We found a solution to include the username and password in the URL, which is fine, it seems to work, but various posts on here seem to suggest switching to SSH keys instead.

1. Why did it break? We did not update any software.
2. Is the <https://user:pass@bitbucket.org/company/repo.git> a good solution, or should we be looking to move to SSH for longevity?

Thanks,  
Stuart


Answers:
author: Syahrul
body: G'day [@stuart.stephen](/t5/user/viewprofilepage/user-id/5342713)

Welcome to the community.

I have reviewed the recent changes and existing customer reports, and I can confirm that there have been no recent changes or reports of customers experiencing the same issue.

However, it's challenging to pinpoint the exact cause since the Jenkins server is hosted on your end. That said, I can confirm that using username:app_password behavior aligns with the expected outcome when using HTTPS.

To prevent similar issues in the future, I recommend switching to SSH.

I hope this information is helpful.

Regards,  
Syahrul


Tags: bitbucket-cloud

cloud