现已推出具有 MongoDB 兼容性的 Firestore 企业版!
了解详情。
了解错误代码
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
仅与 Cloud Firestore 企业版相关。
|
本页面列出了您可能会遇到的错误代码,并提供了有关如何解决这些问题的建议。
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.
要解决此问题,请执行以下操作:
对于编入索引的字段值,请将该字段拆分为多个字段。如果可能,请创建一个未编入索引的字段,并将不需要编入索引的数据移到该字段中。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-29。
[null,null,["最后更新时间 (UTC):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."]]