Failed to upload test report . Using user and password as auth.
Asked by Fredrik Sv?rd:

Digest: sha256:25f4f1919324ff3da504da3c2837e83f5f4bfa8e74decca0c3c2c5e0319f7381  
86
Status: Downloaded newer image for bitbucketpipelines/bitbucket-upload-file:0.7.3  
87
DEBUG: Starting new HTTPS connection (1): [bitbucket.org:443](http://bitbucket.org:443/)  
88
DEBUG: [https://bitbucket.org:443](https://bitbucket.org/) "GET /bitbucketpipelines/official-pipes/raw/master/pipes.prod.json HTTP/11" 200 None  
89
INFO: Executing the pipe...  
90
INFO: Start uploading 1 files ['test-reports/report.xml']...  
91
DEBUG: Starting new HTTPS connection (1): [api.bitbucket.org:443](http://api.bitbucket.org:443/)  
92
DEBUG: [https://api.bitbucket.org:443](https://api.bitbucket.org/) "POST /2.0/repositories///downloads HTTP/11" 403 57  
93
? Failed to upload files ['test-reports/report.xml']. Status code: 403. Message: This endpoint does not support token-based authentication.  
94


Answers:
author: Igor Stoyanov
body: [@Fredrik Sv?rd](/t5/user/viewprofilepage/user-id/5570822) hi. Thank you for your question.  
According to your logs  
DEBUG: [https://api.bitbucket.org:443](https://api.bitbucket.org/) "POST /2.0/repositories///downloads HTTP/11" 403 57  
93  

Seems like you do not have environment variables:  
BITBUCKET_REPO_OWNER  
BITBUCKET_REPO_SLUG  

Usually they should be defined by default when you ran a pipeline.  
Check if they are present in pipelines log Build setup  
![Screenshot 2024-08-23 at 17.08.28.png](https://community.atlassian.com/t5/image/serverpage/image-id/343501i68D011978A8F6854/image-size/large?v=v2&px=999 "Screenshot 2024-08-23 at 17.08.28.png")  
If these variables not present in your pipelines log build setup, then provide a link to your failed pipeline.  

Regards, Igor


author: Syahrul
body: G'day, [@Fredrik Sv?rd](/t5/user/viewprofilepage/user-id/5570822)

Welcome to the community!

You should generate an [App password](https://support.atlassian.com/bitbucket-cloud/docs/app-passwords/) as your credentials. The combination should be your username as well as App Password.

Let me know if that works.

Regards,  
Syahrul

comments: author: Fredrik Sv?rd
body: Hi!

I have already tried that before your suggestion:

![Screenshot 2024-08-22 at 18.23.45.png](https://community.atlassian.com/t5/image/serverpage/image-id/343301iDC62EF443B17F110/image-size/large?v=v2&px=999 "Screenshot 2024-08-22 at 18.23.45.png")![Screenshot 2024-08-22 at 18.23.09.png](https://community.atlassian.com/t5/image/serverpage/image-id/343302i63873738DEF64EB1/image-size/large?v=v2&px=999 "Screenshot 2024-08-22 at 18.23.09.png")


author: Syahrul
body: Hey [@Fredrik Sv?rd](/t5/user/viewprofilepage/user-id/5570822)

Thanks for the confirmation.

If you are using the correct username and password, then I believe you should try to call your workspace and repository name directly instead of using the variable.

I also suggest removing the account/repository if you are uploading the artifacts on the same workspace/repository as it will use the default ${BITBUCKET_REPO_OWNER} and `${BITBUCKET_REPO_SLUG}.`

`Regards,`  
`Syahrul`


Tags: bitbucket-cloud

bitbucket-pipelines

cloud

downloads

file

pipes