Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

NoSuchPathException in the bitbucket github api

Hi Team,

We are using Bitbucket github and I am using their API to update an file like below

In case of updating the, it works as expected

curl -X PUT -u username:password -F -F 'message=Updated using file-edit REST API'
-F branch=master -F sourceCommitId=5636641a50b

Updating the file in github repo works as expected but when I try to create the new file path like below

curl -X PUT -u username:password -F -F 'message=Updated using file-edit REST API'
-F branch=master -F sourceCommitId=5636641a50b

it fails with the error : **NoSuchPathException**

"errors": [
"context": null,
"message": "test/ could not be edited because the file has been deleted on the 4186264533e065bd10ad2baf307f5687afcb445c branch.",
"exceptionName": "com.atlassian.bitbucket.content.NoSuchPathException"

As per the documentation, It says both the update and create should work as expected but only UPDATE is working and CREATING A NEW FILE fails

**branch: the branch on which the path should be modified or created**

Anyhelp on this is appreciated!

1 answer

0 votes

For people running into this issue, you need to remove the sourceCommitId parameter for new files. Seems like the sourceCommitId is needed only for existing files.

Suggest an answer

Log in or Sign up to answer

Atlassian Community Events