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 — RetryRequest not handling grpc errors · Issue #2328 · googleapis/google-cloud-node

RetryRequest not handling grpc errors #2328

New issue
Copy link
New issue
Copy link
Closed
Closed
RetryRequest not handling grpc errors#2328
Copy link
Assignees
stephenplusplus
Labels
api: pubsubIssues related to the Pub/Sub API.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Description

@pkriete
pkriete
opened on May 23, 2017
Issue body actions

We've been seeing this in our logs several times a day:

TypeError: requestStream.end is not a function
    at resetStreams (/app/node_modules/retry-request/index.js:79:23)
    at retryAfterDelay (/app/node_modules/retry-request/index.js:103:7)
    at ClientReadableStream.onResponse (/app/node_modules/retry-request/index.js:115:9)
    at emitOne (events.js:96:13)
    at ClientReadableStream.emit (events.js:191:7)
    at ClientReadableStream._emitStatusIfDone (/app/node_modules/grpc/src/node/src/client.js:204:12)
    at ClientReadableStream._receiveStatus (/app/node_modules/grpc/src/node/src/client.js:180:8)
    at /app/node_modules/grpc/src/node/src/client.js:592:14

I'm not sure what triggers the underlying stream error, but emitting an error in _emitStatusIfDone does trigger it consistently.

Environment details

  • Node.js version: 7.9
  • pubsub-version: 0.11.0

Activity

  1. stephenplusplus commented on May 23, 2017

    @stephenplusplus
    stephenplusplus
    on May 23, 2017
    Contributor
    More actions

    Thanks for reporting -- do you know which Pub/Sub call is likely to be the problem one?

  2. stephenplusplus
    added
    api: pubsubIssues related to the Pub/Sub API.
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    on May 23, 2017
  3. pkriete commented on May 23, 2017

    @pkriete
    pkriete
    on May 23, 2017
    ContributorAuthor
    More actions

    Hmm, I'm afraid the logs currently don't have enough context. If anything I should add that there's a chance it's file storage, which we use as a fallback for very large pubsub payloads.

    I'll try to get a bit more context into our logs. I can say that it's happening on both sides, but it's a lot more frequent on the receiving end (we use pull). So it's unlikely to just be a single call.

  4. stephenplusplus commented on May 23, 2017

    @stephenplusplus
    stephenplusplus
    on May 23, 2017
    Contributor
    More actions

    I just put out a fix in [email protected], so it should automatically install if you update your dependencies. Thanks for the debugging information-- I think the way it is now is the way it should have been, in that it now only calls end() if it exists: googleapis/retry-request@0eb37ca

    If you still run into the issue (or side effects from this change), please let me know. Sorry for the trouble!

  5. stephenplusplus
    closed this as completedon May 23, 2017
  6. pkriete commented on May 23, 2017

    @pkriete
    pkriete
    on May 23, 2017
    ContributorAuthor
    More actions

    Awesome, we'll give it a shot, thanks for the quick fix!

    Reacted by Stephen
  7. pkriete commented on May 24, 2017

    @pkriete
    pkriete
    on May 24, 2017
    ContributorAuthor
    More actions

    So that definitely helped, but still getting occasional pubsub wonkiness that I don't believe I was seeing before, but may have been masked by the frequency of the other:

    ReferenceError: Null is not defined
        at eval (eval at __.getType (/app/node_modules/arguejs/argue.js:203:12), <anonymous>:1:1)
        at Function.__.getType (/app/node_modules/arguejs/argue.js:203:12)
        at Function.__.belongs (/app/node_modules/arguejs/argue.js:242:19)
        at __ (/app/node_modules/arguejs/argue.js:29:13)
        at Client.makeUnaryRequest [as acknowledge] (/app/node_modules/grpc/src/node/src/client.js:383:16)
        at Object.request (/app/node_modules/@google-cloud/common-grpc/src/service.js:290:39)
        at makeRequest (/app/node_modules/retry-request/index.js:97:28)
        at retryRequest (/app/node_modules/retry-request/index.js:61:3)
        at PubSub.GrpcService.request (/app/node_modules/@google-cloud/common-grpc/src/service.js:312:10)
        at PubSub.request (/app/node_modules/@google-cloud/pubsub/src/index.js:779:40)
        at Subscription.ack (/app/node_modules/@google-cloud/pubsub/src/subscription.js:468:15)
        at /app/node_modules/@google-cloud/common/src/util.js:753:22
        at Subscription.wrapper [as ack] (/app/node_modules/@google-cloud/common/src/util.js:737:12)
    

    And in case it helps / is related, we're seeing a fair amount of another error in the retryRequests library in our bigtable code:

    TypeError: Cannot read property 'pipe' of null
        at onResponse (/app/node_modules/retry-request/index.js:137:18)
        at emitOne (events.js:96:13)
        at ClientReadableStream.emit (events.js:191:7)
        at ClientReadableStream.<anonymous> (/app/node_modules/@google-cloud/common-grpc/src/service.js:395:16)
        at emitOne (events.js:96:13)
        at ClientReadableStream.emit (events.js:191:7)
        at /app/node_modules/grpc/src/node/src/client.js:580:14
    

    Happy to break either of these out into their own issue if they're unrelated, don't want to needlessly confuse this one.

  8. stephenplusplus commented on May 24, 2017

    @stephenplusplus
    stephenplusplus
    on May 24, 2017
    Contributor
    More actions

    That is very strange. Without knowing specifically what to ask-- is there anything unusual about the environment the code is in or the way the modules are installed / required? Looking at our code execution paths, it's hard to see how retry-request could end up where it is with those errors.

    It would definitely help if we could track down at least one specific call that starts the failure chain. I'll re-open this issue until we can figure out the right way to proceed.

  9. stephenplusplus
    reopened this on May 24, 2017
  10. pkriete commented on May 24, 2017

    @pkriete
    pkriete
    on May 24, 2017
    ContributorAuthor
    More actions

    Nothing unusual about the node environment. A standard docker container with node:7.9 on GKE. Modules are npm installed and loaded from node_modules.

    I did quite a bit more digging and I think I have at least found the cause of the second error. It happens frequently after an insert call on our table with a very large row (several MBs).

    That request errors, hits the numNoResponseAttempts conditional, resets the delayStream to null and starts the timer. While that timer is running the grpc metadata event fires and emits the fake successful response, which hits that line of code while retryStream is null.

  11. stephenplusplus
    added a commit that references this issue on May 24, 2017

    assign once listeners

    4b19be7
  12. stephenplusplus commented on May 24, 2017

    @stephenplusplus
    stephenplusplus
    on May 24, 2017
    Contributor
    More actions

    Thank you very much for doing that work. It sounds like this might work: googleapis/retry-request#11 -- please let me know your thoughts!

  13. stephenplusplus commented on May 25, 2017

    @stephenplusplus
    stephenplusplus
    on May 25, 2017
    Contributor
    More actions

    We seem to have found a solution over on googleapis/retry-request#11, and a new release of retry-request is out -- new and updated installs of google-cloud[/*] will pick these changes up automatically.

    @pkriete do you think we still have the other issue you mentioned (ReferenceError: Null is not defined)?

  14. pkriete commented on May 26, 2017

    @pkriete
    pkriete
    on May 26, 2017
    ContributorAuthor
    More actions

    @pkriete do you think we still have the other issue you mentioned (ReferenceError: Null is not defined)?

    Judging by the path it's taking I'd say it was probably unrelated. So likely yes, but it's fairly rare and I've never been able to reproduce it in development.

    I'm happy to call this issue resolved. Our biggest problem is gone - if I find a reproducible cause of the other one I'll open a new ticket. Thanks so much Stephen!

  15. stephenplusplus commented on May 26, 2017

    @stephenplusplus
    stephenplusplus
    on May 26, 2017
    Contributor
    More actions

    Sounds good, thanks again for all of your help!

  16. stephenplusplus
    closed this as completedon May 26, 2017
  17. JustinBeckwith
    assigned
    stephenplusplus
    on Feb 1, 2021
  18. GautamSharda
    added 2 commits that reference this issue on Dec 4, 2025

    assign once listeners

    5366a59

    chore: Retry request migration (#858)

    ee0c29a
  19. sofisl
    added 5 commits that reference this issue on Feb 24, 2026

    chore: pin @google-cloud/promisify to legacy-14 (#2328)

    0e46efb

    chore(main): release 7.3.1 (#2328)

    ae011c8

    Feat: Operation, Attempt, and GFE metrics (#2328)

    d9a8f61

    chore(main): release 8.1.0 (#2305)

    f3bd153

    chore: Retry request migration (#858)

    6dcb8a6
  20. thiyaguk09
    added a commit that references this issue on Mar 18, 2026

    chore(main): release 7.3.1 (googleapis#2328)

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

Metadata

Metadata

Assignees

  • @stephenplusplus
    stephenplusplus

Labels

api: pubsubIssues related to the Pub/Sub API.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.