You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
firebase deploy --only firestore fails with 409 error on existing indexes in firebase-tools v14.11.0 and v14.12.1 #8859
GOOGLE_APPLICATION_CREDENTIALS: Base64 encoded Service Account Key (json)
PROJECT_ID: Firebase Project ID
Run the "Deploy Firebase" workflow. It should succeed.
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.
Reacted by k-okajima, TimBaumgart, yyyoichi and Zack Lemley
Hey folks, apologies for the issue here. I'm able to reproduce the error during deployments. To workaround the issue, please temporarily downgrade to firbease-tools v14.10.1
Let me discuss this issue with our engineering team.
Hi everyone, I've opened #8860 with a potential fix for this issue. It adjusts how __name__ fields are handled in indexes. Would appreciate if someone could review and test it!
@aalej any updates on this? Downgrading to 14.10.1 seems to fix this problem for now, but it we don't want to rely on downgrading and should be able to use the latest version
Sorry for the delay here. We have a fix for this in #8862 and it should be available in our next release. I will follow up with our engineering to to see when we can schedule this release
Just a quick update: we are planning on getting a release out today, so the fix should be available shortly after.
@chacaleduardo you shouldn't be encountering this issue with v13.35.1 since the error started in v14.11.0. It's possible that the cause of the issue you're encountering is different. Could you share your firebase-debug.log file with us so that we can check? Please remove any PIIs before sharing the contents.
For what it's worth, I was able to resolve the ...had HTTP Error: 409, index already exists error in my case. The issue was caused by a duplicate index that I had inserted into my firestore.indexes.json file. Removing the duplicate entry has resolved the error.
My apologies for polluting the post unnecessarily.
The fix for this should be available in firebase-tools v14.13.0. I've tested this version, and running firebase deploy --only firestore:indexes isn't raising any errors. Could you try updating to this version to see if you'd still encounter the same error?
On version 14.15.1 I get the 409 error doing firebase deploy --only firestore but not if I do individually firebase deploy only firestore:indexes and then firebase deploy only firestore:rules . FYI
I'm also having this error on 14.17.0 using firebase deploy --only firestore:indexes
I made a tool for sharing your redacted firebase indices in an earlier comment, u can use it too
Little tool made with AI, others can use
run like this cat <json file> | node <script.js> or whatever else does stdin to the next command
it will output to command line.
it attempts to do some kind of verification. Didnt look through all that in gross detail, but the diff and the resulting file length makes alot of sense. good enough for us probably? anonymize-firebase-indexes.js.txt
Activity
ottob commentedon Jul 17, 2025
We have the same issue, maybe related to #7629?
Maybe we have to regenerate our local firestore.indexes.json now after that PR was included in 14.11.0
aalej commentedon Jul 17, 2025
Hey folks, apologies for the issue here. I'm able to reproduce the error during deployments. To workaround the issue, please temporarily downgrade to firbease-tools v14.10.1
Let me discuss this issue with our engineering team.
TorbenWetter commentedon Jul 17, 2025
Hi everyone, I've opened #8860 with a potential fix for this issue. It adjusts how
__name__fields are handled in indexes. Would appreciate if someone could review and test it!Correct handling of __name__ in firestore indexes (#8862)
anasonline commentedon Jul 20, 2025
We also started seeing the same issue.
chacaleduardo commentedon Jul 21, 2025
same issue. version 13.35.1
willemjanvankranenburg commentedon Jul 22, 2025
@aalej any updates on this? Downgrading to 14.10.1 seems to fix this problem for now, but it we don't want to rely on downgrading and should be able to use the latest version
aalej commentedon Jul 22, 2025
Sorry for the delay here. We have a fix for this in #8862 and it should be available in our next release. I will follow up with our engineering to to see when we can schedule this release
willemjanvankranenburg commentedon Jul 22, 2025
@aalej thanks for the response, can you give an ETA for when this release will be available when you know it?
aalej commentedon Jul 22, 2025
Just a quick update: we are planning on getting a release out today, so the fix should be available shortly after.
@chacaleduardo you shouldn't be encountering this issue with v13.35.1 since the error started in v14.11.0. It's possible that the cause of the issue you're encountering is different. Could you share your
firebase-debug.logfile with us so that we can check? Please remove any PIIs before sharing the contents.22 remaining items
salvia34 commentedon Aug 19, 2025
You are correct @ehsannas ..
For what it's worth, I was able to resolve the
...had HTTP Error: 409, index already existserror in my case. The issue was caused by a duplicate index that I had inserted into myfirestore.indexes.jsonfile. Removing the duplicate entry has resolved the error.My apologies for polluting the post unnecessarily.
fix: index-spec matching for optional values and vectorConfig.
fix: index-spec matching for optional values and vectorConfig. (#9003)
arnab commentedon Aug 20, 2025
My deployments are still failing with the same error. Is this already fixed/released (the issue is marked as closed)?
aalej commentedon Aug 21, 2025
The fix for this should be available in firebase-tools v14.13.0. I've tested this version, and running
firebase deploy --only firestore:indexesisn't raising any errors. Could you try updating to this version to see if you'd still encounter the same error?jpdom commentedon Sep 1, 2025
On version 14.15.1 I get the 409 error doing
firebase deploy --only firestorebut not if I do individuallyfirebase deploy only firestore:indexesand thenfirebase deploy only firestore:rules. FYIclarkbox commentedon Sep 12, 2025
i am still seeing this error. just tested in 14.16.0. is the fix incoming?
fwal commentedon Sep 16, 2025
Same error on 14.16.0, using
firebase deploy --only firestore:indexesharripj commentedon Sep 18, 2025
I'm also having this error on 14.17.0 using
firebase deploy --only firestore:indexesehsannas commentedon Sep 18, 2025
I'm not seeing an error. Do you mind sharing your [redacted]
firestore.indexes.json?jflemingframe commentedon Sep 18, 2025
I made a tool for sharing your redacted firebase indices in an earlier comment, u can use it too
fwal commentedon Sep 22, 2025
Started working for me again after I re-pulled my indexes (which added a bunch of
"density": "SPARSE_ALL")clarkbox commentedon Oct 2, 2025
Thanks for the suggested workaround. Unfortunately, the bug persists on my end even after pulling the existing indexes and adding density to each.
What fixed it for me was to delete all indexes (deploy empty indexes file). and then deploying the full indexes file.