I've followed the steps in the following link - https://confluence.atlassian.com/bitbucket/deploy-build-artifacts-to-bitbucket- downloads-872124574.html
However the upload fails to show up in the downloads section.
curl -X POST --user "${BB_AUTH_STRING}" "https://api.bitbucket.org/2.0/repositories/${BITBUCKET_REPO_OWNER}/${BITBUCKET_REPO_SLUG}/downloads" --form files=@"./builds/myBuild-$VERSION_NUMBER.tar.gz" -v
Adding the verbose flag to curl shows
* Trying 18.205.93.7...
* TCP_NODELAY set
* Connected to api.bitbucket.org (18.205.93.7) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
* CAfile: /etc/ssl/cert.pem
CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-ECDSA-AES128-GCM-SHA256
* ALPN, server accepted to use h2
* Server certificate:
* subject: C=US; ST=California; L=San Francisco; O=Atlassian, Inc.; OU=Bitbucket; CN=*.bitbucket.org
* start date: Jun 12 00:00:00 2017 GMT
* expire date: Jun 16 12:00:00 2020 GMT
* subjectAltName: host "api.bitbucket.org" matched cert's "*.bitbucket.org"
* issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=DigiCert SHA2 High Assurance Server CA
* SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Server auth using Basic with user 'emailaddress'
* Using Stream ID: 1 (easy handle 0x7fadf980b200)
> POST /2.0/repositories/{repo owner}/{reposlug}/downloads HTTP/2
> Host: api.bitbucket.org
> Authorization: Basic xyz
> User-Agent: curl/7.54.0
> Accept: */*
>
* Connection state changed (MAX_CONCURRENT_STREAMS updated)!
< HTTP/2 401
< server: nginx
* Authentication problem. Ignoring this.
< www-authenticate: Basic realm="Bitbucket.org HTTP"
< content-type: text/html; charset=utf-8
< strict-transport-security: max-age=31536000; includeSubDomains; preload
< date: Mon, 12 Aug 2019 20:09:33 GMT
< x-served-by: app-142
< x-static-version: d8364b911498
< etag: "d41d8cd98f00b204e9800998ecf8427e"
< x-render-time: 0.248876094818
< x-version: d8364b911498
< x-request-count: 102
< x-frame-options: SAMEORIGIN
< content-length: 0
<
* Connection #0 to host api.bitbucket.org left intact
I'm using an app password and accessing a team owned repo of which I'm an admin. I can't get around the 401. Any thoughts on what's going on?
Hello @Derek Foreman,
Can you double-check that the authroization header in the request that curl logs looks correct (I hope it was you who masked it with xyz here)? It should be a Base64 encoded string
<your_username>:<your_app_password>
I'm just wondering maybe there's some extra space or something?
The issue is with authorization, so it can either be scope of your app password or with the actual value you're providing as credentials when making a request.
Cheers,
Daniil
The username was incorrect. It is different from login.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.