-
Notifications
You must be signed in to change notification settings - Fork 952
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
Emulator Functions Regression - Initial Function Requests Time Out #6765
Comments
I encountered the same issue and probably it is caused by this changes of google-gax v4.3.0. |
Thanks for reporting this! This call is to the compute metadata server, which will only ever work on cloud compute instances. Ideally, google-gax would smoothly handle uses outside of cloud, so I've opened googleapis/gax-nodejs#1566 |
Fix for #6765. The latest version of google-gax attempts to read from the metadata server (on an internal IP address). Setting the environment variable METADATA_SERVER_DETECTION=none by default will turn this behavior off. This is overridable with .env.local.
A fix will hopefully come out in next week's CLI release. In the meantime you can work around the issue by putting |
* Disable metadata service detection in the emulator. Fix for #6765. The latest version of google-gax attempts to read from the metadata server (on an internal IP address). Setting the environment variable METADATA_SERVER_DETECTION=none by default will turn this behavior off. This is overridable with .env.local. * changelog
Closing as the fix is in next week's release. |
Same issue with |
I forgot to |
The timeout this issue refers to is still happening to me in GitHub Actions, and this Edit: This issue does not occur if I'm logged in via Even though Maybe my repo's 6.1.0 version doesn't matter since This is with |
Just to note I have also run into this issue if I'm using a local development environment with no GCP (firebase nor application default) credentials and am running the emulator under a demo project. The I'm on latest Since I have this reproduced on my local laptop, ping me if further diagnostics are needed to figure out what's up |
I'm encountering this on firebase-tools 13.15.0 running on Windows 11. Neither METADATA_SERVER_DETECTION="none" or GCE_METADATA_HOST="0.0.0.0" worked. I'm only using functions, firestore, hosting in the emulator. |
@inlined Should this issue be reopened? I and several others are reporting that we're still dealing with the same behavior. |
I do think so. In my case, I'm running the emulator inside a docker container that has no credentials as well, so even with the ENV VARs set, I get the error 'GaxiosError: request to http://0.0.0.0/computeMetadata/v1/universe/universe-domain failed, reason: connect ECONNREFUSED 0.0.0.0:80' |
The METADATA_SERVER_DETECTION override isn't working for me. I've resolved this temporarily:
I'll open a separate issue for this. |
I also found this issue with Firebase CLI v13.18.0 and I fixed it by adding "GCE_METADATA_HOST=localhost:8080" to .env.local Hope this help :) |
@joehan I suggest this issue be reopened. It may have a workaround, but people are still encountering it. |
The I'm instead forcing the GCP residency check to false, and this seems to be working for me:
|
I found the root cause on my end and no longer need to use the fix above. We were using |
[REQUIRED] Environment info
firebase-tools:13.2.1
Platform:macOS
[REQUIRED] Test case
I recently updated a number of firebase dependencies on my library and noticed that hitting the emulator's Firebase functions took a long time and would often time out and be left with an internal error.
I realized that if I turned my wifi/internet connection off that they would run quickly again. I kept noticing the following line:
This is followed by the function timing out:
I dug around and found out that this request was being made through gcp-metadata and timing out since it can't reach the specified IP which I'm guessing is an internal IP to Google Cloud.
I run the emulators in a Docker container and think that the environment is triggering some part of gcp-metadata or the firebase emulators to believe it is running on a Google Cloud instance and is timing out. I didn't notice this behavior while on firebase-tools version
11.17.0
.I checked the versions of gcp-metadata:
For now as a work around I am using the environment variable
GCE_METADATA_HOST
to set the host to 0.0.0.0 for the docker container so that the request fails immediately.In the newer versions of gcp-metadata (^5.3.0) I'd be able to use
METADATA_SERVER_DETECTION=none
.[REQUIRED] Steps to reproduce
You can run the project at https://github.com/dereekb/dbx-components on version v10.0.17 (version v10.0.18 will have the workaround added to the Dockerfile). Run both the server
./serve-server.sh
and web client./serve-web.sh
and go tohttp://localhost:9010/demo/app/profile/view
. Change the profile info to kick off a firebase functions request.[REQUIRED] Expected behavior
Emulator functions should not attempt to connect to or time out while trying to reach "http://169.254.169.254/computeMetadata/v1/universe/universe_domain".
[REQUIRED] Actual behavior
The first emulator function invocation attempts to reach 169.254.169.254 and times out after 60 seconds, causing the initial invocation to return an internal error.
The text was updated successfully, but these errors were encountered: