I created an app password for my Bitbucket profile a few months ago, and have been using it to access (clone, branch, push, & pull) various repositories on different remote machines since then.
Recently I've been having issues on one machine. Following the instructions in this thread:https://community.atlassian.com/t5/Bitbucket-questions/How-do-I-use-the-new-app-password-for-command-line-Git/qaq-p/1955078... I switched to using the app password with the following command:> git remote set-url origin https://<my Bitbucket user name>:<my app password>@bitbucket.org/<repo owner's user name>/<repo name>.gitThis doesn't report any problems, but when next I try communicating with the remote server, I get the same error message I'd see if I never added the app password at all:
> git pushremote: Bitbucket Cloud recently stopped supporting account passwords for Git authentication.remote: See our community post for more details: https://atlassian.community/t5/x/x/ba-p/1948231remote: App passwords are recommended for most use cases and can be created in your Personal settings:remote: https://bitbucket.org/account/settings/app-passwords/fatal: Authentication failed for 'https://bitbucket.org/<repo owner's user name>/<repo name>.git/'
Hello @beany_kelly ,
Thank you for reaching out to Atlassian Community!
The command you have used to switch to app password is specific when cloning from your personal repository, as you are using your username as the workspace name. By default when you create a bitbucket account, a personal workspace is created with the same name as your Bitbucket username, and this is why that command was working when cloning from your personal repository.
Having said that, a more generic command, that works for all the cases, including shared workspaces, would be the following :
git remote set-url origin https://<BITBUCKET USERNAME>:<APP PASSOWORD>@bitbucket.org/<WORKSPACE NAME>/<REPO SLUG>.git
Please note that we are using the WORKSPACE NAME as part of the path in the URL.
Could you please try using the command above and let us know how it goes?
Hope that helps! Let us know in case you run into any issues.
Thank you @beany_kelly !
Kind regards,
Patrik S
Found my problem, and it's stupid. I'd set the app password *twice*, and screen captured it each time, saving the screencaps in different locations. I then was using the *old* app password on the machine in question, and didn't realize it.I just found the new app password, and used it in the "git remote set-url origin" command. This time it worked.So I'll close this report. The only thing I'd like is for the system to report that the app password being used was *incorrect*, rather than imply that I wasn't using one at all.
Hi Patrik. I'm a bit confused by your alternative command, as to my knowledge, the <WORKSPACE NAME> is the same as the <repo owner's user name> (I wasn't using my own workspace, and wasn't using my bitbucket name in there).
To be more specific, the repository is called "<REMOVED>", and it belongs to the user "<REMOVED>": https://bitbucket.org/<WORKSPACE>/<REPOSITORY/src/master/The command I run is:
git remote set-url origin https://USERNAME:<MY APP PASSOWORD>@bitbucket.org/WORKSPACE/REPOSITORY.git
... and it's not working for me. The name "<REMOVED>" appears in the clone command on that page, so if it's *not* the workspace name, I don't know what is.
I have edited your previous answer to remove the personal information such as workspace and repository names.
Back to your question, the workspace name is the same as <repo owner's user name> for personal workspaces by default. But in Bitbucket Cloud you have the option to change the workspace name to a name different than your Bitbucket username. You also have the option to create additional workspaces, other than your personal,that are not attached to your account, and are considered shared workspaces, owned by all the users that are in the Administrators group. This is the reason I said the correct generic URL would be :
ttps://<BITBUCKET USERNAME>:<APP PASSOWORD>@bitbucket.org/<WORKSPACE NAME>/<REPO SLUG>.git
As you are cloning from someone else's personal repo, the URL you have used seems to be correct. Since you are still facing the error, my suggestion, in this case, would be
If the above does not work, could you please run the git push including verbose logs, and share here the result? The command would be like the below :
GIT_TRACE_PACKET=1 GIT_TRACE=1 GIT_CURL_VERBOSE=1 git push
When sharing the full output, please make sure to sanitize any personal information such as passwords/login/username.
Thank you, @beany_kelly !
Hi @Patrik S . Thanks for the quick response, and for explaining the possible distinction between the user name and the workspace name (which doesn't apply here).Taking your second suggestion first, the machine I'm using this on is a remote supercomputer running a flavor of Linux, so the Windows & MacOS instructions for searching for Git credentials don't apply. I tried following the guidance here:[ https://stackoverflow.com/questions/44246876/how-to-remove-cached-credentials-from-git ], but unless they're somewhere nonstandard (i.e. not in my $HOME on this machine), I didn't have any credentials cached (i.e. there's no .git-credentials there).
For your first suggestion, I'm not sure what you mean by "Check if the app password [...] does not have the required permissions". I have one app password set up on Bitbucket, and I'm using it for accessing repositories owned by me and other collaborators. If I have commit privileges to someone else's repository, can't I use the same app password I'm using for my own?
It looks like you're new here. Sign in or register to get started.