what are the rules for naming branches and tags in...
# help
u
what are the rules for naming branches and tags in lakefs?
u
There isn’t a limitation related to branch and tags names. You can have a branch and tag with an identical name on the same repository. Can you share the API call and the error.
u
hi @Eden Ohana thanks for responding!
u
how does lakefs know to distinguish between identical branch/tag names when someone specifies a
--source <lakefs://origin/><ref>
then? when creating a branch
u
this is the code i am using to create a branch:
Copy code
def create_branch_from_tag(self, branch_to_create: str, from_tag: str) -> None:
        try:
            b_api = BranchesApi(self._client)
            branch_creation = BranchCreation(branch_to_create, from_tag)
            b_api.create_branch(LakeFSRESTConnection.LAKEFS_REPO, branch_creation)
        except Exception as e:
            logger.error(str(e), exc_info=True)
u
sometimes it works, other times (seemingly randomly) it fails with:
Copy code
Reason: Internal Server Error
HTTP response headers: HTTPHeaderDict({'Date': 'Tue, 22 Feb 2022 02:55:56 GMT', 'Content-Type': 'application/json', 'Content-Length': '65', 'Connection': 'keep-alive', 'X-Request-Id': 'd028bb65-8c0c-4891-a8f9-a7eab4618049'})
HTTP response body: {"message":"argument branchID: invalid value: validation error"}
u
it’s not clear to me exactly what specific condition triggers that error
u
That’s depending on what operation you do. Tag and commit are different objects in lakefs. For example, you have a branch and a tag with the same name my-tag. It depends on how you refer them. On lakectl you can run
Copy code
lakectl tag delete my-tag 
lakectl branch delete my-tag
When you’re creating a branch it is from a specific commit or tag (that can be related to a specific branch) so it refers to the tag.
u
Does the branch name you’re passing contain special characters?
u
This error suggests that the branch name is illegal
u
hi - sorry for the super late response! i switched to using the lakefs python client and now everything is fine - thanks