-
Notifications
You must be signed in to change notification settings - Fork 203
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
Database ref from trigger throws error on firebase function emulator #726
Comments
@carrickpaul thanks for reporting this and for the clear reproduction steps, we should be able to fix this but it may require some changes in the Database SDK itself (which seems to be the source of the stack trace) |
I was able to reproduce this issue, will dig into the cause. |
Hmmm in the debugger I am seeing |
Ah this is actually a bug in the firebase-functions/src/providers/database.ts Line 307 in ffd268a
We can see that this line will produce the awkward firebase-functions/src/providers/database.ts Line 325 in ffd268a
|
Ok @carrickpaul I was able to track down this issue. Fixing it would require changes in both the Functions emulator and the Firebase Functions SDK: Functions SDK Fix: #727 |
thanks @samtstern |
The fix has been merged in to firebase/firebase-tools#2434 so this will be fixed completely in the next release of |
Thanks a bunch for the fixes posted @samtstern Even after updating both Here is a snippet of the error: ⚠ functions: Error: FIREBASE FATAL ERROR: Cannot parse Firebase url. Please use https://<YOUR FIREBASE>.firebaseio.com
at fatal (/private-code-path/functions/node_modules/@firebase/database/dist/index.node.cjs.js:341:11)
at parseRepoInfo (/private-code-path/functions/node_modules/@firebase/database/dist/index.node.cjs.js:1295:9)
at RepoManager.databaseFromApp (/private-code-path/functions/node_modules/@firebase/database/dist/index.node.cjs.js:14985:25)
at Object.initStandalone (/private-code-path/functions/node_modules/@firebase/database/dist/index.node.cjs.js:15376:45)
at DatabaseService.getDatabase (/private-code-path/functions/node_modules/firebase-admin/lib/database/database.js:67:23)
at FirebaseApp.database (/private-code-path/functions/node_modules/firebase-admin/lib/firebase-app.js:232:24)
at DataSnapshot.get ref [as ref] (/private-code-path/functions/node_modules/firebase-functions/lib/providers/database.js:293:34)
at ourFunctionName (/private-code-path/)
at process._tickCallback (internal/process/next_tick.js:68:7)
⚠ Your function was killed because it raised an unhandled error. (NOTE: Paths have been stripped to a base of Let me know if you need any more info or would like me to open a new issue |
I noticed the same, but a release for firebase-tools hasn't been released
since this update, so from my understanding we just need to wait a while
longer
…On Thu, 16 Jul 2020, 00:08 Scott Prue, ***@***.***> wrote:
Thanks a bunch for the fixes posted @samtstern
<https://github.com/samtstern>
Even after updating both firebase-tools, and firebase-functions to the
noted versions, I still get this error, but now from @firebase/database
instead (^0.6.0 is pointed to, but still experienced it with a fresh
install which pulled 0.6.8 of @firebase/database). This is also being
experienced by multiple devs on my team
Let me know if you need any more info or would like me to open a new issue
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#726 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKRKQTEIPHJD7PX6X7G42LR3YSHRANCNFSM4OUWD5EQ>
.
|
@ElGoorf You are correct - v8.6.0 of firebase-tools was just released a few minutes go and it appears that fixed it. Got confused since I didn't see 2434 mentioned anywhere in the releases Thanks @samtstern |
@prescottprue the fix in the CLI was actually only released a few hours ago in version 8.6.0 ... before that it was merged to master but not released. Can you try with that version? |
Oops didn't see your last comment when replying. Glad it works now! |
Environment info
firebase-tools:
8.4.3
Platform:
Windows 10
Test case
Steps to reproduce
make a change to that node on the realtime database to initiate the function
Expected behavior
No error, this works on the server, but not on the emulator.
Calling the same code directly from the app runs without issues. The call to the
change.before.ref
causes the error only when the function is initiated from a trigger.Calling using the initiated
admin.database().ref('/status/${deviceId}')
works normally as in the snippet belowActual behavior
throws the error:
@firebase/database: FIREBASE FATAL ERROR: Cannot parse Firebase url. Please use https://.firebaseio.com
The text was updated successfully, but these errors were encountered: