question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The Cloud Firestore emulator is not running

See original GitHub issue

[REQUIRED] Environment info

firebase-tools: v8.15.1

Platform: macOS

[REQUIRED] Test cases

Start emulators. Start function shell.

[REQUIRED] Steps to reproduce

Really unsure. I ran firebase emulators:start --only functions,firestore and it works fine, the emulators I mean. Then I run firebase functions:shell and test my functions and functions do not update when I save them.

[REQUIRED] Expected behavior

For the functions shell to update my functions when I update them after running firebase:shell and for it to detect that my emulator is running locally.

[REQUIRED] Actual behavior

Output of firebase functions:shell:


$ firebase functions:shell
⚠  functions: Your GOOGLE_APPLICATION_CREDENTIALS environment variable points to /Users/user/dev/project/app/serviceKey.json. Non-emulated services will access production using these credentials. Be careful!
⚠  functions: The Cloud Firestore emulator is not running, so calls to Firestore will affect production.
i  functions: Loaded functions: ..., nuxtssr
i  functions: Connected to running firestore emulator at localhost:8080, calls to this service will affect the emulator
⚠  functions: The following emulators are not running, calls to these services will affect production: database, pubsub

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
rublevcommented, Nov 12, 2020

Turns out everything is fine. All I had to do was call it with test.testFunction3('') instead of test.testFunction3() like before. Why do I have to add data to the parameter now magically to get it working? I have no idea, nowhere did I see this in a changelog or anything. Yesterday it stopped working, now adding an empty string param has it executing just fine.

Love losing 2 days for zero reason. Lovely.

0reactions
rublevcommented, Nov 11, 2020

functions code:

const admin = require('firebase-admin')

const functions = require('firebase-functions')

exports.testFunction2 = functions.https.onCall((data, context) => {
  console.log('test')
  return { test1: true }
})

No matter what code I changed in my function, I get:

firebase > >  {"severity":"WARNING","message":"Request body is missing data."}
>  {"severity":"ERROR","message":"Invalid request, unable to process."}

RESPONSE RECEIVED FROM FUNCTION: 400, {
  "error": {
    "message": "Bad Request",
    "status": "INVALID_ARGUMENT"
  }
}

If I change the function name to testFunction3 or anything else, it updates in the emulator a la: ✔ functions[test-testFunction2]: http function initialized (http://localhost:5001/proj-1234/us-central1/test-testFunction2). but it always yields the same error and never prints the log. Same when I visit the 5001/proj-1234/us-central1/test-testFunction2 URL, same output every time:

{
error: {
message: "Bad Request",
status: "INVALID_ARGUMENT"
}
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Firestore/Firebase Emulator Not Running - Stack Overflow
Run firebase emulators:start . Check if displayed error request to install OpenJDK. · You may need to emulate functions and firestore at the...
Read more >
Connect your app to the Cloud Firestore Emulator - Firebase
If your app attempts to interact with a resource for which an emulator isn't running, that code will fail. We recommend you use...
Read more >
"The Cloud Firestore emulator is not running, so calls ... - Reddit
You are running the functions emulator, but not the Firestore one. Check out https://firebase.google.com/docs/emulator-suite/connect_firestore.
Read more >
Port 8080 is not open on localhost, could not start Firestore ...
This error is because of the failed quitting from firebase emulator. You already have the process of previous firebase emulator. For a new...
Read more >
The Full Guide on how to use the Firebase Emulator for the Web
The Firestore emulator will show you a local instance of your Firestore DB ... sure you have Firebase Cloud Functions initialized in your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found