Support Questions
Find answers, ask questions, and share your expertise

Apache Atlas Import Error

Apache Atlas Import Error

New Contributor

Hi all,


I'm trying to perform an import in Atlas using Import API by leveraging Python Requests.

I have successfully exported data in a ZIP file previously using Python Requests.

Now, when I try to import data (on the same Atlas instance where I exported data from) I get an Null Pointer Exception Error.

Below is the code used to call Atlas Import API:

headers = { "Cache-Control" : "no-cache" }
local_filename = "/tmp/backup.zip"
r = requests.post(
    self.__import_api_url, # this is Atlas Server URL for Import API
    headers = headers,
    files = { "file" : (local_filename, open(local_filename, "rb"))},
    auth = (self.__user, self.__pwd) # authentication username and password
)

The response from Python Requests is:

{"errorCode":"ATLAS-500-00-001","errorMessage":"java.lang.NullPointerException: "in is null","errorCause":"in is null"}

Attached there is the log file generated by Atlas.

Atlas_import_error.txt


Any help is much appreciated!


Thanks,

Alessandro

2 REPLIES 2
Highlighted

Re: Apache Atlas Import Error

New Contributor

Finally figured it out!

The problem was the files entry in the request.

The correct one is:

files = { "data" : (None, open(local_filename, "rb"))}
Highlighted

Re: Apache Atlas Import Error

New Contributor

I'm able to perform an Import with cURL (as per documentation) using the same zipped file previously exported.

This is just to confirm the the export ZIP is not corrupted.