Google-cloud-node: Spanner: Error: Session not found

Created on 8 Mar 2017  路  9Comments  路  Source: googleapis/google-cloud-node

Environment details

  • OS: Ubuntu 16.04 LTS
  • Node.js version: 7.7.1
  • npm version: 4.4.0
  • google-cloud-node version: {"@google-cloud/spanner": "^0.1.1"}

Steps to reproduce

  1. require @google-cloud/spanner
  2. Connect to Spanner
  3. Select an instance
  4. Select a database
  5. Select a table
  6. Call function table.read
  7. Get following error message:
Error: Session not found: projects/bt-bsp/instances/test-instance-asia/databases/test/sessions/AOJoGSnIR9eLi-hXzRBqrp0ufJKnafwK7FvtRcOo8Zn2ac1WgqUGx_IqQlbi                                                                                           
    at ClientReadableStream._emitStatusIfDone (/root/breaktime-bsp-api/node_modules/grpc/src/node/src/client.js:201:19)
    at ClientReadableStream._readsDone (/root/breaktime-bsp-api/node_modules/grpc/src/node/src/client.js:169:8)
    at readCallback (/root/breaktime-bsp-api/node_modules/grpc/src/node/src/client.js:242:12)

I tried to search this error message on Google but get nothings. I think this problem isn't make by Spanner client but happen when I use it.

Thanks!

bug spanner p2

Most helpful comment

This can happen if the session is not in use for an hour. But the client library is supposed to keep the sessions alive by periodically pinging them. So you should not see this error ideally.
@stephenplusplus @callmehiphop Can you please see if there is some bug in the keep alive implementation.

All 9 comments

This issue only happen when keep connection long time and not using.

This can happen if the session is not in use for an hour. But the client library is supposed to keep the sessions alive by periodically pinging them. So you should not see this error ideally.
@stephenplusplus @callmehiphop Can you please see if there is some bug in the keep alive implementation.

Hi - still experiencing this issue with long lived sessions. Getting the following error message:

{ Error: Session not found:
projects/aws/instances/inst/databases/db/sessions/AMQ1qflJAH4QySFTon]...
at ClientReadableStream._emitStatusIfDone 
(/usr/src/app/node_modules/grpc/src/node/src/client.js:201:19) at
ClientReadableStream._receiveStatus (/usr/src/app/node_modules/grpc/src/node/src/client.js:180:8) 
at /usr/src/app/node_modules/grpc/src/node/src/client.js:592:14

@callmehiphop is this possibly address in #2313?

@stephenplusplus @callmehiphop Any updates on this?

2313 has been merged so can this be closed or did that not fix this?

According to the docs, the keepAlive option has no default parameter. So you probably want to do something like this

const db = instance.database(databaseId, { keepAlive: 5 }); // pings Spanner every 5 minutes

Be aware not to create a new connection for each request though!

@chown9835 @stephenthoma is this still something you are seeing?

Closing this issue since #2313 should address this. Feel free to reopen if the problem persists!

Hello

We are still seeing this exact error. It seems to happen every one hour so it really fits the definition given here.
We create each connection with keepAlive option, but it does not seem to be working.
The version of the library we are using is 1.4.1
We are updating it to 2.0.0 in the near future but any help with is error will be appreciated.

Created a new issue: #2874

Thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pputhran picture pputhran  路  4Comments

VikramTiwari picture VikramTiwari  路  3Comments

nicolasgarnier picture nicolasgarnier  路  4Comments

bamapookie picture bamapookie  路  5Comments

sabrehagen picture sabrehagen  路  4Comments