Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Bitbucket Data Center - Rest API for import fails with "null for uri" 404 error Edited

Issue:

Using the below command as per the documentation to import or migrate a repository to bitbucket: [Data Center and Server 7.12 version]

https://confluence.atlassian.com/bitbucketserver/importing-957497836.html

curl -s -n -u "XXXX:XXXXX" -X POST -H 'Content-type: application/json' -d '{"archivePath":"2021-04-25_15-20-656_mydevopsproject1_nodejs_export.tar"}' http://localhost:7990/rest/api/1.0/migration/import

 

Checks:

  • The username and Password used is correct and has admin privilege
  • Commands are run with elevated or admin access

 

Steps Followed:

  • Created a local setup for the data center as per the below documentation https://hub.docker.com/r/atlassian/bitbucket-server
  • Copied over the repository to the import folder using the docker cp source_path container:destination_path
  • Tried running the curl command mentioned in the document to begin the import process but it fails with the "null for URI" 404 error. The only difference noticed is that the URL used is modified because the latter path "imports" structure was non-existent.

http://localhost:7990/rest/api/1.0/migration/import 

http://localhost:7990/rest/api/1.0/migration/imports

 

Bitbucket_404_Error.png

1 answer

0 votes

Hi,

What error did you get when using /imports (with an s)?

Cheers,

Christian

Premier Support Engineer

Atlassian

Hi @Christian Glockner ,

The URL is not accessible and seems like a non-existing path. I believe this is because the docker container does not have a "imports" folder. But can confirm that latest docker image was pulled during the execution. PFB the response when accessed via client browser for both scenarios.

Please let me know if any further details needed.

Cheers,

Manoj

Bitbucket_404_Error_Import_1.PNGBitbucket_404_Error_Import_2.PNG

Bitbucket_URL_Not_Accessible_Imports.png

Hi,

The correct URL is /imports - the error you're getting in the browser (and HTTP 405 error) means that the URL does not support the GET method (which a browser uses to retrieve the URL). This does not mean that the URL doesn't work or is invalid.

Cheers,

Christian

Premier Support Engineer

Atlassian

Hi @Christian Glockner,

Got it, checked the API definition, and have updated it accordingly. However, getting the below error even if the archive is present in the shared/data/migration/import.

Could you please let me know if there are any issues in the followed steps:

  • Copied over the repository to the import folder using the docker cp source_path container:destination_path
  • Tried running the below command in the same path
  • curl -s -n -u "usr:pwd" -X POST -H 'Content-type: application/json' -d '{"archivePath":"2021-04-25_15-20-656_mydevopsproject1_nodejs_export.tar"}' http://localhost:7990/rest/api/1.0/migration/imports

Bitbucket_Import_Invalid_Error.png

Thanks,

Manoj

Hi @Christian Glockner,

Could you please review the above case where the correct URL and params were used and still getting an error?

Thanks,

Manoj

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

Calling any interview participants for Bitbucket Data Center

Hi everyone,  We are looking to learn more about development teams’ workflows and pain points, especially around DevOps, integrations, administration, scale, security, and the related challeng...

645 views 7 4
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you