现已推出具有 MongoDB 兼容性的 Firestore 企业版!
了解详情。
瞭解錯誤代碼
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
僅適用於 Cloud Firestore Enterprise 版。
|
本頁面列出您可能會遇到的錯誤代碼,並提供各項錯誤的修正建議。
DeadlineExceeded (262)
下列情況可能會增加 DeadlineExceeded (262)
錯誤:
- 延遲時間增加,導致作業完成時間超過期限 (預設為 60 秒)。
DeadlineExceeded (262): Deadline exceeded.
如要解決這個問題,請參閱延遲疑難排解指南。
已取消 (112)
下列情況可能會增加 Aborted (112)
錯誤:
- 文件每秒收到太多更新。
- 重疊交易造成的爭用。
- 流量快速增加或遇到熱點。
Aborted (112): Too much contention on these documents. Please try again
或
Aborted (112): Aborted due to cross-transaction contention. This occurs when
multiple transactions attempt to access the same data, requiring at least one
to be aborted in order to enforce serializability.
如何解決這個問題:
- 如果流量快速增加,與 MongoDB 相容的 Cloud Firestore 會嘗試自動擴充,以滿足增加的需求。與 MongoDB 相容的 Cloud Firestore 擴充規模後,延遲時間就會開始縮短。
- 熱點會限制與 MongoDB 相容的 Cloud Firestore 擴充能力。請參閱資源調度設計,找出資源使用率不均的區域。
- 請查看交易中的資料爭用情況,以及交易的使用情形。
- 降低個別文件的寫入速度。
InvalidArgument (2)
下列情況可能會導致 InvalidArgument (2)
錯誤:
- 嘗試提交的文件超過索引項目的 7.5 KiB 限制。
索引項目的限制為 7.5 KiB。你無法超過這個上限,而且這不是可以調整的配額。
InvalidArgument (2): Index entry on field_name is larger than 7680 bytes.
如何解決這個問題:
如為已建立索引的欄位值,請將欄位分割為多個欄位。如有可能,請建立未編入索引的欄位,並將不需要編入索引的資料移至該欄位。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-29 (世界標準時間)。
[null,null,["上次更新時間:2025-08-29 (世界標準時間)。"],[],[],null,["\u003cbr /\u003e\n\n\n|--------------------------------------------------------|\n| *Relevant to Cloud Firestore Enterprise edition only.* |\n\n\u003cbr /\u003e\n\nThis page lists error codes that you might encounter and provides suggestions\nfor how to fix each of them.\n\nDeadlineExceeded (262)\n\nThe following can increase `DeadlineExceeded (262)` errors:\n\n- An increase in latency caused an operation to take longer than the deadline (60 seconds by default) to complete.\n\n DeadlineExceeded (262): Deadline exceeded.\n\nTo resolve this issue, see the [guide to troubleshooting latency](/docs/firestore/enterprise/resolve-latency).\n\nAborted (112)\n\nThe following situations can increase `Aborted (112)` errors:\n\n- A document receiving too many updates per second.\n- Contention from overlapping transactions.\n- Traffic that increases rapidly or encounters hot-spots.\n\n Aborted (112): Too much contention on these documents. Please try again\n\nOr \n\n Aborted (112): Aborted due to cross-transaction contention. This occurs when\n multiple transactions attempt to access the same data, requiring at least one\n to be aborted in order to enforce serializability.\n\nTo resolve this issue:\n\n- For rapid traffic increases, Cloud Firestore with MongoDB compatibility attempts to automatically scale to meet the increased demand. When Cloud Firestore with MongoDB compatibility scales, latency begins to decrease.\n- Hot-spots limit the ability of Cloud Firestore with MongoDB compatibility to scale up. Review [designing for scale](/docs/firestore/enterprise/understand-reads-writes-scale#avoid_hotspots) to identify hot-spots.\n- Review [data contention in transactions](/docs/firestore/enterprise/understand-reads-writes-scale#high-level_steps_in_a_write_transaction) and your usage of transactions.\n- Reduce the write rate to individual documents.\n\nInvalidArgument (2)\n\nThe following situations can cause `InvalidArgument (2)` errors:\n\n- Attempting to commit a document with that exceeds the 7.5 KiB limit for an index entry.\n\n7.5 KiB is a [limit](/docs/firestore/enterprise/quotas) for index entries. You cannot exceed this limit\nand it's not a quota that can be adjusted. \n\n InvalidArgument (2): Index entry on \u003cvar class=\"readonly\" translate=\"no\"\u003efield_name\u003c/var\u003e is larger than 7680 bytes.\n\nTo resolve this issue:\n\nFor indexed field values, split the\nfield into multiple fields. If possible, create an un-indexed field\nand move data that doesn't need to be indexed into the un-indexed\nfield."]]