Skip to content

Unhandled error cleaning up build images #6911

@RaphaelMaschinsen

Description

@RaphaelMaschinsen

[REQUIRED] Environment info

firebase-tools: 13.5.2

Platform: Windows 11 Pro

[REQUIRED] Test case

Create a Firebase 1st gen Function and deploy with:
firebase deploy --only functions

[REQUIRED] Steps to reproduce

See above.

[REQUIRED] Expected behavior

Leftover artifacts are deleted.

[REQUIRED] Actual behavior

I get following error when build-artifacts are cleaned up:

functions: Unhandled error cleaning up build images. This could result in a small monthly bill if not corrected. You can attempt to delete these images by redeploying or you can delete them manually at https://console.cloud.google.com/gcr/images/sublime-spider-416614/us/gcf

+  Deploy complete!

With --debug the logs show:

i  functions: cleaning up build files... 
[2024-03-25T15:17:45.047Z] >>> [apiv2][query] DELETE https://artifactregistry.googleapis.com/v1beta2/projects/project-name-1234/locations/us-central1/repositories/gcf-artifacts/packages/validate_user_email [none]
[2024-03-25T15:17:45.048Z] >>> [apiv2][query] GET https://us.gcr.io/v2/project-name-1234/gcf/us-central1/tags/list [none]
[2024-03-25T15:17:45.258Z] <<< [apiv2][status] DELETE https://artifactregistry.googleapis.com/v1beta2/projects/project-name-1234/locations/us-central1/repositories/gcf-artifacts/packages/validate_user_email 200
[2024-03-25T15:17:45.258Z] <<< [apiv2][body] DELETE https://artifactregistry.googleapis.com/v1beta2/projects/project-name-1234/locations/us-central1/repositories/gcf-artifacts/packages/validate_user_email {"name":"projects/project-name-1234/locations/us-central1/operations/4ba1e392-4215-405c-8728-f9167a996711","metadata":{"@type":"type.googleapis.com/google.devtools.artifactregistry.v1beta2.OperationMetadata"}}
[2024-03-25T15:17:45.259Z] >>> [apiv2][query] GET https://artifactregistry.googleapis.com/v1beta2/projects/project-name-1234/locations/us-central1/operations/4ba1e392-4215-405c-8728-f9167a996711 [none]
[2024-03-25T15:17:45.318Z] <<< [apiv2][status] GET https://us.gcr.io/v2/project-name-1234/gcf/us-central1/tags/list 404
[2024-03-25T15:17:45.319Z] <<< [apiv2][body] GET https://us.gcr.io/v2/project-name-1234/gcf/us-central1/tags/list {"errors":[{"code":"NAME_UNKNOWN","message":"Repository \"us.gcr.io\" not found"}]}
[2024-03-25T15:17:45.320Z] Failed docker command with error  HTTP Error: 404, Not Found {"name":"FirebaseError","children":[],"context":{"body":{"errors":[{"code":"NAME_UNKNOWN","message":"Repository \"us.gcr.io\" not found"}],"error":{"message":"Not Found"}},"response":{"statusCode":404}},"exit":1,"message":"HTTP Error: 404, Not Found","status":404}
[2024-03-25T15:17:45.338Z] >>> [apiv2][query] GET https://us.gcr.io/v2/project-name-1234/gcf/us-central1/tags/list [none]
[2024-03-25T15:17:45.614Z] <<< [apiv2][status] GET https://us.gcr.io/v2/project-name-1234/gcf/us-central1/tags/list 404
[2024-03-25T15:17:45.615Z] <<< [apiv2][body] GET https://us.gcr.io/v2/project-name-1234/gcf/us-central1/tags/list {"errors":[{"code":"NAME_UNKNOWN","message":"Repository \"us.gcr.io\" not found"}]}
[2024-03-25T15:17:45.615Z] Failed docker command with error  HTTP Error: 404, Not Found {"name":"FirebaseError","children":[],"context":{"body":{"errors":[{"code":"NAME_UNKNOWN","message":"Repository \"us.gcr.io\" not found"}],"error":{"message":"Not Found"}},"response":{"statusCode":404}},"exit":1,"message":"HTTP Error: 404, Not Found","status":404}
[2024-03-25T15:17:45.720Z] >>> [apiv2][query] GET https://us.gcr.io/v2/project-name-1234/gcf/us-central1/tags/list [none]
[2024-03-25T15:17:45.937Z] <<< [apiv2][status] GET https://us.gcr.io/v2/project-name-1234/gcf/us-central1/tags/list 404
[2024-03-25T15:17:45.937Z] <<< [apiv2][body] GET https://us.gcr.io/v2/project-name-1234/gcf/us-central1/tags/list {"errors":[{"code":"NAME_UNKNOWN","message":"Repository \"us.gcr.io\" not found"}]}
[2024-03-25T15:17:45.937Z] Failed docker command with error  HTTP Error: 404, Not Found {"name":"FirebaseError","children":[],"context":{"body":{"errors":[{"code":"NAME_UNKNOWN","message":"Repository \"us.gcr.io\" not found"}],"error":{"message":"Not Found"}},"response":{"statusCode":404}},"exit":1,"message":"HTTP Error: 404, Not Found","status":404}
[2024-03-25T15:17:45.988Z] <<< [apiv2][status] GET https://artifactregistry.googleapis.com/v1beta2/projects/project-name-1234/locations/us-central1/operations/4ba1e392-4215-405c-8728-f9167a996711 200
[2024-03-25T15:17:45.989Z] <<< [apiv2][body] GET https://artifactregistry.googleapis.com/v1beta2/projects/project-name-1234/locations/us-central1/operations/4ba1e392-4215-405c-8728-f9167a996711 {"name":"projects/project-name-1234/locations/us-central1/operations/4ba1e392-4215-405c-8728-f9167a996711","metadata":{"@type":"type.googleapis.com/google.devtools.artifactregistry.v1beta2.OperationMetadata"},"done":true,"response":{"@type":"type.googleapis.com/google.protobuf.Empty"}}
!  functions: Unhandled error cleaning up build images. This could result in a small monthly bill if not corrected. You can attempt to delete these images by redeploying or you can delete them manually at https://console.cloud.google.com/gcr/images/project-name-1234/us/gcf

+  Deploy complete!

and a duet AI summarized audit log of such an error:

This is an audit log entry from the Artifact Registry service.

The user {owner-email-address} attempted to get tags for a repository named us.gcr.io in the project-name-1234 project.

The request was denied with a NOT_FOUND error because the repository does not exist.

The user had the artifactregistry.repositories.downloadArtifacts permission on the repository.

The request was made from IP address {ipv6-address} using the Firebase CLI user agent.

It appears like firebase-tools is trying to look for the artifacts in us.gcr.io when the folder that is being left over and not deleted in the end is actually called gcf-artifacts within my artifacts root (the region is us-central1).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions