-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed as duplicate of#8985
Labels
Description
[REQUIRED] Environment info
firebase-tools:
14.12.1
Platform:
mac, linux
[REQUIRED] Test case
Run firebase deploy --only database
there's a difference between 14.11.1 behavior and 14.12.1
[REQUIRED] Steps to reproduce
Run firebase deploy --only database
on a project containing a database.rules.json file that deploys with 14.11.1
[REQUIRED] Expected behavior
Rules are deployed
[REQUIRED] Actual behavior
Error: Syntax error in database rules:
1:2: Expected 'rules' property.
Debug output:
i deploying database
i database: checking rules syntax...
[2025-08-20T08:11:18.714Z] Checked if tokens are valid: true, expires at: 1755680122275
[2025-08-20T08:11:18.714Z] Checked if tokens are valid: true, expires at: 1755680122275
[2025-08-20T08:11:18.714Z] >>> [apiv2][query] GET https://firebasedatabase.googleapis.com/v1beta/projects/myproject/locations/-/instances/myproject-default-rtdb [none]
[2025-08-20T08:11:19.459Z] <<< [apiv2][status] GET https://firebasedatabase.googleapis.com/v1beta/projects/myproject/locations/-/instances/myproject-default-rtdb 200
[2025-08-20T08:11:19.460Z] <<< [apiv2][body] GET https://firebasedatabase.googleapis.com/v1beta/projects/myproject/locations/-/instances/myproject-default-rtdb {"name":"projects/436903830445/locations/europe-west1/instances/myproject-default-rtdb","project":"projects/436903830445","databaseUrl":"https://myproject-default-rtdb.europe-west1.firebasedatabase.app","type":"DEFAULT_DATABASE","state":"ACTIVE"}
[2025-08-20T08:11:19.461Z] Checked if tokens are valid: true, expires at: 1755680122275
[2025-08-20T08:11:19.461Z] Checked if tokens are valid: true, expires at: 1755680122275
[2025-08-20T08:11:19.462Z] >>> [apiv2][query] PUT https://myproject-default-rtdb.europe-west1.firebasedatabase.app/.settings/rules.json
[2025-08-20T08:11:19.462Z] >>> [apiv2][body] PUT https://myproject-default-rtdb.europe-west1.firebasedatabase.app/.settings/rules.json {"dryRun":true}
[2025-08-20T08:11:19.563Z] <<< [apiv2][status] PUT https://myproject-default-rtdb.europe-west1.firebasedatabase.app/.settings/rules.json 400
[2025-08-20T08:11:19.563Z] <<< [apiv2][body] PUT https://myproject-default-rtdb.europe-west1.firebasedatabase.app/.settings/rules.json {"error":"1:2: Expected 'rules' property.\n"}
Error: Syntax error in database rules:
1:2: Expected 'rules' property.
Same output with 14.11.1
i deploying database
i database: checking rules syntax...
[2025-08-20T08:13:36.563Z] Checked if tokens are valid: true, expires at: 1755680122275
[2025-08-20T08:13:36.563Z] Checked if tokens are valid: true, expires at: 1755680122275
[2025-08-20T08:13:36.563Z] >>> [apiv2][query] GET https://firebasedatabase.googleapis.com/v1beta/projects/myproject/locations/-/instances/myproject-default-rtdb [none]
[2025-08-20T08:13:37.364Z] <<< [apiv2][status] GET https://firebasedatabase.googleapis.com/v1beta/projects/myproject/locations/-/instances/myproject-default-rtdb 200
[2025-08-20T08:13:37.364Z] <<< [apiv2][body] GET https://firebasedatabase.googleapis.com/v1beta/projects/myproject/locations/-/instances/myproject-default-rtdb {"name":"projects/436903830445/locations/europe-west1/instances/myproject-default-rtdb","project":"projects/436903830445","databaseUrl":"https://myproject-default-rtdb.europe-west1.firebasedatabase.app","type":"DEFAULT_DATABASE","state":"ACTIVE"}
[2025-08-20T08:13:37.365Z] Checked if tokens are valid: true, expires at: 1755680122275
[2025-08-20T08:13:37.365Z] Checked if tokens are valid: true, expires at: 1755680122275
[2025-08-20T08:13:37.366Z] >>> [apiv2][query] PUT https://myproject-default-rtdb.europe-west1.firebasedatabase.app/.settings/rules.json dryRun=true
[2025-08-20T08:13:37.366Z] >>> [apiv2][body] PUT https://myproject-default-rtdb.europe-west1.firebasedatabase.app/.settings/rules.json "{\n \"rules\": {\n \".write\": \"false\",\n \"contacts\": {\n \"$uid\": {\n \".read\": \"$uid === auth.uid\"\n }\n },\n \"calls\": {\n \"$uid\": {\n \".read\": \"$uid === auth.uid\"\n }\n },\n \"location-age\": {\n \".read\": false,\n \".indexOn\": \".value\"\n },\n \"rooms\": {\n \".read\": \"auth.token.mb == true\"\n }\n }\n}\n"
[2025-08-20T08:13:37.455Z] <<< [apiv2][status] PUT https://myproject-default-rtdb.europe-west1.firebasedatabase.app/.settings/rules.json 200
[2025-08-20T08:13:37.456Z] <<< [apiv2][body] PUT https://myproject-default-rtdb.europe-west1.firebasedatabase.app/.settings/rules.json {"status":"ok"}
✔ database: rules syntax for database myproject-default-rtdb is valid
i database: releasing rules...
[2025-08-20T08:13:37.457Z] Checked if tokens are valid: true, expires at: 1755680122275
[2025-08-20T08:13:37.457Z] Checked if tokens are valid: true, expires at: 1755680122275
[2025-08-20T08:13:37.458Z] >>> [apiv2][query] GET https://firebasedatabase.googleapis.com/v1beta/projects/myproject/locations/-/instances/myproject-default-rtdb [none]
[2025-08-20T08:13:37.665Z] <<< [apiv2][status] GET https://firebasedatabase.googleapis.com/v1beta/projects/myproject/locations/-/instances/myproject-default-rtdb 200
[2025-08-20T08:13:37.665Z] <<< [apiv2][body] GET https://firebasedatabase.googleapis.com/v1beta/projects/myproject/locations/-/instances/myproject-default-rtdb {"name":"projects/436903830445/locations/europe-west1/instances/myproject-default-rtdb","project":"projects/436903830445","databaseUrl":"https://myproject-default-rtdb.europe-west1.firebasedatabase.app","type":"DEFAULT_DATABASE","state":"ACTIVE"}
[2025-08-20T08:13:37.666Z] Checked if tokens are valid: true, expires at: 1755680122275
[2025-08-20T08:13:37.666Z] Checked if tokens are valid: true, expires at: 1755680122275
[2025-08-20T08:13:37.666Z] >>> [apiv2][query] PUT https://myproject-default-rtdb.europe-west1.firebasedatabase.app/.settings/rules.json
[2025-08-20T08:13:37.666Z] >>> [apiv2][body] PUT https://myproject-default-rtdb.europe-west1.firebasedatabase.app/.settings/rules.json "{\n \"rules\": {\n \".write\": \"false\",\n \"contacts\": {\n \"$uid\": {\n \".read\": \"$uid === auth.uid\"\n }\n },\n \"calls\": {\n \"$uid\": {\n \".read\": \"$uid === auth.uid\"\n }\n },\n \"location-age\": {\n \".read\": false,\n \".indexOn\": \".value\"\n },\n \"rooms\": {\n \".read\": \"auth.token.mb == true\"\n }\n }\n}\n"
[2025-08-20T08:13:37.974Z] <<< [apiv2][status] PUT https://myproject-default-rtdb.europe-west1.firebasedatabase.app/.settings/rules.json 200
[2025-08-20T08:13:37.974Z] <<< [apiv2][body] PUT https://myproject-default-rtdb.europe-west1.firebasedatabase.app/.settings/rules.json {"status":"ok"}
✔ database: rules for database myproject-default-rtdb released successfully
✔ Deploy complete!
It appears that 14.12.1
is not posting any rules.