Skip to content

firebase deploy --only firestore fails with 409 error on existing indexes in firebase-tools v14.11.0 and v14.12.1 #8859

@k1350

Description

@k1350

[REQUIRED] Environment info

firebase-tools: 14.11.0, 14.12.1

Platform: Ubuntu (GitHub Actions)

[REQUIRED] Test case

https://github.com/k1350/firebase-tools-bug-sample

[REQUIRED] Steps to reproduce

  1. Create a Firebase Project
  2. Create Service Account Key (json).
    • Role: Cloud Datastore Index Admin, Firebase Rules Admin
  3. Fork https://github.com/k1350/firebase-tools-bug-sample
  4. Set GitHub Actions Secret
    • GOOGLE_APPLICATION_CREDENTIALS: Base64 encoded Service Account Key (json)
    • PROJECT_ID: Firebase Project ID
  5. Run the "Deploy Firebase" workflow. It should succeed.
  6. Run the "Deploy Firebase" workflow again

[REQUIRED] Expected behavior

Deploy succeed.

Now using project ***

=== Deploying to '***'...

i  deploying firestore
i  firestore: reading indexes from firestore.indexes.json...
i  cloud.firestore: checking firestore.rules for compilation errors...
✔  cloud.firestore: rules file firestore.rules compiled successfully
i  firestore: latest version of firestore.rules already up to date, skipping upload...
i  firestore: deploying indexes...
✔  firestore: deployed indexes in firestore.indexes.json successfully for (default) database
✔  firestore: released rules firestore.rules to cloud.firestore

✔  Deploy complete!

Project Console: https://console.firebase.google.com/project/***/overview

[REQUIRED] Actual behavior

Deploy failed.

Now using project ***

=== Deploying to '***'...

i  deploying firestore
i  firestore: reading indexes from firestore.indexes.json...
i  cloud.firestore: checking firestore.rules for compilation errors...
✔  cloud.firestore: rules file firestore.rules compiled successfully
i  firestore: latest version of firestore.rules already up to date, skipping upload...
i  firestore: deploying indexes...
i  firestore: there are 1 indexes defined in your project that are not present in your firestore indexes file. To delete them, run this command with the --force flag.

Error: Request to https://firestore.googleapis.com/v1/projects/***/databases/(default)/collectionGroups/widgets/indexes had HTTP Error: 409, index already exists
Error: Process completed with exit code 1.

It’s true that the indexes already exist, but with v14.10.1, deployment completed successfully without any issues.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions