-
Notifications
You must be signed in to change notification settings - Fork 933
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
The latest Firebase CLI breaks some local extensions #6072
Comments
This issue does not seem to follow the issue template. Make sure you provide all the required information. |
Hi @umaar. I tried to replicate this issue, but I encountered no errors when running the Firebase Extensions emulator. I understand that you used a demo project for this, but since it looks like the extension makes calls to Google Cloud APIs that do not have Emulators, I used an actual project ID to try and repro this. Let me know if I may have made a mistake or missed anything; the steps I took were:
After doing the steps above, a collection was created in the Firestore emulator containing the extracted text and no errors were raised. Could you provide an MCVE or more details on the steps you took so that we can reproduce the issue on our end? Thanks! |
Hi @aalej I believe the reason you could not reproduce is because you've not used a Previously, a Using Firebase extensions in a demo project, regardless of whether they call out to Google Cloud APIs, is a supported feature, and was working fine in As for the steps to reproduce, the steps you have written are correct, but needs to factor in the previously mentioned caveat: this is related to demo projects. Not real project IDs.
So just to clarify, local demo projects were fully compatible with Firebase extensions, but the latest Firebase CLI breaks this. |
Hey @umaar, thanks for reporting this. I dug into the code a bit, and I believe this an issue with the extension code, not with the emulator suite. The extract-images extension makes a call to the Cloud Vision API, as whatever project is provided by the application default credentials (https://github.com/GoogleCloudPlatform/firebase-extensions/blob/73b251dcb06d6495cf9d714bc545548b67ffa87c/storage-extract-image-text/functions/src/index.ts#L48). Since the demo project does not exist and there is no Cloud Vision emulator, this call fails. Although the extensions emulator does support I don't think this was caused by a new version of the CLI - I tested this on 12.4.2, 12.4.0, and 12.0.0 with the same results each time. If this was working in the past for you, its possible that you had GOOGLE_APPLICATION_CREDENTIALS set to a service account from a different project, and the extension's code picked that up & called the Cloud Vision API as that project. |
Thank you so much for investigating this one! I'm happy to file a bug in any place you think is best. But I thought I'd give a full output of:
I think the thing that's throwing me off, is if the same extension code is being used, how are we seeing different results based on the Firebase CLI version? Wouldn't that suggest the Firebase CLI introduced a breaking change, or maybe handles certain extensions differently? Anyway, here's the logs of those 3 scenarios, maybe it helps with figuring something out, or maybe it reinforces your suspicion that it's an extension bug! If the latter, I'll file it in their repo. ➜ echo $GOOGLE_APPLICATION_CREDENTIALS
# <nothing>
➜ firebase --version
# 12.4.0 Output of using the translate extension:
Output of using the text to speech extension:
Run: ➜ export GOOGLE_APPLICATION_CREDENTIALS="creds.json"
➜ echo $GOOGLE_APPLICATION_CREDENTIALS
# creds.json Re-run the firebase emulators:start command and trigger the translate extension (it works as expected):
Output of using the text to speech extension (it works):
Update firebase-tools npm install -g firebase-tools
➜ firebase --version
# 12.4.3
➜ echo $GOOGLE_APPLICATION_CREDENTIALS
# creds.json Re-run the firebase emulators:start command. The translate extension works, but how about triggering the text to speech extension:
That's it for now, but I think it's worth noting
This is indeed the case! And my (maybe naive) understanding is that this is expected behaviour. But what's left unclear, is if this is working on 12.4.0, why isn't it working after upgrading the Firebase CLI. If the extension code can successfully use the service account of a different project with the older Firebase CLI, why can the same extension not use that same service account of a different project with the newer Firebase CLI? Thanks again for digging into this and if I need to file this elsewhere, let me know! |
Environment info
firebase-tools: 12.4.2
Platform: macOS
Has the new Firebase CLI changed how Extensions work? Because things aren't working for me anymore:
This was working fine previously, using local Firebase demo projects. After having upgraded Firebase to 12.4.2, it has stopped working showing the error above.
To reproduce, just install an extension in a local Firebase demo project, for example
googlecloud/storage-extract-image-text
. The extension doesn't work on the latest Firebase CLI.The text was updated successfully, but these errors were encountered: