Not able to import entities into datastore emulator

∥☆過路亽.° 提交于 2020-05-15 06:57:25

问题


I'm trying to restore a backup of my datastore entities into the emulator running on localhost.

I'm using the guide from this location https://cloud.google.com/datastore/docs/tools/emulator-export-import This is what I have managed to do so far.

#start the emulator
gcloud beta emulators datastore start --store-on-disk --data-dir "./datastore-emulator" --project=my-project
# set the environment
$(gcloud beta emulators datastore env-init)

# initiate the restore operation
curl -X POST localhost:8081/v1/projects/my-project:import \
-H 'Content-Type: application/json' \
-d '{"input_url":"/home/bogdan/workspace/myCopy/2019-08-19-23-00/2019-08-19-23-00.overall_export_metadata"}'

at this point I can see that the emulator detected a connection and this is the log snippet

[datastore] Dev App Server is now running.
[datastore] 
[datastore] The previous line was printed for backwards compatibility only.
[datastore] If your tests rely on it to confirm emulator startup,
[datastore] please migrate to the emulator health check endpoint (/). Thank you!
[datastore] The health check endpoint for this emulator instance is http://localhost:8081/Sep 02, 2019 3:45:11 PM io.gapi.emulators.grpc.GrpcServer$3 operationComplete
[datastore] INFO: Adding handler(s) to newly registered Channel.
[datastore] Sep 02, 2019 3:45:11 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
[datastore] INFO: Detected non-HTTP/2 connection.
[datastore] Sep 02, 2019 3:45:11 PM io.gapi.emulators.grpc.GrpcServer$3 operationComplete
[datastore] INFO: Adding handler(s) to newly registered Channel.
[datastore] Sep 02, 2019 3:45:11 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
[datastore] INFO: Detected HTTP/2 connection.

and after about 5 minutes of waiting

[datastore] Exception in thread "grpc-default-executor-0" java.lang.OutOfMemoryError: GC overhead limit exceeded
[datastore]     at java.util.Collections.unmodifiableList(Collections.java:1289)
[datastore]     at com.google.storage.onestore.v3.proto2api.OnestoreEntity$Path.<init>(OnestoreEntity.java:8573)
[datastore]     at com.google.storage.onestore.v3.proto2api.OnestoreEntity$Path.<init>(OnestoreEntity.java:8504)
[datastore]     at com.google.storage.onestore.v3.proto2api.OnestoreEntity$Path$1.parsePartialFrom(OnestoreEntity.java:10145)
[datastore]     at com.google.storage.onestore.v3.proto2api.OnestoreEntity$Path$1.parsePartialFrom(OnestoreEntity.java:10133)
[datastore]     at com.google.protobuf.CodedInputStream$ArrayDecoder.readMessage(CodedInputStream.java:969)
[datastore]     at com.google.storage.onestore.v3.proto2api.OnestoreEntity$EntityProto.<init>(OnestoreEntity.java:13508)
[datastore]     at com.google.storage.onestore.v3.proto2api.OnestoreEntity$EntityProto.<init>(OnestoreEntity.java:13407)
[datastore]     at com.google.storage.onestore.v3.proto2api.OnestoreEntity$EntityProto$1.parsePartialFrom(OnestoreEntity.java:15888)
[datastore]     at com.google.storage.onestore.v3.proto2api.OnestoreEntity$EntityProto$1.parsePartialFrom(OnestoreEntity.java:15876)
[datastore]     at com.google.protobuf.AbstractParser.parsePartialFrom(AbstractParser.java:57)
[datastore]     at com.google.protobuf.AbstractParser.parsePartialFrom(AbstractParser.java:20)
[datastore]     at com.google.cloud.datastore.emulator.impl.LevelDBLogReaderChannel.readProtoMessage(LevelDBLogReaderChannel.java:65)
[datastore]     at com.google.cloud.datastore.emulator.impl.ExportImportUtil.parseEntityProtoFile(ExportImportUtil.java:157)
[datastore]     at com.google.cloud.datastore.emulator.impl.ExportImportUtil.fetchEntities(ExportImportUtil.java:59)
[datastore]     at com.google.cloud.datastore.emulator.admin.v1.DatastoreAdminV1Emulator.importEntities(DatastoreAdminV1Emulator.java:115)
[datastore]     at com.google.cloud.datastore.emulator.admin.v1.DatastoreAdminGrpcAdapter$1.importEntities(DatastoreAdminGrpcAdapter.java:55)
[datastore]     at com.google.datastore.admin.v1.DatastoreAdminGrpc$MethodHandlers.invoke(DatastoreAdminGrpc.java:1040)
[datastore]     at io.grpc.stub.ServerCalls$UnaryServerCallHandler$UnaryServerCallListener.onHalfClose(ServerCalls.java:171)
[datastore]     at io.grpc.internal.ServerCallImpl$ServerStreamListenerImpl.halfClosed(ServerCallImpl.java:283)
[datastore]     at io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$1HalfClosed.runInContext(ServerImpl.java:711)
[datastore]     at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
[datastore]     at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)
[datastore]     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[datastore]     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[datastore]     at java.lang.Thread.run(Thread.java:748)
[datastore] Sep 02, 2019 3:47:35 PM io.gapi.emulators.netty.HttpHandler$1 onError
[datastore] INFO: Exception when handling request: UNKNOWN

Also the was not database file created at ./datastore-emulator/WEB-INF/appengine-generated

来源:https://stackoverflow.com/questions/57758261/not-able-to-import-entities-into-datastore-emulator

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!