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

error 500 after try to upload file to the main branch

Felipe Ignacio Illanes Lopez
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 12, 2024

I'm using Ansible locally as curl template for the interaction with the Bitbucket API. A couple of month ago the script works perfectly but today crash after try to upload content with a multipart/form-data 

The code with problem (this give 500 error, and don't say so much to identify the problem...)

 

- name: Upload content to main
   ansible.builtin.uri:
       url: https://api.bitbucket.org/2.0/repositories/my_company/{{ repository_name }}/src
       method: POST
       body:
           .gitignore:
               filename: .gitignore
        body_format: form-multipart
        status_code: 201
        headers:
            Content-Type: multipart/form-data
            Authorization: '{{ auth_token }}' //use an account with admin access , all scopes
Is same as curl but when i try to execute show a msg "something went wrong" , can someone help? thank you :)

1 answer

1 accepted

1 vote
Answer accepted
Felipe Ignacio Illanes Lopez
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 12, 2024

Actually i solved the problem, but the script was ok, the problem was some configuration in the bitbucket cloud project (impact in all the repositories under that name). For some reason in the "Branch Model" section, with the option "development branch" i put use main branch and for "Production branch" i put No production branch. With that changes my script works and can create repositories (my total script do that) 

Because the configuration was defined with: Development branch -> use specific branch and Production branch -> use specific branch. With this option i recieve the error mentioned en before question.

I share my github if someone needs help, and if can someone explain why with that options works? 

My github https://github.com/fillanes/create-bitbucket-repo-ansible/ . And thanks for take a time for read this :)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events