You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

在Appwrite中创建users_profiles集合文档时持续触发「Document with the requested ID already exists」错误的求助

在Appwrite中创建users_profiles集合文档时持续触发「Document with the requested ID already exists」错误的求助

大家好,我最近在使用Appwrite时碰到了一个百思不得其解的问题:当我尝试往users_profiles集合中创建新文档时,始终收到Document with the requested ID already exists的错误提示,但我翻来覆去核查了好几遍,都没找到哪里有重复的文档ID。

先跟大家说下我已经确认的信息:

  • 我要创建的文档ID是685952b90030c6eb42be,在Appwrite控制台的users_profiles集合里完全搜不到这个ID的文档
  • 当前环境里只有1个用户(ID:685950f30003536bbc8b)和1个已存在的user_profile文档(ID:685950f400010a5d1ee1),两者ID都和我要创建的完全不重复
  • 其他集合创建文档都很正常,只有users_profiles集合会出现这个问题

再给大家贴一下这个集合的配置:

  • 有两个指向它的一对一单向关系:users_preferences → users_profiles、libraries → users_profiles
  • 已经关闭了文档安全设置
  • 给email和username字段都加了唯一索引

我发送的创建请求体是这样的:

{
  "documentId": "685952b90030c6eb42be",
  "data": {
    "userId": "685952b80036637183cd",
    "name": "First Last",
    "email": "firstlast@example.com",
    "username": "waliddasdas2_mc949ak0",
    "avatarUrl": "https://api.dicebear.com/9.x/fun-emoji/svg?seed=Walid%20Zakan",
    "mediaPreference": "both"
  },
  "permissions": [
    "read(\"user:685952b80036637183cd\")",
    "update(\"user:685952b80036637183cd\")",
    "delete(\"user:685952b80036637183cd\")"
  ]
}

另外我也排查了email和username的唯一性,确认请求里的firstlast@example.com和waliddasdas2_mc949ak0在集合里都没有重复项。

实在搞不懂问题出在哪了,有没有大佬遇到过类似的情况,或者能帮我分析下可能的原因?

内容来源于stack exchange

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.08 14:19:34