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

REST transport: callback is not a function #1423

Closed
alexander-fenster opened this issue Feb 4, 2023 · 6 comments · Fixed by #1431
Closed

REST transport: callback is not a function #1423

alexander-fenster opened this issue Feb 4, 2023 · 6 comments · Fixed by #1431
Assignees
Labels
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

@alexander-fenster
Copy link
Member

Reported in firebase/firebase-admin-node#1901:

TypeError: callback is not a function
at /workspace/node_modules/google-gax/build/src/fallbackServiceStub.js:119:33
Function execution took 564 ms, finished with status: 'connection error'
@alexander-fenster alexander-fenster 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 Feb 4, 2023
@alexander-fenster alexander-fenster self-assigned this Feb 4, 2023
@iAMkVIN-S
Copy link

We recently had to start using preferRest after having issues without it where firebase-admin would crash very often.

We made the changes on February 1st and have not crashed since. However, tonight we received reports of crashing happening again, and upon looking through the logs it seems like we have the same error as posted by @alexander-fenster:

Mar 08 22:38:35 /app/node_modules/google-gax/build/src/fallbackServiceStub.js:119
Mar 08 22:38:35 .catch((err) => callback(err));
Mar 08 22:38:35 ^
Mar 08 22:38:35
Mar 08 22:38:35 TypeError: callback is not a function
Mar 08 22:38:35 at /app/node_modules/google-gax/build/src/fallbackServiceStub.js:119:33
Mar 08 22:38:35 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Mar 08 22:38:35
Mar 08 22:38:35 Node.js v18.14.2
Mar 08 22:38:37 running on port 3002

This is super crucial and crashing often, please advise ASAP

@alexander-fenster
Copy link
Member Author

I'm looking.

@alexander-fenster
Copy link
Member Author

@iAMkVIN-S I'm sending a fix for this. Please note that the bug is in the way how the error is reported (it tries to call a nonexistent callback instead of emitting an error to a stream), but it still means that some error is there. After this is merged and released, you'll get a chance to see what error is there, but the error is definitely there! It might be a network problem, a permission or quota problem, or anything like that.

@iAMkVIN-S
Copy link

Hey @alexander-fenster,👋

Thank you for the prompt reply.

A few follow up questions on that:

A) What is the normal turn around time for minor issues to be merged and released?

B) Although you state that we'll now see the real error behind the crash, that error itself shouldn't crash the backend, right? It's only crashing now because of the nonexistent callback?

We'll monitor this ASAP to see if it's an error we can prevent, once we see what it is. Considering our code has not changed, it must have been a non crucial error that normally passed unattended, and since a recent release of the SDK, it's only now causing a crash.

@alexander-fenster
Copy link
Member Author

A) I expect it to go out today as a patch version, so whenever you redeploy / rerun npm install after it's released, you'll get it. I'll post an update in this issue.

B) Correct, the error will be passed up to the caller level. At this point I believe that it can only happen with the streaming call; since you're using Firestore, it might handle the streaming error in different ways (I'm not sure without looking at their code), ultimately, it might throw, but you will see it (and you'll be able to catch it).

@alexander-fenster
Copy link
Member Author

@iAMkVIN-S I just published v3.5.8, please reinstall your dependencies. If it starts showing another error and the reason is not obvious, please come back here (feel free to submit a new issue here or in Firestore library, depending on what type of error you get :) )

I receive a lot of GitHub notifications (more than I can realistically process), so please feel free to ping me by email if you need faster response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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