GlobalTableNotFoundException
TL;DR — DescribeGlobalTable / UpdateGlobalTable 只能看到版本 2017.11.29(Legacy)的全局表。一个建立在版本 2019.11.21(Current)之上的全局表——也就是你应该使用的那个——是通过 DescribeTable / UpdateTable 作为_一张带副本的常规表_来管理的,而旧版 API 会报告它不存在。在断定表没了之前,先检查你所在的版本。
含义
GlobalTableNotFoundException: The specified global table does not exist.
# what the engine actually returns, reproduced against the live DynamoDB service:
GlobalTableNotFoundException: Global table not found: Global table with name: 'no-such-global-table' does not exist.DynamoDB 有两代全局表,带两套互不相交的 API 表面。旧版(2017.11.29)会注册一个命名的"全局表"对象,DescribeGlobalTable、UpdateGlobalTable 和 UpdateGlobalTableSettings 都对它操作。当前版本(2019.11.21)没有这样的对象——副本存在于表本身上——因此那些旧版调用会以这个异常回应,即便你的表复制得非常好。
为什么会发生
- 该表是一个当前版本(2019.11.21)的全局表——这是目前最常见的原因:旧版 API 干脆没有索引它。
- 从未以该名称创建过全局表——表存在但没有副本,或者复制设置早前失败了。
- 区域错误或名称拼错——旧版全局表注册是按精确名称查找的。
如何修复
确定版本:
aws dynamodb describe-table --table-name orders \ --query 'Table.GlobalTableVersion' # "2019.11.21" → use DescribeTable/UpdateTable, not the legacy APIs通过
UpdateTable管理当前版本的副本:aws dynamodb update-table --table-name orders \ --replica-updates '[{"Create": {"RegionName": "eu-west-1"}}]'并用
describe-table(Replicas字段)而非describe-global-table来检查它们。在使用旧版工具? 如果你确实运营 2017.11.29 全局表,核实注册的名称和区域——并规划升级到 2019.11.21,AWS 为了灵活性和更低的复制写入成本而推荐它。
从零创建: 创建表,然后通过
UpdateTable添加副本——不要在新代码中动用CreateGlobalTable(旧版)。
跨区域检查副本健康状况时,把表并排放在一起会更快——DynoTable 桌面应用从一个窗口连接到每个区域,而 DynamoDB 定价计算器会在你添加副本之前估算复制写入成本。
在 DynoTable 中检查大小
DynoTable 从一个窗口连接到每个区域 - 使用 ⌘P 切换并在每个配置文件中打开相同的表名称以查看副本是否存在并提供数据。表侧边栏显示复制元数据,无需调用旧版全局表 API。在添加副本之前,使用 pricing calculator 估计复制写入成本。在“设置”→“配置文件”下配置每个区域,并在运行 UpdateTable 副本更新之前运行 Test Connection。参见连接 AWS和安装。如果旧版工具调用 DescribeGlobalTable,请首先检查 DescribeTable 上的 GlobalTableVersion — 当前版本表返回 2019.11.21,并且必须通过 UpdateTable 进行管理。即使复制正常,旧版 API 也无法看到它们。升级工具以使用 ReplicaUpdates 调用当前版本表的 UpdateTable,而不是 CreateGlobalTable。
来源
- DynamoDB global tables versions(2026-07-13 验证)
- UpdateTable — Amazon DynamoDB API Reference(2026-07-13 验证)
相关错误
- 全局表版本不匹配——同样的两代之分,从升级路径撞上。
- ReplicaNotFoundException——该区域不属于复制组。
- ReplicaAlreadyExistsException——该区域已经属于复制组。
- 学习:DynamoDB global tables
参考资料
- UpdateGlobalTable — Amazon DynamoDB API Reference
- DynamoDB global tables versions (determining the version) — Amazon DynamoDB Developer Guide
- UpdateTable — Amazon DynamoDB API Reference
- CreateGlobalTable — Amazon DynamoDB API Reference
最后核实于 2026-07-13,依据上方链接的 AWS 官方文档。