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

Error querying Spanner: Error: Stream removed #76

Closed
bricktownseo opened this issue Dec 19, 2017 · 2 comments
Closed

Error querying Spanner: Error: Stream removed #76

bricktownseo opened this issue Dec 19, 2017 · 2 comments
Assignees
Labels
api: spanner Issues related to the googleapis/nodejs-spanner API. 🚨 This issue needs some love. triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@bricktownseo
Copy link

bricktownseo commented Dec 19, 2017

Environment details

  • OS: Cloud Function
  • @google-cloud/spanner version: 0.10.0

Steps to reproduce

  1. Downloaded the example spanner cloud function code
  2. Modify the package.json to use version 0.10.0 of spanner
  3. Deploy to cloud function and test
  4. After >5 minutes at idle, running the cloud function on the first request causes the "Error: Stream removed" to fire. All subsequent requests execute perfectly normal.

Code from sample with modifications below.

'use strict';

const Spanner = require('@google-cloud/spanner');
const spanner = Spanner();
const instanceId = 'OUR_INSTANCE_ID';
const databaseId = 'OUR_DATABASE_ID';

exports.get = (req, res) => {
  const instance = spanner.instance(instanceId);
  const database = instance.database(databaseId);
  const query = {
    sql: 'SELECT * FROM Phones'
  };

  return database.run(query)
    .then((results) => {
      const rows = results[0].map((row) => row.toJSON());
      rows.forEach((row) => {
        res.write(`Row: ${JSON.stringify(row)}\n`);
      });
      res
        .status(200)
        .end();
    })
    .catch((err) => {
      res
        .status(500)
        .send(`Error querying Spanner: ${err}`)
        .end();
    });
};

Update: Issue also occurs on App Engine

Related to grpc/grpc-node#130

@stephenplusplus stephenplusplus added priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Dec 19, 2017
@bricktownseo
Copy link
Author

This issue also happened with version 0.9 as well.

@stephenplusplus
Copy link
Contributor

The issue is with 1.8.x of grpc. Until it is resolved, we are in the process of locking it down to 1.7.x.

(Duplicate: googleapis/nodejs-datastore#35) I'm going to close and lock, just to keep any additional reports/comments on a single issue. I'll tag your name in the other issue so you're subscribed and can track the progress.

@ghost ghost removed the priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. label Jan 2, 2018
@googleapis googleapis locked and limited conversation to collaborators Jan 2, 2018
@google-cloud-label-sync google-cloud-label-sync bot added the api: spanner Issues related to the googleapis/nodejs-spanner API. label Jan 31, 2020
@yoshi-automation yoshi-automation added 🚨 This issue needs some love. triage me I really want to be triaged. labels Apr 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api: spanner Issues related to the googleapis/nodejs-spanner API. 🚨 This issue needs some love. triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

4 participants