firebase-tools: HTTP Error: 503 in functions emulator adding trigger when using host 0.0.0.0

[REQUIRED] Environment info

firebase-tools: 8.11.0

Platform: macOS

[REQUIRED] Test case

In my firebase.json, I have the following:

"emulators": {
    "firestore": {
     "host": "0.0.0.0",
     "port": 8090
    },
    "functions": {
     "host": "0.0.0.0",
     "port": 5001
    }
   },

[REQUIRED] Steps to reproduce

I then try running the emulators:

npx firebase emulators:start --only functions,firestore

I eventually get the error message Error: HTTP Error: 503, io exception and then the emulators stop automatically.

If I remove the host value entirely from the firebase.json or if I add my computer’s IP address like 192.168.1.58, it will work perfectly, just not with 0.0.0.0

[REQUIRED] Expected behavior

The emulators run without errors

[REQUIRED] Actual behavior

The emulators run for about 10 seconds then stop with the following error: Error: HTTP Error: 503, io exception

[debug] [2020-09-22T21:14:22.445Z] [worker-~diagnostic~-b2802790-9d42-42d7-ab88-a952d1dba926]: IDLE {"metadata":{"emulator":{"name":"functions"},"message":"[worker-~diagnostic~-b2802790-9d42-42d7-ab88-a952d1dba926]: IDLE"}}
[debug] [2020-09-22T21:14:22.485Z] Sep 22, 2020 4:14:22 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
INFO: Detected non-HTTP/2 connection.
 {"metadata":{"emulator":{"name":"firestore"},"message":"Sep 22, 2020 4:14:22 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead\nINFO: Detected non-HTTP/2 connection.\n"}}
[debug] [2020-09-22T21:14:52.620Z] Sep 22, 2020 4:14:52 PM io.gapi.emulators.netty.HttpHandler$1 onError
INFO: Exception when handling request: UNAVAILABLE: io exception
 {"metadata":{"emulator":{"name":"firestore"},"message":"Sep 22, 2020 4:14:52 PM io.gapi.emulators.netty.HttpHandler$1 onError\nINFO: Exception when handling request: UNAVAILABLE: io exception\n"}}
[debug] [2020-09-22T21:14:52.627Z] <<< HTTP RESPONSE 503 {"content-type":"application/json","content-length":"70"}
[debug] [2020-09-22T21:14:52.627Z] <<< HTTP RESPONSE BODY {"error":{"code":503,"message":"io exception","status":"UNAVAILABLE"}}
[warn] ⚠  Error adding trigger: FirebaseError: HTTP Error: 503, io exception {"metadata":{"emulator":{"name":"functions"},"message":"Error adding trigger: FirebaseError: HTTP Error: 503, io exception"}}
[info] i  emulators: Shutting down emulators. {"metadata":{"emulator":{"name":"hub"},"message":"Shutting down emulators."}}
[info] i  hub: Stopping emulator hub {"metadata":{"emulator":{"name":"hub"},"message":"Stopping emulator hub"}}
[info] i  ui: Stopping Emulator UI {"metadata":{"emulator":{"name":"ui"},"message":"Stopping Emulator UI"}}
[info] i  logging: Stopping Logging Emulator {"metadata":{"emulator":{"name":"logging"},"message":"Stopping Logging Emulator"}}
[info] i  functions: Stopping Functions Emulator {"metadata":{"emulator":{"name":"functions"},"message":"Stopping Functions Emulator"}}
[info] i  firestore: Stopping Firestore Emulator {"metadata":{"emulator":{"name":"firestore"},"message":"Stopping Firestore Emulator"}}
[warn] ⚠  Emulator UI has exited upon receiving signal: SIGINT 
[debug] [2020-09-22T21:14:52.634Z] *** shutting down gRPC server since JVM is shutting down
 {"metadata":{"emulator":{"name":"firestore"},"message":"*** shutting down gRPC server since JVM is shutting down\n"}}
[debug] [2020-09-22T21:14:52.638Z] *** server shut down
 {"metadata":{"emulator":{"name":"firestore"},"message":"*** server shut down\n"}}
[debug] [2020-09-22T21:14:52.640Z] [worker-~diagnostic~-b2802790-9d42-42d7-ab88-a952d1dba926]: exited {"metadata":{"emulator":{"name":"functions"},"message":"[worker-~diagnostic~-b2802790-9d42-42d7-ab88-a952d1dba926]: exited"}}
[debug] [2020-09-22T21:14:52.640Z] [worker-~diagnostic~-b2802790-9d42-42d7-ab88-a952d1dba926]: FINISHED {"metadata":{"emulator":{"name":"functions"},"message":"[worker-~diagnostic~-b2802790-9d42-42d7-ab88-a952d1dba926]: FINISHED"}}
[error] 
[error] Error: HTTP Error: 503, io exception
[debug] [2020-09-22T21:14:52.984Z] Error Context: {
  "body": {
    "error": {
      "code": 503,
      "message": "io exception",
      "status": "UNAVAILABLE"
    }
  },
  "response": {
    "statusCode": 503,
    "body": "{\"error\":{\"code\":503,\"message\":\"io exception\",\"status\":\"UNAVAILABLE\"}}",
    "headers": {
      "content-type": "application/json",
      "content-length": "70"
    },
    "request": {
      "uri": {
        "protocol": "http:",
        "slashes": true,
        "auth": null,
        "host": "0.0.0.0:8090",
        "port": "8090",
        "hostname": "0.0.0.0",
        "hash": null,
        "search": null,
        "query": null,
        "pathname": "/emulator/v1/projects/myproject/triggers/myproject/join_notifications-replies-triggers-sendNotification",
        "path": "/emulator/v1/projects/myproject/triggers/myproject/join_notifications-replies-triggers-sendNotification",
        "href": "http://0.0.0.0:8090/emulator/v1/projects/myproject/triggers/myproject-join_notifications-replies-triggers-sendNotification"
      },
      "method": "PUT"
    }
  }
}

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 2
  • Comments: 19 (7 by maintainers)

Most upvoted comments

I think I have a related issue, only for the RTDB emulator. I have functions, firestore and database emulators enabled, each with host set to “0.0.0.0”. Running firebase emulators:start would initialize and load everything, then shut down with “unexpected error”. I checked the database-debug.log and it shows: [FirebaseWorkerPool-1-2] WARN com.firebase.core.namespace.NamespaceActorSystem - Request for ns: project-{omitted} has incorrect domain. Current domain: 0.0.0.0, expected domain: firebaseio-staging.com.

When I remove the “host” line for the database in firebase.json, then everything works fine over localhost, but I need to be able to connect my physical device on the same network to the emulators, which doesn’t work when using localhost.

firebase --version: 8.13.1

I’m running into the same issue with the database when running in Docker and trying to map to 0.0.0.0 - all the other emulators are working as expected. @samtstern any ideas what’s going on? Do you need help reproducing?