firebase 功能最近无法在 macos 上部署

firebase functions fails to deploy on macos recently

我的 firebase 函数突然停止部署

我看到的日志如下。我试过多次部署和升级包等,但没有成功。也没有在日志中看到任何有用的东西

[debug] [2021-11-15T00:54:01.810Z] ----------------------------------------------------------------------
[debug] [2021-11-15T00:54:01.812Z] Command:       /usr/local/bin/node /usr/local/bin/firebase deploy --only functions:divi_prices
[debug] [2021-11-15T00:54:01.812Z] CLI Version:   9.22.0
[debug] [2021-11-15T00:54:01.812Z] Platform:      darwin
[debug] [2021-11-15T00:54:01.812Z] Node Version:  v14.17.0
[debug] [2021-11-15T00:54:01.819Z] Time:          Sun Nov 14 2021 18:54:01 GMT-0600 (Central Standard Time)
[debug] [2021-11-15T00:54:01.819Z] ----------------------------------------------------------------------
 https://cloudfunctions.googleapis.com/v1/operations/c2xvdy1jaGVzcy1taXQvdXMtY2VudHJhbDEvZGl2aV9wcmljZXMvNndzU0tnb2VLbDQ {"name":"operations/c2xvdy1jaGVzcy1taXQvdXMtY2VudHJhbDEvZGl2aV9wcmljZXMvNndzU0tnb2VLbDQ","metadata":{"@type":"type.googleapis.com/google.cloud.functions.v1.OperationMetadataV1","target":"projects/slow-chess-mit/locations/us-central1/functions/divi_prices","type":"UPDATE_FUNCTION","request":{"@type":"type.googleapis.com/google.cloud.functions.v1.CloudFunction","name":"projects/slow-chess-mit/locations/us-central1/functions/divi_prices","eventTrigger":{"eventType":"google.pubsub.topic.publish","resource":"projects/slow-chess-mit/topics/firebase-schedule-divi_prices-us-central1","service":"pubsub.googleapis.com","failurePolicy":{}},"status":"OFFLINE","entryPoint":"divi_prices","timeout":"60s","availableMemoryMb":256,"serviceAccountEmail":"slow-chess-mit@appspot.gserviceaccount.com","updateTime":"2021-11-14T04:51:50.789Z","versionId":"10","labels":{"deployment-scheduled":"true","deployment-tool":"cli-a4fb043f92ee7c5e00683c2fe3f0f07240e7f3434fa08a4fb":{"imageSizeBytes":"419002479","layerId":"","mediaType":"application/vnd.docker.distribution.manifest.v2+json","tag":["divi_prices_version-11","latest"],"timeCreatedMs":"315532801000","timeUploadedMs":"1636937698325"}},"name":"slow-chess-mit/gcf/us-central1/e3f3ddb4-7b92-44c8-9b00-c66ac3023088","tags":["divi_prices_version-11","latest"]}
[debug] [2021-11-15T00:55:24.179Z] Could not find image for function projects/slow-chess-mit/locations/us-central1/functions/on_game_finished_compute_highest_score
[debug] [2021-11-15T00:55:24.179Z] <<< [apiv2][status] GET https://us.gcr.io/v2/slow-chess-mit/gcf/us-central1/e3f3ddb4-7b92-44c8-9b00-c66ac3023088/tags/list 200
[debug] [2021-11-15T00:55:24.179Z] <<< [apiv2][body] GET https://us.gcr.io/v2/slow-chess-mit/gcf/us-central1/e3f3ddb4-7b92-44c8-9b00-c66ac3023088/tags/list {"child":["cache"],"manifest":{"sha256:998103042d58a26a4fb043f92ee7c5e00683c2fe3f0f07240e7f3434fa08a4fb":{"imageSizeBytes":"419002479","layerId":"","mediaType":"application/vnd.docker.distribution.manifest.v2+json","tag":["divi_prices_version-11","latest"],"timeCreatedMs":"315532801000","timeUploadedMs":"1636937698325"}},"name":"slow-chess-mit/gcf/us-central1/e3f3ddb4-7b92-44c8-9b00-c66ac3023088","tags":["divi_prices_version-11","latest"]}
[debug] [2021-11-15T00:55:24.179Z] Could not find image for function projects/slow-chess-mit/locations/us-central1/functions/on_token_audit_update_profile_coins
[debug] [2021-11-15T00:55:24.179Z] <<< [apiv2][status] GET https://us.gcr.io/v2/slow-chess-mit/gcf/us-central1/e3f3ddb4-7b92-44c8-9b00-c66ac3023088/tags/list 200
[debug] [2021-11-15T00:55:24.179Z] <<< [apiv2][body] GET https://us.gcr.io/v2/slow-chess-mit/gcf/us-central1/e3f3ddb4-7b92-44c8-9b00-c66ac3023088/tags/list {"child":["cache"],"manifest":{"sha256:998103042d58a26a4fb043f92ee7c5e00683c2fe3f0f07240e7f3434fa08a4fb":{"imageSizeBytes":"419002479","layerId":"","mediaType":"application/vnd.docker.distribution.manifest.v2+json","tag":["divi_prices_version-11","latest"],"timeCreatedMs":"315532801000","timeUploadedMs":"1636937698325"}},"name":"slow-chess-mit/gcf/us-central1/e3f3ddb4-7b92-44c8-9b00-c66ac3023088","tags":["divi_prices_version-11","latest"]}
[debug] [2021-11-15T00:55:24.180Z] Could not find image for function projects/slow-chess-mit/locations/us-central1/functions/on_user_created_update_user_count
[debug] [2021-11-15T00:55:24.180Z] <<< [apiv2][status] GET https://us.gcr.io/v2/slow-chess-mit/gcf/us-central1/e3f3ddb4-7b92-44c8-9b00-c66ac3023088/tags/list 200
[debug] [2021-11-15T00:55:24.180Z] <<< [apiv2][body] GET https://us.gcr.io/v2/slow-chess-mit/gcf/us-central1/e3f3ddb4-7b92-44c8-9b00-c66ac3023088/tags/list {"child":["cache"],"manifest":{"sha256:998103042d58a26a4fb043f92ee7c5e00683c2fe3f0f07240e7f3434fa08a4fb":{"imageSizeBytes":"419002479","layerId":"","mediaType":"application/vnd.docker.distribution.manifest.v2+json","tag":["divi_prices_version-11","latest"],"timeCreatedMs":"315532801000","timeUploadedMs":"1636937698325"}},"name":"slow-chess-mit/gcf/us-central1/e3f3ddb4-7b92-44c8-9b00-c66ac3023088","tags":["divi_prices_version-11","latest"]}
[debug] [2021-11-15T00:55:24.180Z] Could not find image for function projects/slow-chess-mit/locations/us-central1/functions/on_game_finished_update_game_type
[debug] [2021-11-15T00:55:24.181Z] <<< [apiv2][status] GET https://us.gcr.io/v2/slow-chess-mit/gcf/us-central1/e3f3ddb4-7b92-44c8-9b00-c66ac3023088/tags/list 200
[debug] [2021-11-15T00:55:24.181Z] <<< [apiv2][body] GET https://us.gcr.io/v2/slow-chess-mit/gcf/us-central1/e3f3ddb4-7b92-44c8-9b00-c66ac3023088/tags/list {"child":["cache"],"manifest":{"sha256:998103042d58a26a4fb043f92ee7c5e00683c2fe3f0f07240e7f3434fa08a4fb":{"imageSizeBytes":"419002479","layerId":"","mediaType":"application/vnd.docker.distribution.manifest.v2+json","tag":["divi_prices_version-11","latest"],"timeCreatedMs":"315532801000","timeUploadedMs":"1636937698325"}},"name":"slow-chess-mit/gcf/us-central1/e3f3ddb4-7b92-44c8-9b00-c66ac3023088","tags":["divi_prices_version-11","latest"]}
[
[debug] [2021-11-15T00:55:24.364Z] <<< [apiv2][status] DELETE https://us.gcr.io/v2/slow-chess-mit/gcf/us-central1/e3f3ddb4-7b92-44c8-9b00-c66ac3023088/cache/manifests/latest 202
[debug] [2021-11-15T00:55:24.364Z] <<< [apiv2][body] DELETE https://us.gcr.io/v2/slow-chess-mit/gcf/us-central1/e3f3ddb4-7b92-44c8-9b00-c66ac3023088/cache/manifests/latest {"errors":[]}
[debug] [2021-11-15T00:55:24.365Z] >>> [apiv2][query] DELETE https://us.gcr.io/v2/slow-chess-mit/gcf/us-central1/e3f3ddb4-7b92-44c8-9b00-c66ac3023088/cache/manifests/sha256:df5c0e894e1e7998f9438f13f353878e17b7e7e69f30ec53d3d7da1e27c2d49c [none]
[debug] [2021-11-15T00:55:24.727Z] <<< [apiv2][status] DELETE https://us.gcr.io/v2/slow-chess-mit/gcf/us-central1/e3f3ddb4-7b92-44c8-9b00-c66ac3023088/cache/manifests/sha256:df5c0e894e1e7998f9438f13f353878e17b7e7e69f30ec53d3d7da1e27c2d49c 202
[debug] [2021-11-15T00:55:24.728Z] <<< [apiv2][body] DELETE https://us.gcr.io/v2/slow-chess-mit/gcf/us-central1/e3f3ddb4-7b92-44c8-9b00-c66ac3023088/cache/manifests/sha256:df5c0e894e1e7998f9438f13f353878e17b7e7e69f30ec53d3d7da1e27c2d49c {"errors":[]}
[debug] [2021-11-15T00:55:24.728Z] <<< [apiv2][status] DELETE https://us.gcr.io/v2/slow-chess-mit/gcf/us-central1/e3f3ddb4-7b92-44c8-9b00-c66ac3023088/manifests/sha256:998103042d58a26a4fb043f92ee7c5e00683c2fe3f0f07240e7f3434fa08a4fb 202
[debug] [2021-11-15T00:55:24.728Z] <<< [apiv2][body] DELETE https://us.gcr.io/v2/slow-chess-mit/gcf/us-central1/e3f3ddb4-7b92-44c8-9b00-c66ac3023088/manifests/sha256:998103042d58a26a4fb043f92ee7c5e00683c2fe3f0f07240e7f3434fa08a4fb {"errors":[]}
[debug] [2021-11-15T00:55:24.832Z] Error: Failed to update function divi_prices in region us-central1
    at /usr/local/lib/node_modules/firebase-tools/lib/deploy/functions/release/fabricator.js:38:11
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async Fabricator.updateV1Function (/usr/local/lib/node_modules/firebase-tools/lib/deploy/functions/release/fabricator.js:250:32)
    at async Fabricator.updateEndpoint (/usr/local/lib/node_modules/firebase-tools/lib/deploy/functions/release/fabricator.js:134:13)
    at async handle (/usr/local/lib/node_modules/firebase-tools/lib/deploy/functions/release/fabricator.js:75:17)
[error] 
[error] Error: There was an error deploying functions

因此,我决定删除我添加的最新功能,并在我的 index.ts 中对之前部署的其余未更改功能进行部署。当我这样做时,它警告我我添加的新功能不在我的 index.ts 中,所以我应该删除它吗?

这意味着该错误是伪造的,并且实际上已经部署了函数。我转到控制台,看到该功能确实已部署,但有一些缺少依赖项错误。

学习:即使部署显示失败并出现错误,也请查看 firebase 控制台。

我刚遇到同样的问题,偶然发现了这个问题。虽然在我的情况下 运行 yarn install 在功能方向上解决了它。显然在升级包时与 package.json 有一些不匹配。也许这对其他人有用。