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

Firebase Firestore emulator does not display any data when run from WSL 2 Ubuntu #2526

Closed
es80 opened this issue Aug 5, 2020 · 5 comments
Closed
Assignees

Comments

@es80
Copy link

es80 commented Aug 5, 2020

[REQUIRED] Environment info

firebase-tools: 8.6.0

Platform: Windows WSL 2 Ubuntu (20.04)

[REQUIRED] Test case

$ cat functions/src/index.ts
import * as admin from 'firebase-admin';

admin.initializeApp()

import * as functions from 'firebase-functions';

// // Start writing Firebase Functions
// // https://firebase.google.com/docs/functions/typescript
//

export const helloWorld = functions.https.onRequest(async (request, response) => {
  functions.logger.info("Hello logs!", { structuredData: true });

  const db = admin.firestore();
  await db.collection('tests').doc('test').set({ testing: 'a test' })
  const doc = await db.collection('tests').doc('test').get()
  if (doc.exists) {
    functions.logger.log(doc.data())
  }

  response.send("Hello from Firebase!");
});

[REQUIRED] Steps to reproduce

$ firebase init

Modify functions/src/index.ts as above.

$ firebase deploy

Call function, confirm data written and read back OK via logs and firestore itself.

$ firebase emulators:start

Call function, confirm data written and read back OK via logs.
However, no data displayed in (localhost) firestore.

Now switch away from WSL 2 Ubuntu to regular Windows.

> firebase emualtors:start

Call function, confirm data written and read back OK via logs and (localhost) firestore.

[REQUIRED] Expected behavior

Data should be displayed in localhost firestore.

[REQUIRED] Actual behavior

No data displayed in localhost firestore.

$ firebase emulators:start --debug
[2020-08-05T17:23:26.157Z] > 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"]
[2020-08-05T17:23:26.158Z] > authorizing via signed-in user
i  emulators: Starting emulators: functions, firestore, database, hosting, pubsub {"metadata":{"emulator":{"name":"hub"},"message":"Starting emulators: functions, firestore, database, hosting, pubsub"}}
[2020-08-05T17:23:26.170Z] [hub] writing locator at /tmp/hub-test-for-bug-report-5289.json
[2020-08-05T17:23:26.188Z] defaultcredentials: writing to file /home/username/.config/firebase/usernames_company_name_com_application_default_credentials.json
[2020-08-05T17:23:26.189Z] Setting GAC to /home/username/.config/firebase/usernames_company_name_com_application_default_credentials.json {"metadata":{"emulator":{"name":"functions"},"message":"Setting GAC to /home/username/.config/firebase/usernames_company_name_com_application_default_credentials.json"}}
⚠  Your requested "node" version "8" doesn't match your global version "14" {"metadata":{"emulator":{"name":"functions"},"message":"Your requested \"node\" version \"8\" doesn't match your global version \"14\""}}
[2020-08-05T17:23:26.206Z] Ignoring unsupported arg: projectId {"metadata":{"emulator":{"name":"firestore"},"message":"Ignoring unsupported arg: projectId"}}
[2020-08-05T17:23:26.206Z] Ignoring unsupported arg: auto_download {"metadata":{"emulator":{"name":"firestore"},"message":"Ignoring unsupported arg: auto_download"}}
[2020-08-05T17:23:26.207Z] Starting Firestore Emulator with command {"binary":"java","args":["-Duser.language=en","-jar","/home/username/.cache/firebase/emulators/cloud-firestore-emulator-v1.11.5.jar","--host","localhost","--port",8080,"--rules","/home/username/dev/firebase-test/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\":[\"-Duser.language=en\",\"-jar\",\"/home/username/.cache/firebase/emulators/cloud-firestore-emulator-v1.11.5.jar\",\"--host\",\"localhost\",\"--port\",8080,\"--rules\",\"/home/username/dev/firebase-test/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"}}
[2020-08-05T17:23:26.218Z] Picked up _JAVA_OPTIONS: -Djava.util.prefs.userRoot=/home/username/.config/java
 {"metadata":{"emulator":{"name":"firestore"},"message":"Picked up _JAVA_OPTIONS: -Djava.util.prefs.userRoot=/home/username/.config/java\n"}}
[2020-08-05T17:23:26.819Z] API endpoint: http://localhost:8080
 {"metadata":{"emulator":{"name":"firestore"},"message":"API endpoint: http://localhost:8080\n"}}
[2020-08-05T17:23:26.820Z] If you are using a library that supports the FIRESTORE_EMULATOR_HOST environment variable, run:

   export FIRESTORE_EMULATOR_HOST=localhost:8080

Dev App Server is now running.

 {"metadata":{"emulator":{"name":"firestore"},"message":"If you are using a library that supports the FIRESTORE_EMULATOR_HOST environment variable, run:\n\n   export FIRESTORE_EMULATOR_HOST=localhost:8080\n\nDev App Server is now running.\n\n"}}
[2020-08-05T17:23:26.973Z] database rules config:  [{"rules":"database.rules.json","instance":"test-for-bug-report-5289"}]
[2020-08-05T17:23:26.975Z] Ignoring unsupported arg: projectId {"metadata":{"emulator":{"name":"database"},"message":"Ignoring unsupported arg: projectId"}}
[2020-08-05T17:23:26.975Z] Ignoring unsupported arg: auto_download {"metadata":{"emulator":{"name":"database"},"message":"Ignoring unsupported arg: auto_download"}}
[2020-08-05T17:23:26.975Z] Ignoring unsupported arg: rules {"metadata":{"emulator":{"name":"database"},"message":"Ignoring unsupported arg: rules"}}
[2020-08-05T17:23:26.975Z] Starting Database Emulator with command {"binary":"java","args":["-Duser.language=en","-jar","/home/username/.cache/firebase/emulators/firebase-database-emulator-v4.5.0.jar","--host","localhost","--port",9000,"--functions_emulator_host","localhost","--functions_emulator_port",5001],"optionalArgs":["port","host","functions_emulator_port","functions_emulator_host"],"joinArgs":false} {"metadata":{"emulator":{"name":"database"},"message":"Starting Database Emulator with command {\"binary\":\"java\",\"args\":[\"-Duser.language=en\",\"-jar\",\"/home/username/.cache/firebase/emulators/firebase-database-emulator-v4.5.0.jar\",\"--host\",\"localhost\",\"--port\",9000,\"--functions_emulator_host\",\"localhost\",\"--functions_emulator_port\",5001],\"optionalArgs\":[\"port\",\"host\",\"functions_emulator_port\",\"functions_emulator_host\"],\"joinArgs\":false}"}}
i  database: Database Emulator logging to database-debug.log {"metadata":{"emulator":{"name":"database"},"message":"Database Emulator logging to \u001b[1mdatabase-debug.log\u001b[22m"}}
[2020-08-05T17:23:26.982Z] Picked up _JAVA_OPTIONS: -Djava.util.prefs.userRoot=/home/username/.config/java
 {"metadata":{"emulator":{"name":"database"},"message":"Picked up _JAVA_OPTIONS: -Djava.util.prefs.userRoot=/home/username/.config/java\n"}}
[2020-08-05T17:23:27.405Z] WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by io.netty.util.internal.ReflectionUtil (file:/home/username/.cache/firebase/emulators/firebase-database-emulator-v4.5.0.jar) to field sun.nio.ch.SelectorImpl.selectedKeys
WARNING: Please consider reporting this to the maintainers of io.netty.util.internal.ReflectionUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
 {"metadata":{"emulator":{"name":"database"},"message":"WARNING: An illegal reflective access operation has occurred\nWARNING: Illegal reflective access by io.netty.util.internal.ReflectionUtil (file:/home/username/.cache/firebase/emulators/firebase-database-emulator-v4.5.0.jar) to field sun.nio.ch.SelectorImpl.selectedKeys\nWARNING: Please consider reporting this to the maintainers of io.netty.util.internal.ReflectionUtil\nWARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations\nWARNING: All illegal access operations will be denied in a future release\n"}}
[2020-08-05T17:23:27.956Z] 18:23:27.955 [NamespaceSystem-akka.actor.default-dispatcher-4] INFO akka.event.slf4j.Slf4jLogger - Slf4jLogger started
 {"metadata":{"emulator":{"name":"database"},"message":"18:23:27.955 [NamespaceSystem-akka.actor.default-dispatcher-4] INFO akka.event.slf4j.Slf4jLogger - Slf4jLogger started\n"}}
[2020-08-05T17:23:28.075Z] 18:23:28.075 [main] INFO com.firebase.server.forge.App$ - Listening at localhost:9000
 {"metadata":{"emulator":{"name":"database"},"message":"18:23:28.075 [main] INFO com.firebase.server.forge.App$ - Listening at localhost:9000\n"}}
[2020-08-05T17:23:28.248Z] >>> HTTP REQUEST GET https://firebase.googleapis.com/v1beta1/projects/test-for-bug-report-5289/webApps/-/config  
 
[2020-08-05T17:23:28.863Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Wed, 05 Aug 2020 17:23:26 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-27=\":443\"; ma=2592000,h3-T050=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
i  hosting: Serving hosting files from: public {"metadata":{"emulator":{"name":"hosting"},"message":"Serving hosting files from: \u001b[1mpublic\u001b[22m"}}
✔  hosting: Local server: http://localhost:5000 {"metadata":{"emulator":{"name":"hosting"},"message":"Local server: \u001b[4m\u001b[1mhttp://localhost:5000\u001b[22m\u001b[24m"}}
[2020-08-05T17:23:29.067Z] Ignoring unsupported arg: projectId {"metadata":{"emulator":{"name":"pubsub"},"message":"Ignoring unsupported arg: projectId"}}
[2020-08-05T17:23:29.067Z] Ignoring unsupported arg: auto_download {"metadata":{"emulator":{"name":"pubsub"},"message":"Ignoring unsupported arg: auto_download"}}
[2020-08-05T17:23:29.067Z] Starting Pub/Sub Emulator with command {"binary":"/home/username/.cache/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\":\"/home/username/.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"}}
[2020-08-05T17:23:29.079Z] Picked up _JAVA_OPTIONS: -Djava.util.prefs.userRoot=/home/username/.config/java
 {"metadata":{"emulator":{"name":"pubsub"},"message":"Picked up _JAVA_OPTIONS: -Djava.util.prefs.userRoot=/home/username/.config/java\n"}}
[2020-08-05T17:23:29.168Z] This is the Google Pub/Sub fake.
Implementation may be incomplete or differ from the real system.
 {"metadata":{"emulator":{"name":"pubsub"},"message":"This is the Google Pub/Sub fake.\nImplementation may be incomplete or differ from the real system.\n"}}
[2020-08-05T17:23:29.200Z] Aug 05, 2020 6:23:29 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":"Aug 05, 2020 6:23:29 PM com.google.cloud.pubsub.testing.v1.Main main\nINFO: IAM integration is disabled. IAM policy methods and ACL checks are not supported\n"}}
[2020-08-05T17:23:29.463Z] Aug 05, 2020 6:23:29 PM io.gapi.emulators.netty.NettyUtil applyJava7LongHostnameWorkaround
INFO: Applied Java 7 long hostname workaround.
 {"metadata":{"emulator":{"name":"pubsub"},"message":"Aug 05, 2020 6:23:29 PM io.gapi.emulators.netty.NettyUtil applyJava7LongHostnameWorkaround\nINFO: Applied Java 7 long hostname workaround.\n"}}
[2020-08-05T17:23:29.508Z] Aug 05, 2020 6:23:29 PM com.google.cloud.pubsub.testing.v1.Main main
INFO: Server started, listening on 8085
 {"metadata":{"emulator":{"name":"pubsub"},"message":"Aug 05, 2020 6:23:29 PM com.google.cloud.pubsub.testing.v1.Main main\nINFO: Server started, listening on 8085\n"}}
[2020-08-05T17:23:29.582Z] Ignoring unsupported arg: auto_download {"metadata":{"emulator":{"name":"ui"},"message":"Ignoring unsupported arg: auto_download"}}
[2020-08-05T17:23:29.582Z] Ignoring unsupported arg: port {"metadata":{"emulator":{"name":"ui"},"message":"Ignoring unsupported arg: port"}}
[2020-08-05T17:23:29.583Z] Starting Emulator UI with command {"binary":"node","args":["/home/username/.cache/firebase/emulators/ui-v1.1.1/server.bundle.js"],"optionalArgs":[],"joinArgs":false} {"metadata":{"emulator":{"name":"ui"},"message":"Starting Emulator UI with command {\"binary\":\"node\",\"args\":[\"/home/username/.cache/firebase/emulators/ui-v1.1.1/server.bundle.js\"],\"optionalArgs\":[],\"joinArgs\":false}"}}
i  ui: Emulator UI logging to ui-debug.log {"metadata":{"emulator":{"name":"ui"},"message":"Emulator UI logging to \u001b[1mui-debug.log\u001b[22m"}}
[2020-08-05T17:23:29.633Z] Aug 05, 2020 6:23:29 PM io.gapi.emulators.grpc.GrpcServer$3 operationComplete
INFO: Adding handler(s) to newly registered Channel.
 {"metadata":{"emulator":{"name":"pubsub"},"message":"Aug 05, 2020 6:23:29 PM io.gapi.emulators.grpc.GrpcServer$3 operationComplete\nINFO: Adding handler(s) to newly registered Channel.\n"}}
[2020-08-05T17:23:29.651Z] Web / API server started at http://localhost:4000
 {"metadata":{"emulator":{"name":"ui"},"message":"Web / API server started at http://localhost:4000\n"}}
i  functions: Watching "/home/username/dev/firebase-test/functions" for Cloud Functions... {"metadata":{"emulator":{"name":"functions"},"message":"Watching \"/home/username/dev/firebase-test/functions\" for Cloud Functions..."}}
[2020-08-05T17:23:29.850Z] [worker-pool] addWorker(~diagnostic~) {"metadata":{"emulator":{"name":"functions"},"message":"[worker-pool] addWorker(~diagnostic~)"}}
[2020-08-05T17:23:29.851Z] [worker-pool] Adding worker with key ~diagnostic~, total=1 {"metadata":{"emulator":{"name":"functions"},"message":"[worker-pool] Adding worker with key ~diagnostic~, total=1"}}
[2020-08-05T17:23:29.851Z] [worker-pool] submitWork(triggerId=) {"metadata":{"emulator":{"name":"functions"},"message":"[worker-pool] submitWork(triggerId=)"}}
[2020-08-05T17:23:29.851Z] [worker-~diagnostic~-5c0ca8d4-27b5-43c8-b9d7-9cb1f9ed5c60]: Assigning socketPath: /tmp/fire_emu_1856.sock {"metadata":{"emulator":{"name":"functions"},"message":"[worker-~diagnostic~-5c0ca8d4-27b5-43c8-b9d7-9cb1f9ed5c60]: Assigning socketPath: /tmp/fire_emu_1856.sock"}}
[2020-08-05T17:23:29.851Z] [worker-~diagnostic~-5c0ca8d4-27b5-43c8-b9d7-9cb1f9ed5c60]: BUSY {"metadata":{"emulator":{"name":"functions"},"message":"[worker-~diagnostic~-5c0ca8d4-27b5-43c8-b9d7-9cb1f9ed5c60]: BUSY"}}
[2020-08-05T17:23:35.479Z] [runtime-status] [1856] Functions runtime initialized. {"cwd":"/home/username/dev/firebase-test/functions","node_version":"14.7.0"} {"metadata":{"emulator":{"name":"functions"},"message":"[runtime-status] [1856] Functions runtime initialized. {\"cwd\":\"/home/username/dev/firebase-test/functions\",\"node_version\":\"14.7.0\"}"}}
[2020-08-05T17:23:35.480Z] [runtime-status] [1856] Disabled runtime features: undefined {"metadata":{"emulator":{"name":"functions"},"message":"[runtime-status] [1856] Disabled runtime features: undefined"}}
[2020-08-05T17:23:35.482Z] [runtime-status] [1856] Resolved module firebase-admin {"declared":true,"installed":true,"version":"8.13.0","resolution":"/home/username/dev/firebase-test/functions/node_modules/firebase-admin/lib/index.js"} {"metadata":{"emulator":{"name":"functions"},"message":"[runtime-status] [1856] Resolved module firebase-admin {\"declared\":true,\"installed\":true,\"version\":\"8.13.0\",\"resolution\":\"/home/username/dev/firebase-test/functions/node_modules/firebase-admin/lib/index.js\"}"}}
[2020-08-05T17:23:35.485Z] [runtime-status] [1856] Resolved module firebase-functions {"declared":true,"installed":true,"version":"3.9.0","resolution":"/home/username/dev/firebase-test/functions/node_modules/firebase-functions/lib/index.js"} {"metadata":{"emulator":{"name":"functions"},"message":"[runtime-status] [1856] Resolved module firebase-functions {\"declared\":true,\"installed\":true,\"version\":\"3.9.0\",\"resolution\":\"/home/username/dev/firebase-test/functions/node_modules/firebase-functions/lib/index.js\"}"}}
[2020-08-05T17:23:35.486Z] [runtime-status] [1856] Resolved module firebase-functions {"declared":true,"installed":true,"version":"3.9.0","resolution":"/home/username/dev/firebase-test/functions/node_modules/firebase-functions/lib/index.js"} {"metadata":{"emulator":{"name":"functions"},"message":"[runtime-status] [1856] Resolved module firebase-functions {\"declared\":true,\"installed\":true,\"version\":\"3.9.0\",\"resolution\":\"/home/username/dev/firebase-test/functions/node_modules/firebase-functions/lib/index.js\"}"}}
[2020-08-05T17:23:35.487Z] [runtime-status] [1856] Set PUBSUB_EMULATOR_HOST to localhost:8085 {"metadata":{"emulator":{"name":"functions"},"message":"[runtime-status] [1856] Set PUBSUB_EMULATOR_HOST to localhost:8085"}}
[2020-08-05T17:23:35.488Z] [runtime-status] [1856] Outgoing network have been stubbed. [{"name":"http","status":"mocked"},{"name":"http","status":"mocked"},{"name":"https","status":"mocked"},{"name":"https","status":"mocked"},{"name":"net","status":"mocked"}] {"metadata":{"emulator":{"name":"functions"},"message":"[runtime-status] [1856] Outgoing network have been stubbed. [{\"name\":\"http\",\"status\":\"mocked\"},{\"name\":\"http\",\"status\":\"mocked\"},{\"name\":\"https\",\"status\":\"mocked\"},{\"name\":\"https\",\"status\":\"mocked\"},{\"name\":\"net\",\"status\":\"mocked\"}]"}}
[2020-08-05T17:23:35.488Z] [runtime-status] [1856] Resolved module firebase-functions {"declared":true,"installed":true,"version":"3.9.0","resolution":"/home/username/dev/firebase-test/functions/node_modules/firebase-functions/lib/index.js"} {"metadata":{"emulator":{"name":"functions"},"message":"[runtime-status] [1856] Resolved module firebase-functions {\"declared\":true,\"installed\":true,\"version\":\"3.9.0\",\"resolution\":\"/home/username/dev/firebase-test/functions/node_modules/firebase-functions/lib/index.js\"}"}}
[2020-08-05T17:23:35.510Z] [runtime-status] [1856] Checked functions.config() {"config":{}} {"metadata":{"emulator":{"name":"functions"},"message":"[runtime-status] [1856] Checked functions.config() {\"config\":{}}"}}
[2020-08-05T17:23:35.511Z] [runtime-status] [1856] firebase-functions has been stubbed. {"functionsResolution":{"declared":true,"installed":true,"version":"3.9.0","resolution":"/home/username/dev/firebase-test/functions/node_modules/firebase-functions/lib/index.js"}} {"metadata":{"emulator":{"name":"functions"},"message":"[runtime-status] [1856] firebase-functions has been stubbed. {\"functionsResolution\":{\"declared\":true,\"installed\":true,\"version\":\"3.9.0\",\"resolution\":\"/home/username/dev/firebase-test/functions/node_modules/firebase-functions/lib/index.js\"}}"}}
[2020-08-05T17:23:35.511Z] [runtime-status] [1856] Resolved module firebase-functions {"declared":true,"installed":true,"version":"3.9.0","resolution":"/home/username/dev/firebase-test/functions/node_modules/firebase-functions/lib/index.js"} {"metadata":{"emulator":{"name":"functions"},"message":"[runtime-status] [1856] Resolved module firebase-functions {\"declared\":true,\"installed\":true,\"version\":\"3.9.0\",\"resolution\":\"/home/username/dev/firebase-test/functions/node_modules/firebase-functions/lib/index.js\"}"}}
[2020-08-05T17:23:35.511Z] [runtime-status] [1856] Resolved module firebase-admin {"declared":true,"installed":true,"version":"8.13.0","resolution":"/home/username/dev/firebase-test/functions/node_modules/firebase-admin/lib/index.js"} {"metadata":{"emulator":{"name":"functions"},"message":"[runtime-status] [1856] Resolved module firebase-admin {\"declared\":true,\"installed\":true,\"version\":\"8.13.0\",\"resolution\":\"/home/username/dev/firebase-test/functions/node_modules/firebase-admin/lib/index.js\"}"}}
[2020-08-05T17:23:35.512Z] [runtime-status] [1856] Resolved module firebase-functions {"declared":true,"installed":true,"version":"3.9.0","resolution":"/home/username/dev/firebase-test/functions/node_modules/firebase-functions/lib/index.js"} {"metadata":{"emulator":{"name":"functions"},"message":"[runtime-status] [1856] Resolved module firebase-functions {\"declared\":true,\"installed\":true,\"version\":\"3.9.0\",\"resolution\":\"/home/username/dev/firebase-test/functions/node_modules/firebase-functions/lib/index.js\"}"}}
[2020-08-05T17:23:35.512Z] [runtime-status] [1856] firebase-admin has been stubbed. {"adminResolution":{"declared":true,"installed":true,"version":"8.13.0","resolution":"/home/username/dev/firebase-test/functions/node_modules/firebase-admin/lib/index.js"}} {"metadata":{"emulator":{"name":"functions"},"message":"[runtime-status] [1856] firebase-admin has been stubbed. {\"adminResolution\":{\"declared\":true,\"installed\":true,\"version\":\"8.13.0\",\"resolution\":\"/home/username/dev/firebase-test/functions/node_modules/firebase-admin/lib/index.js\"}}"}}
[2020-08-05T17:23:35.513Z] [runtime-status] [1856] initializeApp(DEFAULT) {"databaseURL":"http://localhost:9000?ns=test-for-bug-report-5289","storageBucket":"test-for-bug-report-5289.appspot.com","projectId":"test-for-bug-report-5289"} {"metadata":{"emulator":{"name":"functions"},"message":"[runtime-status] [1856] initializeApp(DEFAULT) {\"databaseURL\":\"http://localhost:9000?ns=test-for-bug-report-5289\",\"storageBucket\":\"test-for-bug-report-5289.appspot.com\",\"projectId\":\"test-for-bug-report-5289\"}"}}
✔  functions[helloWorld]: http function initialized (http://localhost:5001/test-for-bug-report-5289/us-central1/helloWorld). {"metadata":{"emulator":{"name":"functions"},"message":"\u001b[1mhttp\u001b[22m function initialized (http://localhost:5001/test-for-bug-report-5289/us-central1/helloWorld)."}}

┌───────────────────────────────────────────────────────────────────────┐
│ ✔  All emulators ready! View status and logs at http://localhost:4000 │
└───────────────────────────────────────────────────────────────────────┘

┌───────────┬────────────────┬─────────────────────────────────┐
│ Emulator  │ Host:Port      │ View in Emulator UI             │
├───────────┼────────────────┼─────────────────────────────────┤
│ Functions │ localhost:5001 │ http://localhost:4000/functions │
├───────────┼────────────────┼─────────────────────────────────┤
│ Firestore │ localhost:8080 │ http://localhost:4000/firestore │
├───────────┼────────────────┼─────────────────────────────────┤
│ Database  │ localhost:9000 │ http://localhost:4000/database  │
├───────────┼────────────────┼─────────────────────────────────┤
│ Hosting   │ localhost:5000 │ n/a                             │
├───────────┼────────────────┼─────────────────────────────────┤
│ Pub/Sub   │ localhost:8085 │ n/a                             │
└───────────┴────────────────┴─────────────────────────────────┘
  Other reserved ports: 4400, 4500

Issues? Report them at https://github.com/firebase/firebase-tools/issues and attach the *-debug.log files.
 
[2020-08-05T17:23:35.532Z] [worker-~diagnostic~-5c0ca8d4-27b5-43c8-b9d7-9cb1f9ed5c60]: IDLE {"metadata":{"emulator":{"name":"functions"},"message":"[worker-~diagnostic~-5c0ca8d4-27b5-43c8-b9d7-9cb1f9ed5c60]: IDLE"}}
[2020-08-05T17:23:47.718Z] [work-queue] {"queueLength":1,"workRunningCount":0}
[2020-08-05T17:23:47.720Z] [work-queue] {"queueLength":0,"workRunningCount":1}
[2020-08-05T17:23:47.721Z] Accepted request GET /test-for-bug-report-5289/us-central1/helloWorld --> helloWorld
[2020-08-05T17:23:47.732Z] [worker-pool] addWorker(helloWorld) {"metadata":{"emulator":{"name":"functions"},"message":"[worker-pool] addWorker(helloWorld)"}}
[2020-08-05T17:23:47.733Z] [worker-pool] Adding worker with key helloWorld, total=1 {"metadata":{"emulator":{"name":"functions"},"message":"[worker-pool] Adding worker with key helloWorld, total=1"}}
[2020-08-05T17:23:47.733Z] [worker-pool] submitWork(triggerId=helloWorld) {"metadata":{"emulator":{"name":"functions"},"message":"[worker-pool] submitWork(triggerId=helloWorld)"}}
[2020-08-05T17:23:47.734Z] [worker-helloWorld-b021e7f9-1c27-465e-bb07-3f303c1926fb]: Assigning socketPath: /tmp/fire_emu_1863.sock {"metadata":{"emulator":{"name":"functions"},"message":"[worker-helloWorld-b021e7f9-1c27-465e-bb07-3f303c1926fb]: Assigning socketPath: /tmp/fire_emu_1863.sock"}}
[2020-08-05T17:23:47.734Z] [worker-helloWorld-b021e7f9-1c27-465e-bb07-3f303c1926fb]: BUSY {"metadata":{"emulator":{"name":"functions"},"message":"[worker-helloWorld-b021e7f9-1c27-465e-bb07-3f303c1926fb]: BUSY"}}
[2020-08-05T17:23:53.820Z] [runtime-status] [1863] Functions runtime initialized. {"cwd":"/home/username/dev/firebase-test/functions","node_version":"14.7.0"} {"metadata":{"emulator":{"name":"functions"},"function":{"name":"helloWorld"},"message":"[runtime-status] [1863] Functions runtime initialized. {\"cwd\":\"/home/username/dev/firebase-test/functions\",\"node_version\":\"14.7.0\"}"}}
[2020-08-05T17:23:53.822Z] [runtime-status] [1863] Disabled runtime features: undefined {"metadata":{"emulator":{"name":"functions"},"function":{"name":"helloWorld"},"message":"[runtime-status] [1863] Disabled runtime features: undefined"}}
[2020-08-05T17:23:53.823Z] [runtime-status] [1863] Resolved module firebase-admin {"declared":true,"installed":true,"version":"8.13.0","resolution":"/home/username/dev/firebase-test/functions/node_modules/firebase-admin/lib/index.js"} {"metadata":{"emulator":{"name":"functions"},"function":{"name":"helloWorld"},"message":"[runtime-status] [1863] Resolved module firebase-admin {\"declared\":true,\"installed\":true,\"version\":\"8.13.0\",\"resolution\":\"/home/username/dev/firebase-test/functions/node_modules/firebase-admin/lib/index.js\"}"}}
[2020-08-05T17:23:53.826Z] [runtime-status] [1863] Resolved module firebase-functions {"declared":true,"installed":true,"version":"3.9.0","resolution":"/home/username/dev/firebase-test/functions/node_modules/firebase-functions/lib/index.js"} {"metadata":{"emulator":{"name":"functions"},"function":{"name":"helloWorld"},"message":"[runtime-status] [1863] Resolved module firebase-functions {\"declared\":true,\"installed\":true,\"version\":\"3.9.0\",\"resolution\":\"/home/username/dev/firebase-test/functions/node_modules/firebase-functions/lib/index.js\"}"}}
[2020-08-05T17:23:53.826Z] [runtime-status] [1863] Resolved module firebase-functions {"declared":true,"installed":true,"version":"3.9.0","resolution":"/home/username/dev/firebase-test/functions/node_modules/firebase-functions/lib/index.js"} {"metadata":{"emulator":{"name":"functions"},"function":{"name":"helloWorld"},"message":"[runtime-status] [1863] Resolved module firebase-functions {\"declared\":true,\"installed\":true,\"version\":\"3.9.0\",\"resolution\":\"/home/username/dev/firebase-test/functions/node_modules/firebase-functions/lib/index.js\"}"}}
[2020-08-05T17:23:53.827Z] [runtime-status] [1863] Set PUBSUB_EMULATOR_HOST to localhost:8085 {"metadata":{"emulator":{"name":"functions"},"function":{"name":"helloWorld"},"message":"[runtime-status] [1863] Set PUBSUB_EMULATOR_HOST to localhost:8085"}}
[2020-08-05T17:23:53.828Z] [runtime-status] [1863] Outgoing network have been stubbed. [{"name":"http","status":"mocked"},{"name":"http","status":"mocked"},{"name":"https","status":"mocked"},{"name":"https","status":"mocked"},{"name":"net","status":"mocked"}] {"metadata":{"emulator":{"name":"functions"},"function":{"name":"helloWorld"},"message":"[runtime-status] [1863] Outgoing network have been stubbed. [{\"name\":\"http\",\"status\":\"mocked\"},{\"name\":\"http\",\"status\":\"mocked\"},{\"name\":\"https\",\"status\":\"mocked\"},{\"name\":\"https\",\"status\":\"mocked\"},{\"name\":\"net\",\"status\":\"mocked\"}]"}}
[2020-08-05T17:23:53.828Z] [runtime-status] [1863] Resolved module firebase-functions {"declared":true,"installed":true,"version":"3.9.0","resolution":"/home/username/dev/firebase-test/functions/node_modules/firebase-functions/lib/index.js"} {"metadata":{"emulator":{"name":"functions"},"function":{"name":"helloWorld"},"message":"[runtime-status] [1863] Resolved module firebase-functions {\"declared\":true,\"installed\":true,\"version\":\"3.9.0\",\"resolution\":\"/home/username/dev/firebase-test/functions/node_modules/firebase-functions/lib/index.js\"}"}}
[2020-08-05T17:23:53.850Z] [runtime-status] [1863] Checked functions.config() {"config":{}} {"metadata":{"emulator":{"name":"functions"},"function":{"name":"helloWorld"},"message":"[runtime-status] [1863] Checked functions.config() {\"config\":{}}"}}
[2020-08-05T17:23:53.850Z] [runtime-status] [1863] firebase-functions has been stubbed. {"functionsResolution":{"declared":true,"installed":true,"version":"3.9.0","resolution":"/home/username/dev/firebase-test/functions/node_modules/firebase-functions/lib/index.js"}} {"metadata":{"emulator":{"name":"functions"},"function":{"name":"helloWorld"},"message":"[runtime-status] [1863] firebase-functions has been stubbed. {\"functionsResolution\":{\"declared\":true,\"installed\":true,\"version\":\"3.9.0\",\"resolution\":\"/home/username/dev/firebase-test/functions/node_modules/firebase-functions/lib/index.js\"}}"}}
[2020-08-05T17:23:53.850Z] [runtime-status] [1863] Resolved module firebase-functions {"declared":true,"installed":true,"version":"3.9.0","resolution":"/home/username/dev/firebase-test/functions/node_modules/firebase-functions/lib/index.js"} {"metadata":{"emulator":{"name":"functions"},"function":{"name":"helloWorld"},"message":"[runtime-status] [1863] Resolved module firebase-functions {\"declared\":true,\"installed\":true,\"version\":\"3.9.0\",\"resolution\":\"/home/username/dev/firebase-test/functions/node_modules/firebase-functions/lib/index.js\"}"}}
[2020-08-05T17:23:53.851Z] [runtime-status] [1863] Resolved module firebase-admin {"declared":true,"installed":true,"version":"8.13.0","resolution":"/home/username/dev/firebase-test/functions/node_modules/firebase-admin/lib/index.js"} {"metadata":{"emulator":{"name":"functions"},"function":{"name":"helloWorld"},"message":"[runtime-status] [1863] Resolved module firebase-admin {\"declared\":true,\"installed\":true,\"version\":\"8.13.0\",\"resolution\":\"/home/username/dev/firebase-test/functions/node_modules/firebase-admin/lib/index.js\"}"}}
[2020-08-05T17:23:53.851Z] [runtime-status] [1863] Resolved module firebase-functions {"declared":true,"installed":true,"version":"3.9.0","resolution":"/home/username/dev/firebase-test/functions/node_modules/firebase-functions/lib/index.js"} {"metadata":{"emulator":{"name":"functions"},"function":{"name":"helloWorld"},"message":"[runtime-status] [1863] Resolved module firebase-functions {\"declared\":true,\"installed\":true,\"version\":\"3.9.0\",\"resolution\":\"/home/username/dev/firebase-test/functions/node_modules/firebase-functions/lib/index.js\"}"}}
[2020-08-05T17:23:53.852Z] [runtime-status] [1863] firebase-admin has been stubbed. {"adminResolution":{"declared":true,"installed":true,"version":"8.13.0","resolution":"/home/username/dev/firebase-test/functions/node_modules/firebase-admin/lib/index.js"}} {"metadata":{"emulator":{"name":"functions"},"function":{"name":"helloWorld"},"message":"[runtime-status] [1863] firebase-admin has been stubbed. {\"adminResolution\":{\"declared\":true,\"installed\":true,\"version\":\"8.13.0\",\"resolution\":\"/home/username/dev/firebase-test/functions/node_modules/firebase-admin/lib/index.js\"}}"}}
[2020-08-05T17:23:53.852Z] [runtime-status] [1863] initializeApp(DEFAULT) {"databaseURL":"http://localhost:9000?ns=test-for-bug-report-5289","storageBucket":"test-for-bug-report-5289.appspot.com","projectId":"test-for-bug-report-5289"} {"metadata":{"emulator":{"name":"functions"},"function":{"name":"helloWorld"},"message":"[runtime-status] [1863] initializeApp(DEFAULT) {\"databaseURL\":\"http://localhost:9000?ns=test-for-bug-report-5289\",\"storageBucket\":\"test-for-bug-report-5289.appspot.com\",\"projectId\":\"test-for-bug-report-5289\"}"}}
[2020-08-05T17:23:53.864Z] [runtime-status] [1863] Trigger "helloWorld" has been found, beginning invocation! {"metadata":{"emulator":{"name":"functions"},"function":{"name":"helloWorld"},"message":"[runtime-status] [1863] Trigger \"helloWorld\" has been found, beginning invocation!"}}
i  functions: Beginning execution of "helloWorld" {"metadata":{"emulator":{"name":"functions"},"function":{"name":"helloWorld"},"message":"Beginning execution of \"helloWorld\""}}
[2020-08-05T17:23:53.864Z] [runtime-status] [1863] triggerDefinition {"httpsTrigger":{},"name":"helloWorld","entryPoint":"helloWorld"} {"metadata":{"emulator":{"name":"functions"},"function":{"name":"helloWorld"},"message":"[runtime-status] [1863] triggerDefinition {\"httpsTrigger\":{},\"name\":\"helloWorld\",\"entryPoint\":\"helloWorld\"}"}}
[2020-08-05T17:23:53.865Z] [runtime-status] [1863] Running helloWorld in mode HTTPS {"metadata":{"emulator":{"name":"functions"},"function":{"name":"helloWorld"},"message":"[runtime-status] [1863] Running helloWorld in mode HTTPS"}}
[2020-08-05T17:23:53.895Z] [runtime-status] [1863] Attempting to listen to socketPath: /tmp/fire_emu_1863.sock {"metadata":{"emulator":{"name":"functions"},"function":{"name":"helloWorld"},"message":"[runtime-status] [1863] Attempting to listen to socketPath: /tmp/fire_emu_1863.sock"}}
[2020-08-05T17:23:53.897Z] [functions] Runtime ready! Sending request! {"metadata":{"emulator":{"name":"functions"},"message":"[functions] Runtime ready! Sending request!"}}
[2020-08-05T17:23:53.902Z] [runtime-status] [1863] Ephemeral server handling GET request {"metadata":{"emulator":{"name":"functions"},"function":{"name":"helloWorld"},"message":"[runtime-status] [1863] Ephemeral server handling GET request"}}
>  {"structuredData":true,"severity":"INFO","message":"Hello logs!"} {"user":{"structuredData":true,"severity":"INFO","message":"Hello logs!"},"metadata":{"emulator":{"name":"functions"},"function":{"name":"helloWorld"},"message":"\u001b[90m> \u001b[39m {\"structuredData\":true,\"severity\":\"INFO\",\"message\":\"Hello logs!\"}"}}
[2020-08-05T17:23:54.137Z] Aug 05, 2020 6:23:54 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
INFO: Detected HTTP/2 connection.
 {"metadata":{"emulator":{"name":"firestore"},"message":"Aug 05, 2020 6:23:54 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead\nINFO: Detected HTTP/2 connection.\n"}}
>  {"testing":"a test","severity":"INFO","message":""} {"user":{"testing":"a test","severity":"INFO","message":""},"metadata":{"emulator":{"name":"functions"},"function":{"name":"helloWorld"},"message":"\u001b[90m> \u001b[39m {\"testing\":\"a test\",\"severity\":\"INFO\",\"message\":\"\"}"}}
[2020-08-05T17:23:54.631Z] [runtime-status] [1863] Ephemeral server survived. {"metadata":{"emulator":{"name":"functions"},"function":{"name":"helloWorld"},"message":"[runtime-status] [1863] Ephemeral server survived."}}
i  functions: Finished "helloWorld" in ~1s {"metadata":{"emulator":{"name":"functions"},"function":{"name":"helloWorld"},"message":"Finished \"helloWorld\" in ~1s"}}
[2020-08-05T17:23:54.632Z] [worker-helloWorld-b021e7f9-1c27-465e-bb07-3f303c1926fb]: IDLE {"metadata":{"emulator":{"name":"functions"},"message":"[worker-helloWorld-b021e7f9-1c27-465e-bb07-3f303c1926fb]: IDLE"}}
[2020-08-05T17:23:54.632Z] [work-queue] {"queueLength":0,"workRunningCount":0}
^C[2020-08-05T17:26:45.322Z] Received signal SIGINT (Ctrl-C) 1
 
i  emulators: Received SIGINT (Ctrl-C) for the first time. Starting a clean shutdown. 
i  emulators: Please wait for a clean shutdown or send the SIGINT (Ctrl-C) signal again to stop right now. 
i  emulators: Shutting down emulators. {"metadata":{"emulator":{"name":"hub"},"message":"Shutting down emulators."}}
i  hub: Stopping emulator hub {"metadata":{"emulator":{"name":"hub"},"message":"Stopping emulator hub"}}
i  ui: Stopping Emulator UI {"metadata":{"emulator":{"name":"ui"},"message":"Stopping Emulator UI"}}
i  logging: Stopping Logging Emulator {"metadata":{"emulator":{"name":"logging"},"message":"Stopping Logging Emulator"}}
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"}}
i  database: Stopping Database Emulator {"metadata":{"emulator":{"name":"database"},"message":"Stopping Database Emulator"}}
i  hosting: Stopping Hosting Emulator {"metadata":{"emulator":{"name":"hosting"},"message":"Stopping Hosting Emulator"}}
i  pubsub: Stopping Pub/Sub Emulator {"metadata":{"emulator":{"name":"pubsub"},"message":"Stopping Pub/Sub Emulator"}}
⚠  Emulator UI has exited upon receiving signal: SIGINT 
[2020-08-05T17:26:45.331Z] [worker-~diagnostic~-5c0ca8d4-27b5-43c8-b9d7-9cb1f9ed5c60]: exited {"metadata":{"emulator":{"name":"functions"},"message":"[worker-~diagnostic~-5c0ca8d4-27b5-43c8-b9d7-9cb1f9ed5c60]: exited"}}
[2020-08-05T17:26:45.331Z] [worker-~diagnostic~-5c0ca8d4-27b5-43c8-b9d7-9cb1f9ed5c60]: FINISHED {"metadata":{"emulator":{"name":"functions"},"message":"[worker-~diagnostic~-5c0ca8d4-27b5-43c8-b9d7-9cb1f9ed5c60]: FINISHED"}}
[2020-08-05T17:26:45.331Z] [worker-helloWorld-b021e7f9-1c27-465e-bb07-3f303c1926fb]: exited {"metadata":{"emulator":{"name":"functions"},"message":"[worker-helloWorld-b021e7f9-1c27-465e-bb07-3f303c1926fb]: exited"}}
[2020-08-05T17:26:45.331Z] [worker-helloWorld-b021e7f9-1c27-465e-bb07-3f303c1926fb]: FINISHED {"metadata":{"emulator":{"name":"functions"},"message":"[worker-helloWorld-b021e7f9-1c27-465e-bb07-3f303c1926fb]: FINISHED"}}
[2020-08-05T17:26:45.332Z] *** shutting down gRPC server since JVM is shutting down
 {"metadata":{"emulator":{"name":"firestore"},"message":"*** shutting down gRPC server since JVM is shutting down\n"}}
[2020-08-05T17:26:45.332Z] *** shutting down gRPC server since JVM is shutting down
 {"metadata":{"emulator":{"name":"pubsub"},"message":"*** shutting down gRPC server since JVM is shutting down\n"}}
[2020-08-05T17:26:45.333Z] 18:26:45.330 [Thread-0] INFO com.firebase.server.forge.App$ - Attempting graceful shutdown.
 {"metadata":{"emulator":{"name":"database"},"message":"18:26:45.330 [Thread-0] INFO com.firebase.server.forge.App$ - Attempting graceful shutdown.\n"}}
[2020-08-05T17:26:45.335Z] 18:26:45.335 [Thread-0] INFO com.firebase.server.forge.App$ - Graceful shutdown complete.
 {"metadata":{"emulator":{"name":"database"},"message":"18:26:45.335 [Thread-0] INFO com.firebase.server.forge.App$ - Graceful shutdown complete.\n"}}
[2020-08-05T17:26:45.336Z] *** server shut down {"metadata":{"emulator":{"name":"pubsub"},"message":"*** server shut down"}}
[2020-08-05T17:26:45.336Z] 
 {"metadata":{"emulator":{"name":"pubsub"},"message":"\n"}}
[2020-08-05T17:26:45.344Z] *** server shut down
 {"metadata":{"emulator":{"name":"firestore"},"message":"*** server shut down\n"}}
@es80 es80 changed the title Firebase Firestore emulator do not display any data when run from WSL 2 Ubuntu Firebase Firestore emulator does not display any data when run from WSL 2 Ubuntu Aug 5, 2020
@samtstern
Copy link
Contributor

samtstern commented Aug 6, 2020

@es80 thanks for the logs and the reproduction instructions!

@yuchenshi is this the same WSL error you've been looking into here firebase/firebase-tools-ui#332?

@yuchenshi
Copy link
Member

It's unclear whether this is a connectivity issue or something like that. I have one request for @es80 -- could you please pull up your browser's developer tools, navigate to Network Requests and then refresh the Emulator UI page at the very end?

If things show up after refresh, then you're running into a known issue -- collections are NOT real-time in the viewer. Documents and fields are, but collections themselves will only show up after fresh.

If you see network errors, just screenshot these errors and we'll take a closer look.

@es80
Copy link
Author

es80 commented Aug 6, 2020

Hello. After running the function, refreshing the Firestore Emulator UI shows two network errors:
Capture

The first
Capture2

The second
Capture5

The first one had a request call stack, don't know if that is of any use:
Capture3
Capture4

@es80
Copy link
Author

es80 commented Aug 6, 2020

Also, I noticed that I cannot manually add a root collection. If I type a collection name in the path I can start adding documents but if I navigate back to root they no longer show. Type the path in again and I can get them back. Typing the path to the document my function added displays 'this document does not exist':
Capture
Capture2

@yuchenshi
Copy link
Member

I think you're experiencing firebase/firebase-tools-ui#332.

Navigating to a path won't create that path. To start a collection, click on the "Start collection" menu item under "Root" as shown in your last screenshot. But again, I don't think that is going to work either given the WSL issue.

Please head over to firebase/firebase-tools-ui#332 for workarounds and subscribe for updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants