GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Spanner node.js client used with GCP Functions generates errors when GCP Function is cold · Issue #2489 · googleapis/google-cloud-node

Spanner node.js client used with GCP Functions generates errors when GCP Function is cold #2489

New issue
Copy link
New issue
Copy link
Closed
Closed
Spanner node.js client used with GCP Functions generates errors when GCP Function is cold#2489
Copy link
Labels
api: spannerIssues related to the Spanner API.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Description

@ghost
ghost
opened on Jul 24, 2017

Environment details

  • OS: GCP Functions
  • Node.js version: GCP Functions
  • npm version: 5.0.3
  • google-cloud-node version: google-cloud/spanner 0.7.1

Steps to reproduce

  1. Deploy a GCP Function that uses the Spanner node.js client to run transactions against a Spanner database
  2. Invoke the function and ensure that the function correctly issues the transaction
  3. Wait for 10 min or so and invoke the function and an error occurs
  4. Immediately invoke the function again and the function correctly issues the transaction

I am initializing the JS client using these instructions i.e. no special config options:
"https://cloud.google.com/spanner/docs/getting-started/nodejs/"

The errors are:
database.run
Error: Endpoint read failed","error_code":14,"query":"SELECT
Error: Session not found: projects/REDACTED/instances/lc-data/databases/lc-data-uat/sessions/AFZejKDAPJhREDACTEDYnFRwi7iMjT0_","error_code":5,"query":"SELECT

database.runTransaction
Error: Endpoint read failed","error_code":14
connection error'"

Activity

  1. stephenplusplus commented on Jul 24, 2017

    @stephenplusplus
    stephenplusplus
    on Jul 24, 2017
    Contributor
    More actions

    I believe this is a duplicate of #2438, which I see you've posted in. I mean duplicate in the sense that a resolution to that will also resolve this. I'm going to close under that assumption, but please let me know if I'm mistaken and we will re-open.

  2. stephenplusplus
    marked this as a duplicate of Error: Endpoint read failed at /user_code/node_modules/@google-cloud/logging/node_modules/grpc/src/node/src/client.js:569:15 #2438 on Jul 24, 2017
  3. stephenplusplus
    closed this as completedon Jul 24, 2017
  4. stephenplusplus
    added
    api: spannerIssues related to the Spanner API.
    on Jul 24, 2017
  5. stephenplusplus
    reopened this on Jul 25, 2017
  6. stephenplusplus commented on Jul 25, 2017

    @stephenplusplus
    stephenplusplus
    on Jul 25, 2017
    Contributor
    More actions

    I'll re-open and maybe @vkedia / @callmehiphop can weigh in.

  7. callmehiphop commented on Jul 25, 2017

    @callmehiphop
    callmehiphop
    on Jul 25, 2017
    Contributor
    More actions

    We have an open issue for the Session not found (#2061). However if you're redeploying, I don't think it would use sessions from an earlier deployment.

    I haven't seen any errors involving re-creating databases, could you post any error messages you get when trying to do so?

  8. vkedia commented on Jul 25, 2017

    @vkedia
    vkedia
    on Jul 25, 2017
    Contributor
    More actions

    When the GCP function is invoked multiple times does it recreate the spanner client each time (specifically the instance object) or can it reuse them?
    Also note that when a database is deleted all its sessions get invalidated. A general advise will be to redeploy your code in that case.

  9. landrito
    added
    priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.
    status: acknowledged
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    on Aug 7, 2017
  10. landrito commented on Aug 7, 2017

    @landrito
    landrito
    on Aug 7, 2017
    Contributor
    More actions

    I still get the occasional 'connection error' after the function has been cold for along time but only in a function that runs several inserts in a transaction

    @vkedia Do you have an idea what could be causing this to happen?

  11. landrito
    assigned
    vkedia
    on Aug 7, 2017
  12. lukesneeringer commented on Aug 8, 2017

    @lukesneeringer
    lukesneeringer
    on Aug 8, 2017
    Contributor
    More actions

    @landrito If I understand correctly from a skim, essentially the issue is that the client object is being shared between different GCF instances, but since network connections do not work that way (you can not serialize a connection and send it across the wire), you end up in a wonky state.

    The fix is to either not permit client objects to be serialized and shared (like what Python does) or to ensure that the connection object is dropped on serialization and able to be reinitialized on reload.

  13. lukesneeringer
    unassigned
    vkedia
    on Aug 8, 2017
  14. lukesneeringer commented on Oct 27, 2017

    @lukesneeringer
    lukesneeringer
    on Oct 27, 2017
    Contributor
    More actions

    This issue was moved to googleapis/nodejs-spanner#20

  15. lukesneeringer
    closed this as completedon Oct 27, 2017
  16. lc-chrisbarton commented on Nov 8, 2017

    @lc-chrisbarton
    lc-chrisbarton
    on Nov 8, 2017
    More actions

    @stephenplusplus I have pinned to version 0.14.0 of the PubSub client library and this issue does not occur so somewhere between that version and 0.14.5 CloudFunction support has broken. BTW issue #2438/#2489 are > 3 months old and PubSub was working a month ago so this may or may not be related.

  17. googleapis
    locked and limited conversation to collaborators on Nov 8, 2017
  18. stephenplusplus commented on Nov 8, 2017

    @stephenplusplus
    stephenplusplus
    on Nov 8, 2017
    Contributor
    More actions

    Locking the issue just to make sure we funnel all useful info to one place (#2438).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    api: spannerIssues related to the Spanner API.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.