Hi!
I followed the tutorial at:
However the file upload via curl is not working in my case, altough curl states so otherwise:
curl -X POST "https://${BB_AUTH_STRING}@api.bitbucket.org/2.0/repositories/${BITBUCKET_REPO_OWNER}/${BITBUCKET_REPO_SLUG}/downloads" --form files=@"file.pdf"
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 1680k 0 0 100 1680k 0 6426k --:--:-- --:--:-- --:--:-- 6413k
100 1680k 0 0 100 1680k 0 4926k --:--:-- --:--:-- --:--:-- 4927k
Afterwards the downloads section is still empty...
Has anybody an idea what might be the case here?
Hey @Guy_Incognito,
I suspect that your repository is not public and thus you need to pass in credentials with your request.
To test this, add '-v' at the end of your curl command, which enables verbose logging:
curl -X POST "https://${BB_AUTH_STRING}@api.bitbucket.org/2.0/repositories/${BITBUCKET_REPO_OWNER}/${BITBUCKET_REPO_SLUG}/downloads" --form files=@"file.pdf" -v
If this responds with a 401 HTTP response code, create an Application Password, which you configure as a secured variable in Pipelines. Then add `-u <your-user>:<your-password>`.
Thanks @Jeroen De Raedt
Altough the ${BB_AUTH_STRING} did containt the "username:password" combination, the problem was indeed a 401 issue.
I switched to using the ' -u "${USERNAME}:${PASSWORD}" ' option and everything works like a charm..
Thanks a lot!
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.
Could anyone please post a complete curl command? Where to add
-u "${USERNAME}:${PASSWORD}"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I used the following command:
curl -X POST --user "YOUR_USERNAME:YOUR_PWD" "https://api.bitbucket.org/2.0/repositories/YOUR_USERNAME/YOUR_REPO/downloads" --form files=@"YOUR.FILE" -v
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
-curl -X POST --user "USERNAME:PWRD" "https://api.bitbucket.org/2.0/repositories/TEST/Application/downloads" --form files=@"bewerbung.pdf" -v
Like this?
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
https://${BB_AUTHENTIFICATION}@api.bitbucket.org/2.0/repositories/pascal_schroeer/application/downloads
Where ${BB_AUTHENTIFICATION} is "myUsername:myPwrd"
I tried to copy paste this link to the browser and I get
Access denied. You must have write or admin access.
So it seems that the rights of my App Password are not enough... But I already checked everywhere write permissions...
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.