Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

With gcd.sh local (gcd-rpc 1.0.0) errors always #1236

Closed
susanlinsfu opened this issue Apr 15, 2016 · 18 comments
Closed

With gcd.sh local (gcd-rpc 1.0.0) errors always #1236

susanlinsfu opened this issue Apr 15, 2016 · 18 comments
Assignees
Labels
api: datastore Issues related to the Datastore API.

Comments

@susanlinsfu
Copy link

I am using gcloud-node v.0.30.3 and since it doesn't support gRPC I am using gcd-rpc for my local datastore. This is only occurring on windows (gcd.cmd). I run some operation it always returns 'No connection could be made because the target machine actively refused it". The strange thing though is it completes the operation always. The error shows, but if I have some console output it always shows and if I get entities it will display the entities in the console.

@stephenplusplus
Copy link
Contributor

cc @pcostell

@pcostell
Copy link
Contributor

Can you share the exact output of the error messages, both on the client and on the emulator output.

@susanlinsfu
Copy link
Author

susanlinsfu commented Apr 15, 2016

On the gcd when I make a request:

C:\Users\susan\Downloads\gcd-grpc-1.0.0\gcd>gcd.cmd start mydatadir
Apr 15, 2016 2:47:34 PM com.google.appengine.api.datastore.dev.LocalDatastoreService init
INFO: Local Datastore initialized:
Type: High Replication
Storage: C:\Users\susan\Downloads\gcd-grpc-1.0.0\gcd\mydatadir\WEB-INF\appengine-generated\local_db.bin
Apr 15, 2016 2:47:34 PM io.grpc.internal.ManagedChannelImpl
INFO: [ManagedChannelImpl@5c18298f] Created with target localhost:8080
Apr 15, 2016 2:47:34 PM com.google.appengine.api.datastore.dev.LocalDatastoreService load
INFO: Time to load datastore: 19 ms
Apr 15, 2016 2:47:34 PM io.gapi.emulators.netty.NettyUtil applyJava7LongHostnameWorkaround
INFO: Applied Java 7 long hostname workaround.
Apr 15, 2016 2:47:34 PM io.netty.channel.DefaultChannelId
WARNING: -Dio.netty.processId: self (malformed)
API endpoint: http://localhost:8080/datastore
If you are using a library that supports the DATASTORE_EMULATOR_HOST environment variable, run:

export DATASTORE_EMULATOR_HOST=localhost:8080

Apr 15, 2016 2:48:09 PM io.gapi.emulators.grpc.GrpcServer$3 operationComplete
INFO: Adding handler(s) to newly registered Channel.
Apr 15, 2016 2:48:09 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
INFO: Detected HTTP/2 connection.
Apr 15, 2016 2:48:09 PM io.gapi.emulators.grpc.GrpcServer$3 operationComplete
INFO: Adding handler(s) to newly registered Channel.
Apr 15, 2016 2:48:09 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
INFO: Detected HTTP/2 connection.

On my nodejs console all that is outputted is:

E0415 14:48:09.553000000 7796 tcp_client_windows.c:106] on_connect error: No connection could be made because the target machine actively refused it.

@zlepper
Copy link

zlepper commented Apr 16, 2016

I have the same issue, expect i'm using the default gcloud beta emulators datastore start command to start the emulator.

This is the output from the datastore starting:

C:\Users\Rasmus>gcloud beta emulators datastore start
WARNING: Reusing existing data in [C:\Users\Rasmus\AppData\Roaming\gcloud\emulators\da
tastore].
Executing: cmd /c F:\Users\Rasmus\AppData\Local\Google\Cloud SDK\google-cloud-sdk\plat
form\gcd\gcd.cmd start --host=localhost --port=8999 --store_on_disk=True --consistency
=0.9 --allow_remote_shutdown C:\Users\Rasmus\AppData\Roaming\gcloud\emulators\datastor
e
[datastore] API endpoint: http://localhost:8999/datastore
[datastore] If you are using a library that supports the DATASTORE_LOCAL_HOST environm
ent variable, run:
[datastore]
[datastore]   export DATASTORE_LOCAL_HOST=localhost:8999
[datastore]
[datastore] Invoking dev_appserver with args: [--disable_update_check --jvm_flag=-Doau
th.is_admin=true --property=datastore.index_configuration_format=yaml --port=8999 --ad
dress=localhost --property=datastore.force_is_high_replication=true --property=datasto
re.default_high_rep_job_policy_unapplied_job_pct=10.0 --allow_remote_shutdown C:\Users
\Rasmus\AppData\Roaming\gcloud\emulators\datastore].
[datastore] Executing [C:\Program Files\Java\jre1.8.0_51\bin\java, -Doauth.is_admin=tr
ue, -javaagent:F:\Users\Rasmus\AppData\Local\Google\Cloud SDK\google-cloud-sdk\platfor
m\gcd\.appengine\lib\agent\appengine-agent.jar, -Xbootclasspath/p:F:\Users\Rasmus\AppD
ata\Local\Google\Cloud SDK\google-cloud-sdk\platform\gcd\.appengine\lib\override\appen
gine-dev-jdk-overrides.jar, -classpath, F:\Users\Rasmus\AppData\Local\Google\Cloud SDK
\google-cloud-sdk\platform\gcd\CloudDatastore.jar;F:\Users\Rasmus\AppData\Local\Google
\Cloud SDK\google-cloud-sdk\platform\gcd\.appengine\lib\impl\appengine-api.jar;F:\User
s\Rasmus\AppData\Local\Google\Cloud SDK\google-cloud-sdk\platform\gcd\.appengine\lib\a
ppengine-tools-api.jar;F:\Users\Rasmus\AppData\Local\Google\Cloud SDK\google-cloud-sdk
\platform\gcd\.appengine\lib\impl\appengine-api-stubs.jar, com.google.appengine.tools.
development.DevAppServerMain, --property=kickstart.user.dir=C:\Users\Rasmus, --disable
_update_check, --property=datastore.index_configuration_format=yaml, --port=8999, --ad
dress=localhost, --property=datastore.force_is_high_replication=true, --property=datas
tore.default_high_rep_job_policy_unapplied_job_pct=10.0, --allow_remote_shutdown, C:\U
sers\Rasmus\AppData\Roaming\gcloud\emulators\datastore]
[datastore] Apr 16, 2016 9:08:22 AM java.util.prefs.WindowsPreferences <init>
[datastore] WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at
root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
[datastore] Apr 16, 2016 9:08:23 AM com.google.apphosting.utils.jetty.JettyLogger info

[datastore] INFO: Logging to JettyLogger(null) via com.google.apphosting.utils.jetty.J
ettyLogger
[datastore] Apr 16, 2016 9:08:23 AM com.google.apphosting.utils.jetty.JettyLogger info

[datastore] INFO: jetty-6.1.x
[datastore] Apr 16, 2016 9:08:24 AM com.google.apphosting.utils.jetty.JettyLogger info

[datastore] INFO: Started SelectChannelConnector@localhost:8999
[datastore] Apr 16, 2016 9:08:24 AM com.google.appengine.tools.development.AbstractMod
ule startup
[datastore] INFO: Module instance default is running at http://localhost:8999/
[datastore] Apr 16, 2016 9:08:24 AM com.google.appengine.tools.development.AbstractMod
ule startup
[datastore] INFO: The admin console is running at http://localhost:8999/_ah/admin
[datastore] Apr 16, 2016 9:08:24 AM com.google.appengine.tools.development.DevAppServe
rImpl doStart
[datastore] INFO: Dev App Server is now running

The admin interface can be accessed without issues, so I'm pretty sure the datastore emulator is fine.

@susanlinsfu
Copy link
Author

susanlinsfu commented Apr 16, 2016

@zlepper I believe the gcloud emulator doesn't support gRPC, hence we can't use the gcloud emulator and must use the gcd tool.

Additionally, we are now using gRPC to give a performance boost to your Datastore calls. As of now, the gcloud SDK does not have a gRPC emulator, meaning if you wish to use a localhost backend instead of the upstream API, you will have to use the gcd.sh tool directly.

https://github.com/GoogleCloudPlatform/gcloud-node/releases/tag/v0.30.0

Please keep in mind there is no admin console with the gcd tool .

@stephenplusplus stephenplusplus added the api: datastore Issues related to the Datastore API. label Apr 16, 2016
@zlepper
Copy link

zlepper commented Apr 16, 2016

@susanlinsfu internally it seems to call the same cmd file as your command do?

And shouldn't the node docs then be updated to reflect the proper way to use gcloud-node with the datastore emulator?

@stephenplusplus
Copy link
Contributor

@zlepper as the release notes say, this is a temporary workaround as the Datastore emulator from inside the gcloud SDK does not support gRPC. Do we have docs that say how to use the emulator currently? We could leave a note there about the workaround. I haven't received any time line for when the SDK emulator will support gRPC.

@zlepper
Copy link

zlepper commented Apr 16, 2016

There is a note about how to specify an api endpoint, which is pretty much using the datastore emulator, as far as I know.
The datastore emulator docs themselves https://cloud.google.com/datastore/docs/tools/datastore-emulator do not say anything about how to connect with any service.

And I just (a couple of days ago) started using gcloud, so I missed the release note when I was searching around for this issue originally.

@zlepper
Copy link

zlepper commented Apr 16, 2016

Switching to use the gdc.cmd tool directly, as provided in the link on the release page, this happens:
From the gdc prompt:

C:\Users\Rasmus\Desktop\gcd-grpc-1.0.0\gcd>gcd.cmd start class-help
Apr 16, 2016 10:28:14 PM com.google.appengine.api.datastore.dev.LocalDatastoreService init
INFO: Local Datastore initialized:
        Type: High Replication
        Storage: C:\Users\Rasmus\Desktop\gcd-grpc-1.0.0\gcd\class-help\WEB-INF\appengine-generated\local_db.bin
Apr 16, 2016 10:28:14 PM io.grpc.internal.ManagedChannelImpl <init>
INFO: [ManagedChannelImpl@3b94d659] Created with target localhost:8080
Apr 16, 2016 10:28:14 PM com.google.appengine.api.datastore.dev.LocalDatastoreService load
INFO: The backing store, C:\Users\Rasmus\Desktop\gcd-grpc-1.0.0\gcd\class-help\WEB-INF\appengine-generated\local_db.bin, does not exist. It will be created.
Apr 16, 2016 10:28:14 PM io.gapi.emulators.netty.NettyUtil applyJava7LongHostnameWorkaround
INFO: Applied Java 7 long hostname workaround.
Apr 16, 2016 10:28:14 PM io.netty.channel.DefaultChannelId <clinit>
WARNING: -Dio.netty.processId: self (malformed)
API endpoint: http://localhost:8080/datastore
If you are using a library that supports the DATASTORE_EMULATOR_HOST environment variable, run:

  export DATASTORE_EMULATOR_HOST=localhost:8080

Apr 16, 2016 10:28:25 PM io.gapi.emulators.grpc.GrpcServer$3 operationComplete
INFO: Adding handler(s) to newly registered Channel.
Apr 16, 2016 10:28:25 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
INFO: Detected HTTP/2 connection.
Apr 16, 2016 10:28:25 PM io.gapi.emulators.grpc.GrpcServer$3 operationComplete
INFO: Adding handler(s) to newly registered Channel.
Apr 16, 2016 10:28:25 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
INFO: Detected HTTP/2 connection.
Apr 16, 2016 10:28:26 PM io.grpc.netty.NettyServerHandler onConnectionError
WARNING: Connection Error
io.netty.handler.codec.http2.Http2Exception: An existing connection was forcibly closed by the remote host
        at io.netty.handler.codec.http2.Http2Exception.connectionError(Http2Exception.java:96)
        at io.grpc.netty.AbstractNettyHandler.exceptionCaught(AbstractNettyHandler.java:90)
        at io.netty.channel.ChannelHandlerInvokerUtil.invokeExceptionCaughtNow(ChannelHandlerInvokerUtil.java:64)
        at io.netty.channel.DefaultChannelHandlerInvoker.invokeExceptionCaught(DefaultChannelHandlerInvoker.java:111)
        at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:346)
        at io.netty.channel.AbstractChannelHandlerContext.fireExceptionCaught(AbstractChannelHandlerContext.java:131)
        at io.netty.channel.ChannelInboundHandlerAdapter.exceptionCaught(ChannelInboundHandlerAdapter.java:131)
        at io.netty.channel.ChannelHandlerInvokerUtil.invokeExceptionCaughtNow(ChannelHandlerInvokerUtil.java:64)
        at io.netty.channel.DefaultChannelHandlerInvoker.invokeExceptionCaught(DefaultChannelHandlerInvoker.java:111)
        at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:346)
        at io.netty.channel.AbstractChannelHandlerContext.fireExceptionCaught(AbstractChannelHandlerContext.java:131)
        at io.netty.handler.logging.LoggingHandler.exceptionCaught(LoggingHandler.java:175)
        at io.netty.channel.ChannelHandlerInvokerUtil.invokeExceptionCaughtNow(ChannelHandlerInvokerUtil.java:64)
        at io.netty.channel.DefaultChannelHandlerInvoker.invokeExceptionCaught(DefaultChannelHandlerInvoker.java:111)
        at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:346)
        at io.netty.channel.AbstractChannelHandlerContext.fireExceptionCaught(AbstractChannelHandlerContext.java:131)
        at io.netty.channel.DefaultChannelPipeline.fireExceptionCaught(DefaultChannelPipeline.java:1066)
        at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.handleReadException(AbstractNioByteChannel.java:87)
        at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:136)
        at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:510)
        at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:467)
        at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:381)
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:353)
        at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:742)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: An existing connection was forcibly closed by the remote host
        at sun.nio.ch.SocketDispatcher.read0(Native Method)
        at sun.nio.ch.SocketDispatcher.read(Unknown Source)
        at sun.nio.ch.IOUtil.readIntoNativeBuffer(Unknown Source)
        at sun.nio.ch.IOUtil.read(Unknown Source)
        at sun.nio.ch.SocketChannelImpl.read(Unknown Source)
        at io.netty.buffer.PooledUnsafeDirectByteBuf.setBytes(PooledUnsafeDirectByteBuf.java:288)
        at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1055)
        at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:245)
        at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:112)
        ... 8 more

Apr 16, 2016 10:28:26 PM io.grpc.netty.NettyServerTransport notifyTerminated
SEVERE: Transport failed
io.netty.handler.codec.http2.Http2Exception: An existing connection was forcibly closed by the remote host
        at io.netty.handler.codec.http2.Http2Exception.connectionError(Http2Exception.java:96)
        at io.grpc.netty.AbstractNettyHandler.exceptionCaught(AbstractNettyHandler.java:90)
        at io.netty.channel.ChannelHandlerInvokerUtil.invokeExceptionCaughtNow(ChannelHandlerInvokerUtil.java:64)
        at io.netty.channel.DefaultChannelHandlerInvoker.invokeExceptionCaught(DefaultChannelHandlerInvoker.java:111)
        at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:346)
        at io.netty.channel.AbstractChannelHandlerContext.fireExceptionCaught(AbstractChannelHandlerContext.java:131)
        at io.netty.channel.ChannelInboundHandlerAdapter.exceptionCaught(ChannelInboundHandlerAdapter.java:131)
        at io.netty.channel.ChannelHandlerInvokerUtil.invokeExceptionCaughtNow(ChannelHandlerInvokerUtil.java:64)
        at io.netty.channel.DefaultChannelHandlerInvoker.invokeExceptionCaught(DefaultChannelHandlerInvoker.java:111)
        at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:346)
        at io.netty.channel.AbstractChannelHandlerContext.fireExceptionCaught(AbstractChannelHandlerContext.java:131)
        at io.netty.handler.logging.LoggingHandler.exceptionCaught(LoggingHandler.java:175)
        at io.netty.channel.ChannelHandlerInvokerUtil.invokeExceptionCaughtNow(ChannelHandlerInvokerUtil.java:64)
        at io.netty.channel.DefaultChannelHandlerInvoker.invokeExceptionCaught(DefaultChannelHandlerInvoker.java:111)
        at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:346)
        at io.netty.channel.AbstractChannelHandlerContext.fireExceptionCaught(AbstractChannelHandlerContext.java:131)
        at io.netty.channel.DefaultChannelPipeline.fireExceptionCaught(DefaultChannelPipeline.java:1066)
        at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.handleReadException(AbstractNioByteChannel.java:87)
        at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:136)
        at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:510)
        at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:467)
        at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:381)
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:353)
        at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:742)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: An existing connection was forcibly closed by the remote host
        at sun.nio.ch.SocketDispatcher.read0(Native Method)
        at sun.nio.ch.SocketDispatcher.read(Unknown Source)
        at sun.nio.ch.IOUtil.readIntoNativeBuffer(Unknown Source)
        at sun.nio.ch.IOUtil.read(Unknown Source)
        at sun.nio.ch.SocketChannelImpl.read(Unknown Source)
        at io.netty.buffer.PooledUnsafeDirectByteBuf.setBytes(PooledUnsafeDirectByteBuf.java:288)
        at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1055)
        at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:245)
        at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:112)
        ... 8 more

Apr 16, 2016 10:28:26 PM io.netty.handler.codec.http2.Http2ConnectionHandler processGoAwayWriteResult
WARNING: [id: 0x89ca66d8, L:0.0.0.0/0.0.0.0:8080 ! R:/127.0.0.1:53229] Sending GOAWAY failed: lastStreamId '579', errorCode '2', debugData 'An existing connec
tion was forcibly closed by the remote host'. Forcing shutdown of the connection.
java.io.IOException: An existing connection was forcibly closed by the remote host
        at sun.nio.ch.SocketDispatcher.writev0(Native Method)
        at sun.nio.ch.SocketDispatcher.writev(Unknown Source)
        at sun.nio.ch.IOUtil.write(Unknown Source)
        at sun.nio.ch.SocketChannelImpl.write(Unknown Source)
        at io.netty.channel.socket.nio.NioSocketChannel.doWrite(NioSocketChannel.java:305)
        at io.netty.channel.AbstractChannel$AbstractUnsafe.flush0(AbstractChannel.java:839)
        at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.flush0(AbstractNioChannel.java:311)
        at io.netty.channel.AbstractChannel$AbstractUnsafe.flush(AbstractChannel.java:806)
        at io.netty.channel.DefaultChannelPipeline$HeadContext.flush(DefaultChannelPipeline.java:1436)
        at io.netty.channel.ChannelHandlerInvokerUtil.invokeFlushNow(ChannelHandlerInvokerUtil.java:165)
        at io.netty.channel.DefaultChannelHandlerInvoker.invokeFlush(DefaultChannelHandlerInvoker.java:347)
        at io.netty.channel.AbstractChannelHandlerContext.invokeFlush(AbstractChannelHandlerContext.java:395)
        at io.netty.channel.AbstractChannelHandlerContext.flush(AbstractChannelHandlerContext.java:259)
        at io.netty.handler.logging.LoggingHandler.flush(LoggingHandler.java:249)
        at io.netty.channel.ChannelHandlerInvokerUtil.invokeFlushNow(ChannelHandlerInvokerUtil.java:165)
        at io.netty.channel.DefaultChannelHandlerInvoker.invokeFlush(DefaultChannelHandlerInvoker.java:347)
        at io.netty.channel.AbstractChannelHandlerContext.invokeFlush(AbstractChannelHandlerContext.java:395)
        at io.netty.channel.AbstractChannelHandlerContext.flush(AbstractChannelHandlerContext.java:259)
        at io.netty.channel.ChannelDuplexHandler.flush(ChannelDuplexHandler.java:117)
        at io.netty.channel.ChannelHandlerInvokerUtil.invokeFlushNow(ChannelHandlerInvokerUtil.java:165)
        at io.netty.channel.DefaultChannelHandlerInvoker.invokeFlush(DefaultChannelHandlerInvoker.java:347)
        at io.netty.channel.AbstractChannelHandlerContext.invokeFlush(AbstractChannelHandlerContext.java:395)
        at io.netty.channel.AbstractChannelHandlerContext.flush(AbstractChannelHandlerContext.java:259)
        at io.netty.handler.codec.http2.Http2ConnectionHandler.onError(Http2ConnectionHandler.java:546)
        at io.netty.handler.codec.http2.Http2ConnectionHandler.exceptionCaught(Http2ConnectionHandler.java:468)
        at io.grpc.netty.AbstractNettyHandler.exceptionCaught(AbstractNettyHandler.java:92)
        at io.netty.channel.ChannelHandlerInvokerUtil.invokeExceptionCaughtNow(ChannelHandlerInvokerUtil.java:64)
        at io.netty.channel.DefaultChannelHandlerInvoker.invokeExceptionCaught(DefaultChannelHandlerInvoker.java:111)
        at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:346)
        at io.netty.channel.AbstractChannelHandlerContext.fireExceptionCaught(AbstractChannelHandlerContext.java:131)
        at io.netty.channel.ChannelInboundHandlerAdapter.exceptionCaught(ChannelInboundHandlerAdapter.java:131)
        at io.netty.channel.ChannelHandlerInvokerUtil.invokeExceptionCaughtNow(ChannelHandlerInvokerUtil.java:64)
        at io.netty.channel.DefaultChannelHandlerInvoker.invokeExceptionCaught(DefaultChannelHandlerInvoker.java:111)
        at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:346)
        at io.netty.channel.AbstractChannelHandlerContext.fireExceptionCaught(AbstractChannelHandlerContext.java:131)
        at io.netty.handler.logging.LoggingHandler.exceptionCaught(LoggingHandler.java:175)
        at io.netty.channel.ChannelHandlerInvokerUtil.invokeExceptionCaughtNow(ChannelHandlerInvokerUtil.java:64)
        at io.netty.channel.DefaultChannelHandlerInvoker.invokeExceptionCaught(DefaultChannelHandlerInvoker.java:111)
        at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:346)
        at io.netty.channel.AbstractChannelHandlerContext.fireExceptionCaught(AbstractChannelHandlerContext.java:131)
        at io.netty.channel.DefaultChannelPipeline.fireExceptionCaught(DefaultChannelPipeline.java:1066)
        at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.handleReadException(AbstractNioByteChannel.java:87)
        at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:136)
        at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:510)
        at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:467)
        at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:381)
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:353)
        at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:742)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

And this is the output in my node terminal:

E0416 22:28:25.682000000  7568 tcp_client_windows.c:106] on_connect error: No connection could be made because the target machine actively refused it.

@stephenplusplus
Copy link
Contributor

@zlepper thanks for pointing that out. I have a PR that will do a better job of explaining: #1231

As for the issues with the output, I have to deflect to @pcostell on what these might mean.

@pcostell
Copy link
Contributor

Yikes, those are some gnarly stack traces. Can you share your gcloud-node code that you are running so I can try to reproduce it?

@sebelga
Copy link
Contributor

sebelga commented Apr 18, 2016

Just sharing a few things I realised to make it work (here on OS X):

  • Check that you don't have anything running on port 8080 (I had Jenkins running without noticing and was blocking all the calls to the gcd)... arg! :)
  • Had to start the command with Admin privilege (sudo) (although the local folder is in Home directory)
  • the Api endpoint is "http://localhost:8080" although the gcd console says API endpoint: http://localhost:8080/datastore

@zlepper
Copy link

zlepper commented Apr 19, 2016

@pcostell Datastore setup code: https://gist.github.com/zlepper/59c7b11d60c86bb9cd199c5162b9733d
And the error happens whenever I try to make a query to the datastore.

@sebelga
Copy link
Contributor

sebelga commented Apr 19, 2016

You need to set the apiPoint inside the datastore() instantiation.
Like this:

var gc = gcloud(options);  // remove apiPoint from your options object
var datastore = gc.datastore({
    apiEndpoint: 'http://localhost:8080'
});

@stephenplusplus
Copy link
Contributor

@sebelga if you set the env var, you don't need to use apiEndpoint:

If you are using a library that supports the DATASTORE_EMULATOR_HOST environment variable, run:

  export DATASTORE_EMULATOR_HOST=localhost:8080

@pcostell should I move this issue over to google-cloud-datastore?

@zlepper
Copy link

zlepper commented Apr 19, 2016

@sebelga Settings the apiEndpoint on the datastoreOptions instead did not help.

@stephenplusplus Only settings the env var and not specifying the apiEndpoint at all did not help either. Gives the same error as I mentioned with the stacktrace earlier.

@stephenplusplus
Copy link
Contributor

This issue was moved to googleapis/google-cloud-datastore#110

@stephenplusplus
Copy link
Contributor

Yeah, I don't know if that will fix the error, but it should be all you need from the standpoint of connecting to the emulator with gcloud-node. I'm going to move this issue over to that other repo, hopefully getting some more eyes on the problem. Of course, if it turns out to be an issue with this library, we will re-investigate from this end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: datastore Issues related to the Datastore API.
Projects
None yet
Development

No branches or pull requests

5 participants