Google Cloud Datastore emulator export/import not working

861 views
Skip to first unread message

Nikitha Kamath

unread,
Nov 1, 2019, 1:04:43 PM11/1/19
to Google App Engine
Hi

I have configured datastore emulator and it is running successfully. But when I export or import entities it is returning error. I am using Windows and below are the commands -

---------- Export --------------
curl -X POST localhost:8081/v1/projects/<project-id>:export -H "Content-Type: application/json" -d "{\"output_url_prefix\":\"C:\Users\<user>\Desktop\Data\"}"

Returns ->
{"error":{"code":500,"message":"Failed to export entities.","status":"INTERNAL"}}


---------- Import ---------------
curl -X POST localhost:8081/v1/projects/<project-id>:import -H "Content-Type: application/json" -d "{\"input_url\":\"C:/Users/<user>/Desktop/Data/file.overall_export_metadata\"}"


Returns ->
{"error":{"code":400,"message":"Failed to parse overall export metadata file","status":"INVALID_ARGUMENT"}}

Import error is due to the absence of the exported file.


Please help!

George (Cloud Platform Support)

unread,
Nov 1, 2019, 3:25:35 PM11/1/19
to Google App Engine
Your strings for input_url and output_url_prefix do not seem to conform to the indications and examples provided on the Exporting and importing emulator data page. In particular, your use of escaping "/" is understandable, but not required in this case. Does it make any difference if you simply enclose the string in double quotes, as exemplified on that page? 

Nikitha Kamath

unread,
Nov 2, 2019, 1:47:27 PM11/2/19
to Google App Engine
If escaping "/" is removed then it returns the below error, since I'm using Windows.

{"error":{"code":400,"message":"Payload isn't valid for request.","status":"INVALID_ARGUMENT"}}

George (Cloud Platform Support)

unread,
Nov 4, 2019, 12:05:18 PM11/4/19
to Google App Engine
The API documentation page referred to in my initial answer indicates single quotes after -d, --data parameter. I have mistakenly indicates double quotes. What is the result of running the same command with single quotes after -d? A relevant copy of your curl command would be appreciated, in reply. 

Ohm Patel

unread,
Nov 14, 2019, 11:45:54 AM11/14/19
to Google App Engine
Hey,

I am facing the same issues while importing my cloud bucket data from local to emulator. I am using the command :- 

curl -X POST localhost:23868/v1/projects/<project-id>:import -H 'Content-Type: application/json' -d '{"input_url":"<path-to-overall_export_metadata>.overall_export_metadata"}'

The error message I am getting is 

{"error":{"code":400,"message":"Failed to parse overall export metadata file","status":"INVALID_ARGUMENT"}}


Please suggest me if anything.

Please consider the environment before printing this mail

The information contained in this e-mail is private & confidential and may also be legally privileged. If you are not the intended recipient of this mail, please notify us, preferably by e-mail; and do not read, copy or disclose the contents of this message to anyone. Whilst we have taken reasonable precautions to ensure that any attachment to this e-mail has been swept for viruses, e-mail communications cannot be guaranteed to be secure or error free, as information can be corrupted, intercepted, lost or contain viruses. We do not accept liability for such matter or their consequences

Elliott (Cloud Platform Support)

unread,
Nov 14, 2019, 10:28:01 PM11/14/19
to Google App Engine

Hello Ohm,


Please note that Google Groups are reserved for general Google Cloud Platform and product discussions and not for reporting issues, which is why I suggest moving the troubleshooting to Issue Tracker, where issues can be turned private in case we need to gather any project specific details.


Reply all
Reply to author
Forward
0 new messages