-
Notifications
You must be signed in to change notification settings - Fork 956
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
Realtime Emulator Java error on database rules #2734
Comments
@criesbeck this definitely shouldn't be crashing the emulator but it does look like you have a typo:
Should be:
Does adding the closing |
It does! D'oh. I had checked the JSON with JSONLint, but I didn't run a JavaScript checker on the validate rules. Thanks! |
@IanWyszynski can you look into why such a small error caused such a massive explosion from the RTDB emulator? |
The minimal rule set for causing the parse error seems to be this. Is it having a JavaScript syntax error inside a variable block?
|
I reproduced this issue locally. There does actually seem to be a deeper issue here. When I run the emulator from the
But when I execute the jar for v4.6.0, the same update causes the curl client issuing an update request to hang and results in an error similar to the one shown: https://gist.github.com/IanWyszynski/97dfe99395b013f4816b2a6e41e95a0b This does seem to be specific to the emulator, I tested updating rules for one of my prod namespaces with the offending ruleset and got:
|
It may not crash the emulator but the messages on the console never
complete. They stop at the message about starting the UI, so it appears to
the developer that nothing was launched.
…On Thu, Oct 29, 2020 at 11:18 AM Jan Wyszynski ***@***.***> wrote:
I reproduced this issue locally. To clarify, this is just a nasty log
statement. The rules update doesn't crash the emulator process. There may
be some changes we can make locally to clean up this big stack trace. I
will update this issue when I figure those out.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2734 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AANDKRWPPKKQAX2I26FGSODSNGIW5ANCNFSM4S3S75VA>
.
--
-------------------
Chris Riesbeck
Home Page: http://www.cs.northwestern.edu/~riesbeck
Calendar: http://www.cs.northwestern.edu/~riesbeck/calendar-weekly.html
|
I believe this issue should be resolved with the linked release. |
[REQUIRED] Environment info
Firebase: 8.13.1
firebase-tools:
Realtime database emulator
Platform:
macOS Catalina 10.15.7
[REQUIRED] Test case
A database.rules.json with the following crashes the emulator rule parser on startup.
[REQUIRED] Steps to reproduce
Create an empty directory and initialize.
Firebase CLI features: Select Realtime Database and Emulators.
Project: Create a new Firebase project or use any existing one.
Database setup: Accept defaults
Emulators setup: Select Realtime Database. Accept defaults for the rest.
Replace database.rules.json with the following:
Start emulators:
[REQUIRED] Expected behavior
The database emulator starts and there is an empty local database.
[REQUIRED] Actual behavior
There's a Java Exception. Full stacktrace
The text was updated successfully, but these errors were encountered: