Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

I started receiving: [remote rejected] develop -> develop (pre-receive hook declined)

snagar January 29, 2025 edited

Since today (2025-jan-29), I start receiving the error:

 

remote: Permission denied to update branch develop
! [remote rejected] develop -> develop (pre-receive hook declined) error: failed to push some refs to 'https://bitbucket.org/{repository path}'.

 

I found out, that I had defined some "branch restrictions" on my "develop and release" branches, and only allowed my user to modify those branches.
This never happened before.

In all my "environments" and tools (either it is "smartgit", "CLion" or command line "git"), I'm using an "access token" when I'm pushing/pulling, so as long as I worked on other branches there were no issues (including the develop and release branches).

In order to workaround this issue, I momentarily disable the branch restrictions, and re-assign them after I push the change.

 

How can I troubleshoot this behavior, and what should I setup so my "Bitbucket User" will be the one to push the changes, hence it won't have restrictions.

 

edit:

Here are the restrictions I defined:

Screenshot_20250129_183853.png

 

Thanks

Sa'ar

2 answers

1 accepted

0 votes
Answer accepted
Syahrul
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 30, 2025

G'day, @snagar 

If I understand correctly, you're encountering a "permission denied" error when attempting to write to the develop branch using an access token. This behavior is expected because branch permissions only allow you to add users with a valid Bitbucket cloud workspace and don't consider users added by RAT/PAT/WAT (repository/project/workspace access tokens).


This means branches cannot be restricted to allow read/write access only for these access tokens. We have an existing feature request that I highly suggest you Vote and Watch to keep you updated if we have any at:

https://jira.atlassian.com/browse/BCLOUD-22400

Currently, the workaround is to use App Password or OAuth as the authentication method.

Regards,
Syahrul

snagar January 31, 2025

Thanks @Syahrul , Where can I find material regarding Apps Password/OAuth configuration at the client side ?

 

Thanks

0 votes
snagar January 29, 2025 edited

-- Deleted --

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events