dosubot[bot] commented on issue #2946: URL: https://github.com/apache/incubator-hugegraph/issues/2946#issuecomment-3822343349
<!-- Greeting --> Hi @saladin101! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the incubator-hugegraph team. <!-- Answer --> 你的配置文件里 `server.port` 设置的是 8520,但你用 curl 访问的是 8620 端口,这通常会导致无法访问到 store 的 REST API。请确认 store 实际监听的端口(应该是 8520),然后用如下命令重试: ```bash curl http://192.168.207.54:8520/v1/stores ``` 如果依然返回 `Unauthorized`,请检查是否有设置了 `PASSWORD` 环境变量或相关鉴权配置(如 `auth.admin_pa`),因为 HugeGraph 1.7.0 支持开启鉴权模式,一旦开启,所有 REST API 都需要带上正确的 Basic Auth 认证头,否则会返回 Unauthorized。例如: ```bash curl -H "Authorization: Basic $(echo -n admin:你的密码 | base64)" http://192.168.207.54:8520/v1/stores ``` 如果你本意是不需要鉴权,确保启动 store 时没有设置 `PASSWORD` 环境变量,并检查相关配置项未启用鉴权,重启服务即可。 如果你需要开启鉴权,且用的是 hstore 后端,首次初始化时需要先手动创建 `~user` 相关 schema,否则鉴权初始化会失败,导致所有 API 都返回 Unauthorized。具体可以参考[官方文档说明](https://github.com/apache/incubator-hugegraph/issues/2844#issuecomment-3136272812)。 相关参考:[1](https://github.com/apache/incubator-hugegraph/issues/2818) [2](https://github.com/apache/incubator-hugegraph/issues/2844#issuecomment-3136272812) [3](https://github.com/apache/incubator-hugegraph/pull/2927) <!-- 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/c8d4c93d-406b-40f2-9c0f-6f689935240a?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/c8d4c93d-406b-40f2-9c0f-6f689935240a?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/c8d4c93d-406b-40f2-9c0f-6f689935240a?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/c8d4c93d-406b-40f2-9c0f-6f689935240a?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/c8d4c93d-406b-40f2-9c0f-6f689935240a?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/c8d4c93d-406b-40f2-9c0f-6f689935240a?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/c8d4c93d-406b-40f2-9c0f-6f689935240a?feedback_type=other)</sup> [](https://app.dosu.dev/e5e246fa-a522-4d8a-ab3c-e2588b5b501b/ask?utm_source=github) [](https://cursor.com/link/prompt?text=%E4%BD%A0%E7%9A%84%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6%E9%87%8C%20%60server.port%60%20%E8%AE%BE%E7%BD%AE%E7%9A%84%E6%98%AF%208520%EF%BC%8C%E4%BD%86%E4%BD%A0%E7%94%A8%20curl%20%E8%AE%BF%E9%97%AE%E7%9A%84%E6%98%AF%208620%20%E7%AB%AF%E5%8F%A3%EF%BC%8C%E8%BF%99%E9%80%9A%E5%B8%B8%E4%BC%9A%E5%AF%BC%E8%87%B4%E6%97%A0%E6%B3%95%E8%AE%BF%E9%97%AE%E5%88%B0%20store%20%E7%9A%84%20REST%20API%E3%80%82%E8%AF%B7%E7%A1%AE%E8%AE%A4%20store%20%E5%AE%9E%E9%99%85%E7%9B%91%E5%90%AC%E7%9A%84%E7%AB%AF%E5%8F%A3%EF%BC%88%E5%BA%94%E8%AF%A5%E6%98%AF%208520%EF%BC%89%EF%BC%8C%E7%84%B6%E5%90%8E%E7%94%A8%E5%A6%82%E4%B8%8B%E5%91%BD%E4%BB%A4%E9%87%8D%E8%AF%95%EF%BC%9A%0A%0A%60%60%60bash%0Acurl%20http%3A//192.168.207.54%3A8520/v1/stores%0A%60%60%60%0A%0A%E5%A6%82%E6%9E%9C%E4%BE%9D%E7 %84%B6%E8%BF%94%E5%9B%9E%20%60Unauthorized%60%EF%BC%8C%E8%AF%B7%E6%A3%80%E6%9F%A5%E6%98%AF%E5%90%A6%E6%9C%89%E8%AE%BE%E7%BD%AE%E4%BA%86%20%60PASSWORD%60%20%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E6%88%96%E7%9B%B8%E5%85%B3%E9%89%B4%E6%9D%83%E9%85%8D%E7%BD%AE%EF%BC%88%E5%A6%82%20%60auth.admin_pa%60%EF%BC%89%EF%BC%8C%E5%9B%A0%E4%B8%BA%20HugeGraph%201.7.0%20%E6%94%AF%E6%8C%81%E5%BC%80%E5%90%AF%E9%89%B4%E6%9D%83%E6%A8%A1%E5%BC%8F%EF%BC%8C%E4%B8%80%E6%97%A6%E5%BC%80%E5%90%AF%EF%BC%8C%E6%89%80%E6%9C%89%20REST%20API%20%E9%83%BD%E9%9C%80%E8%A6%81%E5%B8%A6%E4%B8%8A%E6%AD%A3%E7%A1%AE%E7%9A%84%20Basic%20Auth%20%E8%AE%A4%E8%AF%81%E5%A4%B4%EF%BC%8C%E5%90%A6%E5%88%99%E4%BC%9A%E8%BF%94%E5%9B%9E%20Unauthorized%E3%80%82%E4%BE%8B%E5%A6%82%EF%BC%9A%0A%0A%60%60%60bash%0Acurl%20-H%20%22Authorization%3A%20Basic%20%24%28echo%20-n%20admin%3A%E4%BD%A0%E7%9A%84%E5%AF%86%E7%A0%81%20%7C%20base64%29%22%20http%3A//192.168.207.54%3A8520/v1/stores%0A%60%60%60%0A%0A%E5%A6%82%E6%9E%9C%E4%BD%A0%E6%9C%AC%E6%84%8F%E6%98%AF %E4%B8%8D%E9%9C%80%E8%A6%81%E9%89%B4%E6%9D%83%EF%BC%8C%E7%A1%AE%E4%BF%9D%E5%90%AF%E5%8A%A8%20store%20%E6%97%B6%E6%B2%A1%E6%9C%89%E8%AE%BE%E7%BD%AE%20%60PASSWORD%60%20%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%EF%BC%8C%E5%B9%B6%E6%A3%80%E6%9F%A5%E7%9B%B8%E5%85%B3%E9%85%8D%E7%BD%AE%E9%A1%B9%E6%9C%AA%E5%90%AF%E7%94%A8%E9%89%B4%E6%9D%83%EF%BC%8C%E9%87%8D%E5%90%AF%E6%9C%8D%E5%8A%A1%E5%8D%B3%E5%8F%AF%E3%80%82%0A%0A%E5%A6%82%E6%9E%9C%E4%BD%A0%E9%9C%80%E8%A6%81%E5%BC%80%E5%90%AF%E9%89%B4%E6%9D%83%EF%BC%8C%E4%B8%94%E7%94%A8%E7%9A%84%E6%98%AF%20hstore%20%E5%90%8E%E7%AB%AF%EF%BC%8C%E9%A6%96%E6%AC%A1%E5%88%9D%E5%A7%8B%E5%8C%96%E6%97%B6%E9%9C%80%E8%A6%81%E5%85%88%E6%89%8B%E5%8A%A8%E5%88%9B%E5%BB%BA%20%60~user%60%20%E7%9B%B8%E5%85%B3%20schema%EF%BC%8C%E5%90%A6%E5%88%99%E9%89%B4%E6%9D%83%E5%88%9D%E5%A7%8B%E5%8C%96%E4%BC%9A%E5%A4%B1%E8%B4%A5%EF%BC%8C%E5%AF%BC%E8%87%B4%E6%89%80%E6%9C%89%20API%20%E9%83%BD%E8%BF%94%E5%9B%9E%20Unauthorized%E3%80%82%E5%85%B7%E4%BD%93%E5%8F%AF%E4%BB%A5%E5%8F%82%E8%80%83%5B%E5% AE%98%E6%96%B9%E6%96%87%E6%A1%A3%E8%AF%B4%E6%98%8E%5D%28https%3A//github.com/apache/incubator-hugegraph/issues/2844%23issuecomment-3136272812%29%E3%80%82%0A%0A%E7%9B%B8%E5%85%B3%E5%8F%82%E8%80%83%EF%BC%9A%5B1%5D%28https%3A//github.com/apache/incubator-hugegraph/issues/2818%29%20%5B2%5D%28https%3A//github.com/apache/incubator-hugegraph/issues/2844%23issuecomment-3136272812%29%20%5B3%5D%28https%3A//github.com/apache/incubator-hugegraph/pull/2927%29) [](https://go.dosu.dev/discord-bot) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/incubator-hugegraph/issues/2946) -- 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]
