firebase-tools
firebase-tools copied to clipboard
Storage emulator doesn't support storage targets in firebase.json
[REQUIRED] Environment info
firebase-tools: 9.12.1
Platform: macOS
[REQUIRED] Test case
Sample firebase.json file with a storage configuration using targets that results in an error.
{
"storage": [
{
"target": "example-target-1",
"rules": "path-to-rules-1.rules"
},
{
"target": "example-target-2",
"rules": "path-to-rules-2.rules"
}
]
}
Note that with a storage configuration without targets (example below), the emulator starts as expected
{
"storage": {
"rules": "path-to-rules.rules"
}
}
[REQUIRED] Steps to reproduce
- Setup a
firebase.jsonfile with a 'storage' configuration that uses targets (see above) - Start the emulator (assuming storage emulator is configured and enabled):
firebase emulators:start --project test
[REQUIRED] Expected behavior
The emulator should start with no error
[REQUIRED] Actual behavior
Emulator fails with the error Cannot start the Storage emulator without rules file specified in firebase.json: run 'firebase init' and set up your Storage configuration
[2021-06-16T21:47:01.283Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[2021-06-16T21:47:01.285Z] > authorizing via signed-in user ([email protected])
i emulators: Starting emulators: functions, firestore, hosting, pubsub, storage {"metadata":{"emulator":{"name":"hub"},"message":"Starting emulators: functions, firestore, hosting, pubsub, storage"}}
[2021-06-16T21:47:01.323Z] [hub] writing locator at /var/folders/59/ryly1_nn0s58xh_gpqwg4p0m00mhw8/T/hub-[OBFUSCATED].json
⚠ functions: The following emulators are not running, calls to these services from the Functions emulator will affect production: auth, database {"metadata":{"emulator":{"name":"functions"},"message":"The following emulators are not running, calls to these services from the Functions emulator will affect production: \u001b[1mauth, database\u001b[22m"}}
✔ functions: Using node@12 from host. {"metadata":{"emulator":{"name":"functions"},"message":"Using node@12 from host."}}
[2021-06-16T21:47:01.371Z] defaultcredentials: writing to file /[OBFUSCATED]_application_default_credentials.json
[2021-06-16T21:47:01.373Z] Setting GAC to /[OBFUSCATED]_application_default_credentials.json {"metadata":{"emulator":{"name":"functions"},"message":"Setting GAC to /[OBFUSCATED]_application_default_credentials.json"}}
[2021-06-16T21:47:01.376Z] >>> [apiv2][query] GET https://firebase.googleapis.com/v1beta1/projects/[PROJECT_ID]/adminSdkConfig [none]
[2021-06-16T21:47:01.967Z] <<< [apiv2][status] GET https://firebase.googleapis.com/v1beta1/projects/[PROJECT_ID]/adminSdkConfig 200
[2021-06-16T21:47:01.967Z] <<< [apiv2][body] GET https://firebase.googleapis.com/v1beta1/projects/[PROJECT_ID]/adminSdkConfig {"projectId":"[PROJECT_ID]","databaseURL":"https://[PROJECT_ID].firebaseio.com","storageBucket":"[PROJECT_ID].appspot.com","locationId":"[OBFUSCATED]"}
[2021-06-16T21:47:02.251Z] Ignoring unsupported arg: projectId {"metadata":{"emulator":{"name":"firestore"},"message":"Ignoring unsupported arg: projectId"}}
[2021-06-16T21:47:02.252Z] Ignoring unsupported arg: auto_download {"metadata":{"emulator":{"name":"firestore"},"message":"Ignoring unsupported arg: auto_download"}}
[2021-06-16T21:47:02.252Z] Starting Firestore Emulator with command {"binary":"java","args":["-Dgoogle.cloud_firestore.debug_log_level=FINE","-Duser.language=en","-jar","/[OBFUSCATED]/cloud-firestore-emulator-v1.12.0.jar","--host","localhost","--port",8080,"--rules","/[OBFUSCATED]/firestore.rules","--functions_emulator","localhost:5001"],"optionalArgs":["port","webchannel_port","host","rules","functions_emulator","seed_from_export"],"joinArgs":false} {"metadata":{"emulator":{"name":"firestore"},"message":"Starting Firestore Emulator with command {\"binary\":\"java\",\"args\":[\"-Dgoogle.cloud_firestore.debug_log_level=FINE\",\"-Duser.language=en\",\"-jar\",\"/[OBFUSCATED]/firebase/emulators/cloud-firestore-emulator-v1.12.0.jar\",\"--host\",\"localhost\",\"--port\",8080,\"--rules\",\"/[OBFUSCATED]/firestore.rules\",\"--functions_emulator\",\"localhost:5001\"],\"optionalArgs\":[\"port\",\"webchannel_port\",\"host\",\"rules\",\"functions_emulator\",\"seed_from_export\"],\"joinArgs\":false}"}}
i firestore: Firestore Emulator logging to firestore-debug.log {"metadata":{"emulator":{"name":"firestore"},"message":"Firestore Emulator logging to \u001b[1mfirestore-debug.log\u001b[22m"}}
[2021-06-16T21:47:03.830Z] Jun 16, 2021 5:47:03 PM com.google.cloud.datastore.emulator.firestore.websocket.WebSocketServer start
INFO: Started WebSocket server on ws://localhost:60807
{"metadata":{"emulator":{"name":"firestore"},"message":"Jun 16, 2021 5:47:03 PM com.google.cloud.datastore.emulator.firestore.websocket.WebSocketServer start\nINFO: Started WebSocket server on ws://localhost:60807\n"}}
[2021-06-16T21:47:03.901Z] API endpoint: http:// {"metadata":{"emulator":{"name":"firestore"},"message":"API endpoint: http://"}}
[2021-06-16T21:47:03.903Z] localhost {"metadata":{"emulator":{"name":"firestore"},"message":"localhost"}}
[2021-06-16T21:47:03.909Z] : {"metadata":{"emulator":{"name":"firestore"},"message":":"}}
[2021-06-16T21:47:03.910Z] 8080 {"metadata":{"emulator":{"name":"firestore"},"message":"8080"}}
[2021-06-16T21:47:03.911Z]
{"metadata":{"emulator":{"name":"firestore"},"message":"\n"}}
[2021-06-16T21:47:03.914Z] If you are using a library that supports the FIRESTORE_EMULATOR_HOST environment variable, run: {"metadata":{"emulator":{"name":"firestore"},"message":"If you are using a library that supports the FIRESTORE_EMULATOR_HOST environment variable, run:"}}
[2021-06-16T21:47:03.917Z]
{"metadata":{"emulator":{"name":"firestore"},"message":"\n"}}
[2021-06-16T21:47:03.917Z]
export FIRESTORE_EMULATOR_HOST=localhost:8080 {"metadata":{"emulator":{"name":"firestore"},"message":"\n export FIRESTORE_EMULATOR_HOST=localhost:8080"}}
[2021-06-16T21:47:03.920Z]
{"metadata":{"emulator":{"name":"firestore"},"message":"\n\n"}}
[2021-06-16T21:47:03.921Z] Dev App Server is now running.
{"metadata":{"emulator":{"name":"firestore"},"message":"Dev App Server is now running.\n"}}
[2021-06-16T21:47:03.924Z]
{"metadata":{"emulator":{"name":"firestore"},"message":"\n"}}
[2021-06-16T21:47:04.058Z] Ignoring unsupported arg: projectId {"metadata":{"emulator":{"name":"pubsub"},"message":"Ignoring unsupported arg: projectId"}}
[2021-06-16T21:47:04.058Z] Ignoring unsupported arg: auto_download {"metadata":{"emulator":{"name":"pubsub"},"message":"Ignoring unsupported arg: auto_download"}}
[2021-06-16T21:47:04.058Z] Starting Pub/Sub Emulator with command {"binary":"/[OBFUSCATED]/firebase/emulators/pubsub-emulator-0.1.0/pubsub-emulator/bin/cloud-pubsub-emulator","args":["--host=localhost","--port=8085"],"optionalArgs":["port","host"],"joinArgs":true} {"metadata":{"emulator":{"name":"pubsub"},"message":"Starting Pub/Sub Emulator with command {\"binary\":\"/[OBFUSCATED]/.cache/firebase/emulators/pubsub-emulator-0.1.0/pubsub-emulator/bin/cloud-pubsub-emulator\",\"args\":[\"--host=localhost\",\"--port=8085\"],\"optionalArgs\":[\"port\",\"host\"],\"joinArgs\":true}"}}
i pubsub: Pub/Sub Emulator logging to pubsub-debug.log {"metadata":{"emulator":{"name":"pubsub"},"message":"Pub/Sub Emulator logging to \u001b[1mpubsub-debug.log\u001b[22m"}}
[2021-06-16T21:47:04.390Z] This is the Google Pub/Sub fake. {"metadata":{"emulator":{"name":"pubsub"},"message":"This is the Google Pub/Sub fake."}}
[2021-06-16T21:47:04.390Z]
{"metadata":{"emulator":{"name":"pubsub"},"message":"\n"}}
[2021-06-16T21:47:04.392Z] Implementation may be incomplete or differ from the real system. {"metadata":{"emulator":{"name":"pubsub"},"message":"Implementation may be incomplete or differ from the real system."}}
[2021-06-16T21:47:04.392Z]
{"metadata":{"emulator":{"name":"pubsub"},"message":"\n"}}
[2021-06-16T21:47:04.450Z] Jun 16, 2021 5:47:04 PM com.google.cloud.pubsub.testing.v1.Main main
INFO: IAM integration is disabled. IAM policy methods and ACL checks are not supported
{"metadata":{"emulator":{"name":"pubsub"},"message":"Jun 16, 2021 5:47:04 PM com.google.cloud.pubsub.testing.v1.Main main\nINFO: IAM integration is disabled. IAM policy methods and ACL checks are not supported\n"}}
[2021-06-16T21:47:05.055Z] Jun 16, 2021 5:47:05 PM io.gapi.emulators.netty.NettyUtil applyJava7LongHostnameWorkaround
INFO: Unable to apply Java 7 long hostname workaround.
{"metadata":{"emulator":{"name":"pubsub"},"message":"Jun 16, 2021 5:47:05 PM io.gapi.emulators.netty.NettyUtil applyJava7LongHostnameWorkaround\nINFO: Unable to apply Java 7 long hostname workaround.\n"}}
[2021-06-16T21:47:05.185Z] Jun 16, 2021 5:47:05 PM com.google.cloud.pubsub.testing.v1.Main main
INFO: Server started, listening on 8085
{"metadata":{"emulator":{"name":"pubsub"},"message":"Jun 16, 2021 5:47:05 PM com.google.cloud.pubsub.testing.v1.Main main\nINFO: Server started, listening on 8085\n"}}
i emulators: Shutting down emulators. {"metadata":{"emulator":{"name":"hub"},"message":"Shutting down emulators."}}
i functions: Stopping Functions Emulator {"metadata":{"emulator":{"name":"functions"},"message":"Stopping Functions Emulator"}}
i firestore: Stopping Firestore Emulator {"metadata":{"emulator":{"name":"firestore"},"message":"Stopping Firestore Emulator"}}
[2021-06-16T21:47:05.364Z] *** shutting down gRPC server since JVM is shutting down
{"metadata":{"emulator":{"name":"firestore"},"message":"*** shutting down gRPC server since JVM is shutting down\n"}}
[2021-06-16T21:47:05.390Z] *** server shut down
{"metadata":{"emulator":{"name":"firestore"},"message":"*** server shut down\n"}}
[2021-06-16T21:47:05.544Z] Jun 16, 2021 5:47:05 PM io.gapi.emulators.grpc.GrpcServer$3 operationComplete
INFO: Adding handler(s) to newly registered Channel.
{"metadata":{"emulator":{"name":"pubsub"},"message":"Jun 16, 2021 5:47:05 PM io.gapi.emulators.grpc.GrpcServer$3 operationComplete\nINFO: Adding handler(s) to newly registered Channel.\n"}}
i pubsub: Stopping Pub/Sub Emulator {"metadata":{"emulator":{"name":"pubsub"},"message":"Stopping Pub/Sub Emulator"}}
[2021-06-16T21:47:05.779Z] *** shutting down gRPC server since JVM is shutting down {"metadata":{"emulator":{"name":"pubsub"},"message":"*** shutting down gRPC server since JVM is shutting down"}}
[2021-06-16T21:47:05.779Z]
{"metadata":{"emulator":{"name":"pubsub"},"message":"\n"}}
[2021-06-16T21:47:05.800Z] *** server shut down
{"metadata":{"emulator":{"name":"pubsub"},"message":"*** server shut down\n"}}
i hub: Stopping emulator hub {"metadata":{"emulator":{"name":"hub"},"message":"Stopping emulator hub"}}
Error: Cannot start the Storage emulator without rules file specified in firebase.json: run 'firebase init' and set up your Storage configuration
This is a duplicate of https://github.com/firebase/firebase-tools/issues/3390 so let's discuss over there.