Resource_Error
Hi Firebase Team
i get the following message when i try to install the firebase or algolia extension with the console and cli
RESOURCE_ERROR at /deployments/firebase-ext-firestore-typesense-search/resources/backfillToTypesenseFromFirestore: {"ResourceType":"gcp-types/cloudfunctions-v1:projects.locations.functions","ResourceErrorCode":"400","ResourceErrorMessage":"Build failed: {"metrics":{},"error":{"buildpackId":"","buildpackVersion":"","errorType":"OK","canonicalCode":"OK","errorId":"","errorMessage":""},"stats":[{"buildpackId":"google.nodejs.runtime","buildpackVersion":"1.0.0","totalDurationMs":1496,"userDurationMs":0},{"buildpackId":"google.utils.archive-source","buildpackVersion":"0.0.1","totalDurationMs":45,"userDurationMs":44},{"buildpackId":"google.nodejs.npm","buildpackVersion":"1.0.0","totalDurationMs":6428,"userDurationMs":6185},{"buildpackId":"google.nodejs.functions-framework","buildpackVersion":"0.9.4","totalDurationMs":3756,"userDurationMs":3541},{"buildpackId":"google.config.entrypoint","buildpackVersion":"0.9.0","totalDurationMs":0,"userDurationMs":0},{"buildpackId":"google.utils.label","buildpackVersion":"0.0.2","totalDurationMs":0,"userDurationMs":0}],"warnings":null,"customImage":false}"}; RESOURCE_ERROR at /deployments/firebase-ext-firestore-typesense-search/resources/indexToTypesenseOnFirestoreWrite: {"ResourceType":"gcp-types/cloudfunctions-v1:projects.locations.functions","ResourceErrorCode":"400","ResourceErrorMessage":"Build failed: {"metrics":{},"error":{"buildpackId":"","buildpackVersion":"","errorType":"OK","canonicalCode":"OK","errorId":"","errorMessage":""},"stats":[{"buildpackId":"google.nodejs.runtime","buildpackVersion":"1.0.0","totalDurationMs":1485,"userDurationMs":0},{"buildpackId":"google.utils.archive-source","buildpackVersion":"0.0.1","totalDurationMs":59,"userDurationMs":59},{"buildpackId":"google.nodejs.npm","buildpackVersion":"1.0.0","totalDurationMs":6677,"userDurationMs":6425},{"buildpackId":"google.nodejs.functions-framework","buildpackVersion":"0.9.4","totalDurationMs":3689,"userDurationMs":3477},{"buildpackId":"google.config.entrypoint","buildpackVersion":"0.9.0","totalDurationMs":0,"userDurationMs":0},{"buildpackId":"google.utils.label","buildpackVersion":"0.0.2","totalDurationMs":0,"userDurationMs":0}],"warnings":null,"customImage":false}"}
when i look at the cloud functions, there is a warning that the functions could not be built. Log message from the function:
Build failed: {"metrics":{},"error":{"buildpackId":"","buildpackVersion":"","errorType":"OK","canonicalCode":"OK","errorId":"","errorMessage":""},"stats":[{"buildpackId":"google.nodejs.runtime","buildpackVersion":"1.0.0","totalDurationMs":1437,"userDurationMs":0},{"buildpackId":"google.utils.archive-source","buildpackVersion":"0.0.1","totalDurationMs":42,"userDurationMs":42},{"buildpackId":"google.nodejs.npm","buildpackVersion":"1.0.0","totalDurationMs":6883,"userDurationMs":6640},{"buildpackId":"google.nodejs.functions-framework","buildpackVersion":"0.9.4","totalDurationMs":3529,"userDurationMs":3323},{"buildpackId":"google.config.entrypoint","buildpackVersion":"0.9.0","totalDurationMs":0,"userDurationMs":0},{"buildpackId":"google.utils.label","buildpackVersion":"0.0.2","totalDurationMs":0,"userDurationMs":0}],"warnings":null,"customImage":false}
Thanks Michael
I just found it - this happens when you redirect traffic from the container registry to the artefact registry. Unfortunately i already finalized the redirect. is there an other way to fix this issue?
Hi @mibto
Thanks for the feedback, from your description could this be an issue for the CLI or Cloud Platform team? For example https://github.com/firebase/firebase-tools
Hi @dackers86
uff i have no idea who the right team would be for this issue. I can create the issue there, if someone can point me to the correct location.
But i'm quite sure that its not the CLI team
@pavelgj Do you know which team would be best for this type of issue?
I just found the "solution"
--> go to https://console.cloud.google.com/functions -> edit the functions -> expand "Runtime, build, connections and security settings", select "SECURITY AND IMAGE REPO", under "Image repository", select "Google managed Artifact Registry".
would be nice if the extension could detect if you are using the container registry or artefact registry and deploy the functions accordingly
@mibto Do you mind going into the Cloud Build console (https://console.cloud.google.com/cloud-build/builds) and find the specific build error (it contains more details)? It would help with troubleshooting.
We are working on migrating to Artifact Registry and there are some known issues (some of which appear to be very similar to what you're experiencing).
@pavelgj Sorry for the late answer. I get the following Error entry: "build": ERROR: failed to export: failed to write image to the following tags: [eu.gcr.io/workid-d9387/gcf/europe-west6/b31a43cd-0ef1-485e-8744-1a2516637136:ext-firestore-typesense-search-indexToTypesenseOnFirestoreWrite_version-1: GET https://eu.gcr.io/v2/token?scope=repository%3Aworkid-d9387%2Fgcf%2Feurope-west6%2Fb31a43cd-0ef1-485e-8744-1a2516637136%3Apush%2Cpull&scope=repository%3Agae-runtimes%2Fbuildpacks%2Fnodejs14%2Frun%3Apull&service=eu.gcr.io: DENIED: Permission "artifactregistry.repositories.downloadArtifacts" denied on resource "projects/gae-runtimes/locations/europe/repositories/eu.gcr.io" (or it may not exist)]
@mibto you're a life saver..that was happening to me too now as I was trying to add Firebase Algolia extension to my project.
For Firebase team: My scenario is essentially the same but with a different extension.
My log was not really helpful tho: "Build failed: Build error details not available.Please check the logs at https://console.cloud.google.com/cloud-build/builds;....." (code 13)
Installing Algolia extension to Firebase fails the first time, then you press Try install again and it "works" (functions and everything else are actually created at GCP but all failing)...so after "installing" I just need to go to the functions created by Algolia extension and perform the steps mentioned by @mibto and redeploy.
That's definitely I use case for you guys to check...without this issue here it would be almost impossible to figure out why the extension did not work.
Maybe you can add a step to either enable the necessary APIs (for Algolia Firebase this already happens to enable functions secret manage and tasks clouds so you might as well make sure the correct registry is enabled) or just enable to select the registry (this make less sense as everything is going to Artifact registry anyway as far as I understood)
Thanks again, @mibto
Closing as this may be resolved. Happy to re-open if the issue appears again.