How to stop sending requests to Firebase Emulators?

Viewed 129

My Project:

Google Cloud Functions sends a SOAP request to a 3rd party API, using a Scheduled Function (Pubsub + Cloud Scheduler), parses, sanitizes and stores the response in Firestore. It's authenticated with a Service Account.

What's Wrong:

It's already deployed and working well in production. After deploy, I installed the new Firebase Emulators, which worked well. However, now it always tries to connect to the emulators when running the shell (the emulators are probably the issue):

npm run shell

In the logs I can see that it's trying to connect to the emulators, but from what I understand it should be bypassing them automatically. I can't find anything in the docs that addresses this.

My Question & Logs:

Does anyone know how to bypass this connection attempt so that I can directly write to Firestore instead of the emulators?

Here are the logs:

    [debug] [2020-06-24T20:16:37.808Z] ----------------------------------------------------------------------
[debug] [2020-06-24T20:16:37.810Z] Command:       C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\firebase-tools\lib\bin\firebase.js functions:shell
[debug] [2020-06-24T20:16:37.811Z] CLI Version:   8.4.3
[debug] [2020-06-24T20:16:37.811Z] Platform:      win32
[debug] [2020-06-24T20:16:37.811Z] Node Version:  v10.18.1
[debug] [2020-06-24T20:16:37.812Z] Time:          Wed Jun 24 2020 17:16:37 GMT-0300 (Atlantic Daylight Time)
[debug] [2020-06-24T20:16:37.812Z] ----------------------------------------------------------------------
[debug] [2020-06-24T20:16:37.812Z] 
[debug] [2020-06-24T20:16:37.822Z] > 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"]
[debug] [2020-06-24T20:16:37.823Z] > authorizing via signed-in user
[debug] [2020-06-24T20:16:37.823Z] [iam] checking project rtiwebservices for permissions ["firebase.projects.get"]
[debug] [2020-06-24T20:16:37.827Z] >>> HTTP REQUEST POST https://cloudresourcemanager.googleapis.com/v1/projects/rtiwebservices:testIamPermissions  
 {"permissions":["firebase.projects.get"]}
[debug] [2020-06-24T20:16:38.208Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Wed, 24 Jun 2020 20:16:35 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","server-timing":"gfet4t7; dur=182","alt-svc":"h3-27=\":443\"; ma=2592000,h3-25=\":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"}
[debug] [2020-06-24T20:16:38.209Z] >>> HTTP REQUEST GET http://localhost:4400/emulators  
 
[debug] [2020-06-24T20:16:40.215Z] Error: connect ECONNREFUSED 127.0.0.1:4400
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1107:14)
[error] 
[error] Error: Server Error. connect ECONNREFUSED 127.0.0.1:4400
0 Answers
Related