I have a process batch that it downloads repositories from bitbucket with wget
command. Now, the process is fail with 404 error
wget https://bitbucket.org/fwmovilidad/desplieguemanualcformation/get/SubidaPRO20FEB.tar.gz
--2022-09-30 08:48:01-- https://bitbucket.org/fwmovilidad/desplieguemanualcformation/get/SubidaPRO20FEB.tar.gz
Resolviendo bitbucket.org (bitbucket.org)... 104.192.141.1
Conectando con bitbucket.org (bitbucket.org)[104.192.141.1]:443... conectado.
Petición HTTP enviada, esperando respuesta... 404 Not Found
2022-09-30 08:48:03 ERROR 404: Not Found.
Atlassian recently made a change where we return 404
instead of 403
code for unauthenticated users, which has caused an issue in downloading the archive from Bitbucket using wget.
The wget
command always waits for the 403
challenge from the server before it sends the credentials to the server.
However, with the recent changes, the server initially sends the 404
status to the client and wget doesn't send credentials later on.
I have two suggestions to work around this issue:
--auth-no-challenge
flag in the wget
command as follows:wget --user=BitbucketUsername --password=AppPassword --auth-no-challenge https://bitbucket.org/Workspace-ID/Repo/get/master.tar.gz
curl
command instead:curl -u BitbucketUsername:AppPassword https://bitbucket.org/Workspace-ID/Repo/master.tar.gz -o master.tar.gz