firebase / firebase-tools

The Firebase Command Line Tools
MIT License
3.99k stars 920 forks source link

Firebase deploy error. Container import failed #7431

Closed genyklemberg closed 1 month ago

genyklemberg commented 1 month ago

[REQUIRED] Environment info

firebase-tools:13.13.1 & 13.13.0

Platform: Windows

[REQUIRED] Test case

I am using firebase hosting with framworks (SSR with Angular Universal). It started one week ago at Thursday 04.07. (maybe it was a case before). I used "firebase deploy" it hang for a long time on Node.js version 20 update. As a result I had container import failed. In logs I could see that it was looking for container in folder ssrhobbytostar with tag version_1 which I couldn't locate in Artifact Registry, but I hade ssrhobbytostar/cache there. Next time I could deploy properly while deleting ssrhobbytostar/cache folder, this time I saw that during deploy There srhobbytostar/cache and ssrhobbytostar are processed, but afterwards only srhobbytostar/cache is left. Don't know but maybe in the process of deploy temporary image in folder ssrhobbytostar is deleted to early, when it is still should be used? Screenshot 2024-07-08 135036 photo_2024-07-08_13-49-16

[REQUIRED] Steps to reproduce

firebase deploy

[REQUIRED] Expected behavior

new image should be deployed and traffic should be routed to this image

[REQUIRED] Actual behavior

image with erro is listed in cloud run revisions. Error: container import failed

firebase deploy --debug [2024-07-10T19:35:37.791Z] > 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"] [2024-07-10T19:35:37.792Z] > authorizing via signed-in user (y.potupa@gmail.com) [2024-07-10T19:35:37.793Z] [iam] checking project hobbytostar for permissions ["firebase.projects.get","firebasehosting.sites.update"]
[2024-07-10T19:35:37.794Z] >>> [apiv2][query] POST https://cloudresourcemanager.googleapis.com/v1/projects/hobbytostar:testIamPermissions [none] [2024-07-10T19:35:37.794Z] >>> [apiv2][(partial)header] POST https://cloudresourcemanager.googleapis.com/v1/projects/hobbytostar:testIamPermissions x-goog-quota-user=projects/hobbytostar [2024-07-10T19:35:37.795Z] >>> [apiv2][body] POST https://cloudresourcemanager.googleapis.com/v1/projects/hobbytostar:testIamPermissions {"permissions":["firebase.projects.get","firebasehosting.sites.update"]} [2024-07-10T19:35:38.049Z] <<< [apiv2][status] POST https://cloudresourcemanager.googleapis.com/v1/projects/hobbytostar:testIamPermissions 200 [2024-07-10T19:35:38.049Z] <<< [apiv2][body] POST https://cloudresourcemanager.googleapis.com/v1/projects/hobbytostar:testIamPermissions {"permissions":["firebase.projects.get","firebasehosting.sites.update"]} [2024-07-10T19:35:38.050Z] >>> [apiv2][query] GET https://firebase.googleapis.com/v1beta1/projects/hobbytostar [none] [2024-07-10T19:35:38.395Z] <<< [apiv2][status] GET https://firebase.googleapis.com/v1beta1/projects/hobbytostar 200 [2024-07-10T19:35:38.395Z] <<< [apiv2][body] GET https://firebase.googleapis.com/v1beta1/projects/hobbytostar {"projectId":"hobbytostar","projectNumber":"407990140910","displayName":"HobbyToStar","name":"projects/hobbytostar","resources":{"hostingSite":"hobbytostar"},"state":"ACTIVE","etag":"1_46570756-f8bb-48cf-95b3-8551227cd979"} [2024-07-10T19:35:41.200Z] >>> [apiv2][query] GET https://firebasehosting.googleapis.com/v1beta1/projects/hobbytostar/sites pageToken=&pageSize=10 [2024-07-10T19:35:42.174Z] <<< [apiv2][status] GET https://firebasehosting.googleapis.com/v1beta1/projects/hobbytostar/sites 200 [2024-07-10T19:35:42.175Z] <<< [apiv2][body] GET https://firebasehosting.googleapis.com/v1beta1/projects/hobbytostar/sites {"sites":[{"name":"projects/hobbytostar/sites/hobbytostar","defaultUrl":"https://hobbytostar.web.app","appId":"1:407990140910:web:20a76c0f9e4116f88618ff","type":"DEFAULT_SITE"}]} [2024-07-10T19:35:42.176Z] >>> [apiv2][query] GET https://firebase.googleapis.com/v1beta1/projects/-/webApps/1:407990140910:web:20a76c0f9e4116f88618ff/config [none] [2024-07-10T19:35:42.774Z] <<< [apiv2][status] GET https://firebase.googleapis.com/v1beta1/projects/-/webApps/1:407990140910:web:20a76c0f9e4116f88618ff/config 200 [2024-07-10T19:35:42.775Z] <<< [apiv2][body] GET https://firebase.googleapis.com/v1beta1/projects/-/webApps/1:407990140910:web:20a76c0f9e4116f88618ff/config {"projectId":"hobbytostar","appId":"1:407990140910:web:20a76c0f9e4116f88618ff","storageBucket":"hobbytostar.appspot.com","apiKey":"---apiKey---","authDomain":"hobbytostar.firebaseapp.com","messagingSenderId":"407990140910","measurementId":"G-BTVWX17GFV"}

Thank you for trying our early preview of Angular support on Firebase Hosting. During the preview, support is best-effort and breaking changes can be expected. Proceed with caution. The integration is known to work with Angular version 14 - 17. You may encounter errors.

Documentation: https://firebase.google.com/docs/hosting/frameworks/angular File a bug: https://github.com/firebase/firebase-tools/issues/new?template=bug_report.md Submit a feature request: https://github.com/firebase/firebase-tools/issues/new?template=feature_request.md

We'd love to learn from you. Express your interest in helping us shape the future of Firebase Hosting: https://goo.gle/41enW5X

WARNING: Your package.json contains a custom build that is being ignored. Only the Angular default build script (e.g, "ng build") is respected. If you have a more advanced build process you should build a custom integration https://firebase.google.com/docs/hosting/express

Browser bundles Initial chunk files | Names | Raw size | Estimated transfer size main-ZCHLWERM.js | main | 438.57 kB | 79.33 kB styles-ZLGC6EMZ.css | styles | 402.43 kB | 48.79 kB chunk-Q3PNQTN4.js | - | 181.30 kB | 53.84 kB chunk-4L65SEPY.js | - | 165.95 kB | 40.39 kB chunk-ORTNJU4F.js | - | 141.89 kB | 35.99 kB chunk-UHOLHNU4.js | - | 83.99 kB | 16.24 kB polyfills-GCZBSXTI.js | polyfills | 38.61 kB | 12.12 kB

                    | Initial total               |   1.45 MB |               286.69 kB

Lazy chunk files | Names | Raw size | Estimated transfer size chunk-4ORXGC2O.js | city-page-component | 105.43 kB | 21.26 kB chunk-KJAA7APO.js | euro2024-component | 55.65 kB | 10.92 kB chunk-5ENIOIPR.js | privacy-policy-component | 23.65 kB | 6.26 kB chunk-LOUQPWQD.js | - | 19.70 kB | 2.27 kB chunk-5WNM5RHT.js | team-page-component | 10.56 kB | 2.68 kB chunk-ZYORLNWP.js | - | 8.24 kB | 2.34 kB chunk-WIE6QXJV.js | terms-of-services-component | 5.84 kB | 2.02 kB chunk-YRZCFSEF.js | euro2024-module | 766 bytes | 766 bytes

Server bundles Initial chunk files | Names | Raw size server.mjs | server | 1.11 MB | chunk-LGDR3IUD.mjs | - | 379.18 kB | chunk-FDGQ32PE.mjs | - | 303.39 kB | polyfills.server.mjs | polyfills.server | 272.68 kB | chunk-72RLQ3ND.mjs | - | 198.84 kB | chunk-QYXV46JU.mjs | - | 161.73 kB | chunk-NILR2GB7.mjs | - | 142.04 kB | chunk-4B4GMJBI.mjs | - | 84.09 kB | chunk-JSAJ2Y7H.mjs | - | 4.44 kB | chunk-SC2DBT46.mjs | - | 2.62 kB | render-utils.server.mjs | render-utils.server | 1.64 kB | main.server.mjs | main.server | 369 bytes |

Lazy chunk files | Names | Raw size chunk-W5253BLB.mjs | city-page-component | 105.52 kB | chunk-RJTR4Q3W.mjs | euro2024-component | 55.75 kB | chunk-3XOMWANE.mjs | privacy-policy-component | 23.71 kB | chunk-4X3NIHUO.mjs | - | 19.73 kB | chunk-3OJKXNCX.mjs | xhr2 | 12.15 kB | chunk-BGFSSJGS.mjs | team-page-component | 10.66 kB | chunk-NBDOT5MB.mjs | - | 8.28 kB | chunk-XFLNXQSF.mjs | terms-of-services-component | 5.90 kB | chunk-K6VD3T23.mjs | euro2024-module | 833 bytes |

Prerendered 8 static routes. Output location: C:\Users\YevheniyPotupa\code\hobbytostar_lp\dist\hobbytostar_lp

Application bundle generation complete. [10.155 seconds]

up to date in 8s

28 packages are looking for funding run npm fund for details [2024-07-10T19:36:15.429Z] [web frameworks] effective firebase.json: { "hosting": [ { "source": ".", "ignore": [ "firebase.json", "*/.", "/node_modules/" ], "frameworksBackend": { "region": "europe-west1" }, "site": "hobbytostar", "rewrites": [ { "source": "/", "function": { "functionId": "ssrhobbytostar", "region": "europe-west1", "pinTag": true } } ], "redirects": [], "headers": [ { "source": "//*.[jt]s", "headers": [ { "key": "Set-Cookie", "value": "__FIREBASE_DEFAULTS__=eyJjb25maWciOnsicHJvamVjdElkIjoiaG9iYnl0b3N0YXIiLCJhcHBJZCI6IjE6NDA3OTkwMTQwOTEwOndlYjoyMGE3NmMwZjllNDExNmY4ODYxOGZmIiwic3RvcmFnZUJ1Y2tldCI6ImhvYmJ5dG9zdGFyLmFwcHNwb3QuY29tIiwiYXBpS2V5IjoiQUl6YVN5QTd6VDNVaFR6ZENFcEVQZkVjb1F3VjFYbmNqbWlfWWZNIiwiYXV0aERvbWFpbiI6ImhvYmJ5dG9zdGFyLmZpcmViYXNlYXBwLmNvbSIsIm1lc3NhZ2luZ1NlbmRlcklkIjoiNDA3OTkwMTQwOTEwIiwibWVhc3VyZW1lbnRJZCI6IkctQlRWV1gxN0dGViJ9LCJfYXV0aFRva2VuU3luY1VSTCI6Ii9fX3Nlc3Npb24ifQ; SameSite=Strict; Expires=2026-06-05T06:16:15.429Z; Path=/;" } ] } ], "cleanUrls": true, "i18n": { "root": "/" }, "public": ".firebase\hobbytostar\hosting", "webFramework": "angular_ssr" } ], "functions": [ { "source": ".firebase\hobbytostar\functions", "codebase": "firebase-frameworks-hobbytostar" } ] } [2024-07-10T19:36:15.432Z] > 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"] [2024-07-10T19:36:15.432Z] > authorizing via signed-in user (y.potupa@gmail.com) [2024-07-10T19:36:15.432Z] [iam] checking project hobbytostar for permissions ["cloudfunctions.functions.create","cloudfunctions.functions.delete","cloudfunctions.functions.get","cloudfunctions.functions.list","cloudfunctions.functions.update","cloudfunctions.operations.get","firebase.projects.get"] [2024-07-10T19:36:15.433Z] >>> [apiv2][query] POST https://cloudresourcemanager.googleapis.com/v1/projects/hobbytostar:testIamPermissions [none] [2024-07-10T19:36:15.433Z] >>> [apiv2][(partial)header] POST https://cloudresourcemanager.googleapis.com/v1/projects/hobbytostar:testIamPermissions x-goog-quota-user=projects/hobbytostar [2024-07-10T19:36:15.433Z] >>> [apiv2][body] POST https://cloudresourcemanager.googleapis.com/v1/projects/hobbytostar:testIamPermissions {"permissions":["cloudfunctions.functions.create","cloudfunctions.functions.delete","cloudfunctions.functions.get","cloudfunctions.functions.list","cloudfunctions.functions.update","cloudfunctions.operations.get","firebase.projects.get"]} [2024-07-10T19:36:16.151Z] <<< [apiv2][status] POST https://cloudresourcemanager.googleapis.com/v1/projects/hobbytostar:testIamPermissions 200 [2024-07-10T19:36:16.151Z] <<< [apiv2][body] POST https://cloudresourcemanager.googleapis.com/v1/projects/hobbytostar:testIamPermissions {"permissions":["cloudfunctions.functions.create","cloudfunctions.functions.delete","cloudfunctions.functions.get","cloudfunctions.functions.list","cloudfunctions.functions.update","cloudfunctions.operations.get","firebase.projects.get"]}

=== Deploying to 'hobbytostar'...

i deploying functions, hosting [2024-07-10T19:36:16.158Z] >>> [apiv2][query] GET https://firebase.googleapis.com/v1beta1/projects/hobbytostar [none] [2024-07-10T19:36:16.432Z] <<< [apiv2][status] GET https://firebase.googleapis.com/v1beta1/projects/hobbytostar 200 [2024-07-10T19:36:16.433Z] <<< [apiv2][body] GET https://firebase.googleapis.com/v1beta1/projects/hobbytostar {"projectId":"hobbytostar","projectNumber":"407990140910","displayName":"HobbyToStar","name":"projects/hobbytostar","resources":{"hostingSite":"hobbytostar"},"state":"ACTIVE","etag":"1_46570756-f8bb-48cf-95b3-8551227cd979"} i functions: preparing codebase firebase-frameworks-hobbytostar for deployment i functions: ensuring required API cloudfunctions.googleapis.com is enabled... i functions: ensuring required API cloudbuild.googleapis.com is enabled... i artifactregistry: ensuring required API artifactregistry.googleapis.com is enabled... [2024-07-10T19:36:16.439Z] >>> [apiv2][query] GET https://serviceusage.googleapis.com/v1/projects/hobbytostar/services/cloudfunctions.googleapis.com [none] [2024-07-10T19:36:16.440Z] >>> [apiv2][(partial)header] GET https://serviceusage.googleapis.com/v1/projects/hobbytostar/services/cloudfunctions.googleapis.com x-goog-quota-user=projects/hobbytostar [2024-07-10T19:36:16.442Z] >>> [apiv2][query] GET https://serviceusage.googleapis.com/v1/projects/hobbytostar/services/runtimeconfig.googleapis.com [none] [2024-07-10T19:36:16.443Z] >>> [apiv2][(partial)header] GET https://serviceusage.googleapis.com/v1/projects/hobbytostar/services/runtimeconfig.googleapis.com x-goog-quota-user=projects/hobbytostar [2024-07-10T19:36:16.444Z] >>> [apiv2][query] GET https://serviceusage.googleapis.com/v1/projects/hobbytostar/services/cloudbuild.googleapis.com [none] [2024-07-10T19:36:16.445Z] >>> [apiv2][(partial)header] GET https://serviceusage.googleapis.com/v1/projects/hobbytostar/services/cloudbuild.googleapis.com x-goog-quota-user=projects/hobbytostar [2024-07-10T19:36:16.447Z] >>> [apiv2][query] GET https://serviceusage.googleapis.com/v1/projects/hobbytostar/services/artifactregistry.googleapis.com [none] [2024-07-10T19:36:16.447Z] >>> [apiv2][(partial)header] GET https://serviceusage.googleapis.com/v1/projects/hobbytostar/services/artifactregistry.googleapis.com x-goog-quota-user=projects/hobbytostar [2024-07-10T19:36:17.086Z] <<< [apiv2][status] GET https://serviceusage.googleapis.com/v1/projects/hobbytostar/services/cloudbuild.googleapis.com 200 [2024-07-10T19:36:17.086Z] <<< [apiv2][body] GET https://serviceusage.googleapis.com/v1/projects/hobbytostar/services/cloudbuild.googleapis.com [omitted]

[2024-07-10T19:36:19.222Z] Got response from //functions.yaml {"endpoints":{"ssrhobbytostar":{"availableMemoryMb":null,"timeoutSeconds":null,"minInstances":null,"maxInstances":null,"ingressSettings":null,"concurrency":null,"serviceAccountEmail":null,"vpc":null,"platform":"gcfv2","region":["europe-west1"],"labels":{},"httpsTrigger":{},"entryPoint":"ssrhobbytostar"}},"specVersion":"v1alpha1","requiredAPIs":[]} i functions: Loaded environment variables from .env. i functions: preparing .firebase\hobbytostar\functions directory for uploading... i functions: packaged C:\Users\YevheniyPotupa\code\hobbytostar_lp.firebase\hobbytostar\functions (15.52 MB) for uploading [2024-07-10T19:36:25.148Z] >>> [apiv2][query] GET https://cloudfunctions.googleapis.com/v1/projects/hobbytostar/locations/-/functions [none]
[2024-07-10T19:36:25.733Z] <<< [apiv2][status] GET https://cloudfunctions.googleapis.com/v1/projects/hobbytostar/locations/-/functions 200 [2024-07-10T19:36:25.734Z] <<< [apiv2][body] GET https://cloudfunctions.googleapis.com/v1/projects/hobbytostar/locations/-/functions {}
[2024-07-10T19:36:25.734Z] >>> [apiv2][query] GET https://cloudfunctions.googleapis.com/v2/projects/hobbytostar/locations/-/functions filter=environment%3D%22GEN_2%22 [2024-07-10T19:36:26.262Z] <<< [apiv2][status] GET https://cloudfunctions.googleapis.com/v2/projects/hobbytostar/locations/-/functions 200 [2024-07-10T19:36:26.263Z] <<< [apiv2][body] GET https://cloudfunctions.googleapis.com/v2/projects/hobbytostar/locations/-/functions {"functions":[{"name":"projects/hobbytostar/locations/europe-west1/functions/ssrhobbytostar","buildConfig":{"build":"projects/407990140910/locations/europe-west1/builds/b100096d-6bfb-464d-b004-9367a8630c10","runtime":"nodejs20","entryPoint":"ssrhobbytostar","source":{"storageSource":{"bucket":"gcf-v2-sources-407990140910-europe-west1","object":"ssrhobbytostar/function-source.zip","generation":"1720607544721220"}},"environmentVariables":{"GOOGLE_NODE_RUN_SCRIPTS":""},"dockerRepository":"projects/hobbytostar/locations/europe-west1/repositories/gcf-artifacts","sourceProvenance":{"resolvedStorageSource":{"bucket":"gcf-v2-sources-407990140910-europe-west1","object":"ssrhobbytostar/function-source.zip","generation":"1720607544721220"}},"dockerRegistry":"ARTIFACT_REGISTRY"},"serviceConfig":{"service":"projects/hobbytostar/locations/europe-west1/services/ssrhobbytostar","timeoutSeconds":60,"environmentVariables":{"
NG_BROWSER_OUTPUT_PATH":"dist/hobbytostar_lp/browser","FIREBASE_FRAMEWORKS_ENTRY":"angular","__FIREBASE_DEFAULTS":"{\"config\":{\"projectId\":\"hobbytostar\",\"appId\":\"1:407990140910:web:20a76c0f9e4116f88618ff\",\"storageBucket\":\"hobbytostar.appspot.com\",\"apiKey\":\"---apiKey---\",\"authDomain\":\"hobbytostar.firebaseapp.com\",\"messagingSenderId\":\"407990140910\",\"measurementId\":\"G-BTVWX17GFV\"},\"_authTokenSyncURL\":\"/__session\"}","FIREBASE_CONFIG":"{\"projectId\":\"hobbytostar\",\"storageBucket\":\"hobbytostar.appspot.com\"}","GCLOUD_PROJECT":"hobbytostar","EVENTARC_CLOUD_EVENT_SOURCE":"projects/hobbytostar/locations/europe-west1/services/ssrhobbytostar","FUNCTION_TARGET":"ssrhobbytostar","LOG_EXECUTION_ID":"true"},"maxInstanceCount":100,"ingressSettings":"ALLOW_ALL","uri":"https://ssrhobbytostar-5f37pj7mia-ew.a.run.app","serviceAccountEmail":"407990140910-compute@developer.gserviceaccount.com","availableMemory":"256Mi","revision":"ssrhobbytostar-00178-zeh","maxInstanceRequestConcurrency":80,"availableCpu":"1"},"state":"ACTIVE","updateTime":"2024-07-10T10:49:14.346632037Z","labels":{"deployment-tool":"cli-firebase","firebase-functions-codebase":"firebase-frameworks-hobbytostar","firebase-functions-hash":"12f72e30ce075684cf2d8ad735ab8f92035a573c"},"environment":"GEN_2","url":"https://europe-west1-hobbytostar.cloudfunctions.net/ssrhobbytostar","createTime":"2024-02-17T09:34:31.677000788Z"}]} i functions: ensuring required API run.googleapis.com is enabled... i functions: ensuring required API eventarc.googleapis.com is enabled... i functions: ensuring required API pubsub.googleapis.com is enabled... i functions: ensuring required API storage.googleapis.com is enabled... [2024-07-10T19:36:26.268Z] >>> [apiv2][query] GET https://serviceusage.googleapis.com/v1/projects/hobbytostar/services/run.googleapis.com [none] [2024-07-10T19:36:26.268Z] >>> [apiv2][(partial)header] GET https://serviceusage.googleapis.com/v1/projects/hobbytostar/services/run.googleapis.com x-goog-quota-user=projects/hobbytostar [2024-07-10T19:36:26.271Z] >>> [apiv2][query] GET https://serviceusage.googleapis.com/v1/projects/hobbytostar/services/eventarc.googleapis.com [none] [2024-07-10T19:36:26.271Z] >>> [apiv2][(partial)header] GET https://serviceusage.googleapis.com/v1/projects/hobbytostar/services/eventarc.googleapis.com x-goog-quota-user=projects/hobbytostar [2024-07-10T19:36:26.273Z] >>> [apiv2][query] GET https://serviceusage.googleapis.com/v1/projects/hobbytostar/services/pubsub.googleapis.com [none] [2024-07-10T19:36:26.274Z] >>> [apiv2][(partial)header] GET https://serviceusage.googleapis.com/v1/projects/hobbytostar/services/pubsub.googleapis.com x-goog-quota-user=projects/hobbytostar [2024-07-10T19:36:26.276Z] >>> [apiv2][query] GET https://serviceusage.googleapis.com/v1/projects/hobbytostar/services/storage.googleapis.com [none] [2024-07-10T19:36:26.277Z] >>> [apiv2][(partial)header] GET https://serviceusage.googleapis.com/v1/projects/hobbytostar/services/storage.googleapis.com x-goog-quota-user=projects/hobbytostar [2024-07-10T19:36:26.818Z] <<< [apiv2][status] GET https://serviceusage.googleapis.com/v1/projects/hobbytostar/services/storage.googleapis.com 200 [2024-07-10T19:36:26.819Z] <<< [apiv2][body] GET https://serviceusage.googleapis.com/v1/projects/hobbytostar/services/storage.googleapis.com [omitted]

Error: HTTP Error: 404, Requested entity was not found. [2024-07-10T19:36:32.266Z] Error Context: { "body": { "error": { "code": 404, "message": "Requested entity was not found.", "status": "NOT_FOUND" } }, "response": { "statusCode": 404 } }

genyklemberg commented 1 month ago

It is directing to GCR, but gcr is not available at least from my side, it redirects to articfact registry

genyklemberg commented 1 month ago

Update to firebase-tools 13.13.3 and disabled GCR API. And now it works. Something of those two worked.