dosubot[bot] commented on issue #2844:
URL: 
https://github.com/apache/incubator-hugegraph/issues/2844#issuecomment-3136272812

   <!-- Answer -->
   你的报错是因为 hstore 后端没有自动初始化认证所需的 `~user` 顶点类型(vertex label),导致认证流程找不到该 schema 
并抛出异常,所以也不会提示你输入 admin 密码。
   
   你可以手动用 REST API 创建认证所需的 schema,步骤如下:
   
   1. 先用 REST API 创建 property key(属性):
   
   ```json
   POST http://<host>:<port>/graphs/hugegraph/schema/propertykeys
   Content-Type: application/json
   
   {"name":"~user_name","data_type":"TEXT","cardinality":"SINGLE"}
   ```
   依次创建 `~user_password`、`~user_phone`、`~user_email`、`~user_avatar`,都用 `TEXT` 
类型和 `SINGLE`。
   
   2. 创建 `~user` 顶点类型:
   
   ```json
   POST http://<host>:<port>/graphs/hugegraph/schema/vertexlabels
   Content-Type: application/json
   
   {
     "name": "~user",
     "id_strategy": "PRIMARY_KEY",
     "properties": [
       "~user_name",
       "~user_password",
       "~user_phone",
       "~user_email",
       "~user_avatar"
     ],
     "primary_keys": ["~user_name"],
     "nullable_keys": ["~user_phone", "~user_email", "~user_avatar"],
     "enable_label_index": true
   }
   ```
   
   3. 用 REST API 查询 schema 是否创建成功:
   
   ```http
   GET http://<host>:<port>/graphs/hugegraph/schema/vertexlabels/~user
   ```
   
   4. schema 创建好后,重启 hugegraph-server 或重新执行 `init-store.sh`,此时应该会提示你输入 admin 
密码,认证流程才能继续。
   
   这个问题是 hstore 后端目前的已知缺陷,后续版本可能会自动补齐。手动补 schema 后认证功能就能正常初始化了。
   
   参考:[HugeUser.java 
源码](https://github.com/apache/incubator-hugegraph/blob/a53af864b31f803780a1db31cb20d3d94d5d34fc/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/auth/HugeUser.java)
 | 
[VertexLabelAPI.java](https://github.com/apache/incubator-hugegraph/blob/a53af864b31f803780a1db31cb20d3d94d5d34fc/hugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/api/schema/VertexLabelAPI.java)
   
   
   <!-- Dosu Comment Footer -->
   *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
   
   ---
   <sup>How did I do? 
[Good](https://app.dosu.dev/response-feedback/285ac085-0a8c-4485-af9d-c90535270171?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/285ac085-0a8c-4485-af9d-c90535270171?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/285ac085-0a8c-4485-af9d-c90535270171?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/285ac085-0a8c-4485-af9d-c90535270171?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/285ac085-0a8c-4485-af9d-c90535270171?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/285ac085-0a8c-4485-af9d-c90535270171?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/285ac085-0a8c-4485-af9d-c90535270171?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat
 with 
Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/e5e246fa-a522-4d8a-ab3c-e2588b5b501b/ask?utm_source=githu
 b)&nbsp;[![Join 
Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share
 on 
X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/incubator-hugegraph/issues/2844)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to