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

TypeError: Cannot read properties of undefined (reading 'insertErrors') thrown when processing errors #1272

Closed
nathantalewis opened this issue Sep 13, 2023 · 4 comments · Fixed by #1273
Labels
api: bigquery Issues related to the googleapis/nodejs-bigquery API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@nathantalewis
Copy link
Contributor

  1. Is this a client library issue or a product issue?
    A client library issue.

  2. Did someone already solve this?
    No.

  3. Do you have a support contract?
    No.

Environment details

  • OS: Ubuntu
  • Node.js version: 18.17.1
  • npm version: 9.6.7
  • @google-cloud/bigquery version: 7.2.0

Steps to reproduce

  1. Use createInputStream to create an input stream.
  2. Send rows through the stream until an TypeError: Cannot read properties of undefined (reading 'insertErrors') occurs.
@nathantalewis nathantalewis added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Sep 13, 2023
@product-auto-label product-auto-label bot added the api: bigquery Issues related to the googleapis/nodejs-bigquery API. label Sep 13, 2023
@alvarowolfx
Copy link
Contributor

Do you have some scenario that this happens ? Would be nice to add some tests to the PR #1273

@nathantalewis
Copy link
Contributor Author

I didn't dig into it too much to be honest. It seems to happen the most when we have multiple services all inserting to the same table at the same time and is hard to reproduce from just a single machine.

@nathantalewis
Copy link
Contributor Author

Here is the stack trace that we see in the logs:

TypeError: Cannot read properties of undefined (reading 'insertErrors')
    at /usr/src/app/node_modules/@google-cloud/bigquery/build/src/rowQueue.js:121:43
    at onAuthenticated (/usr/src/app/node_modules/@google-cloud/common/build/src/util.js:396:25)
    at prepareRequest (/usr/src/app/node_modules/@google-cloud/common/build/src/util.js:452:28)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)

@nathantalewis
Copy link
Contributor Author

I also see: request to https://www.googleapis.com/oauth2/v4/token failed, reason: Client network socket disconnected before secure TLS connection was established on nearby lines, so maybe that's the root error that fails to provide a resp object as expected?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/nodejs-bigquery API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants