Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] graphs/hugegraph/graph/vertices API 报 NotFoundException #2196

Closed
1 task done
lanerbean opened this issue Apr 12, 2023 · 11 comments
Closed
1 task done

[Question] graphs/hugegraph/graph/vertices API 报 NotFoundException #2196

lanerbean opened this issue Apr 12, 2023 · 11 comments
Labels
doc Document expected mysql question Further information is requested

Comments

@lanerbean
Copy link

Bug Type (问题类型)

server status (启动/运行异常)

Before submit

  • 我已经确认现有的 IssuesFAQ 中没有相同 / 重复问题 (I have confirmed and searched that there are no similar problems in the historical issue and documents)

Environment (环境信息)

  • Server Version: 1.0.0 (Apache Release Version)
  • Backend: MySQL 8.0.32
  • OS: CentOS 7.x

Expected & Actual behavior (期望与实际表现)

Actual behavior

image

Vertex/Edge example (问题点 / 边数据举例)

No response

Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)

No response

@lanerbean lanerbean added the bug Something isn't working label Apr 12, 2023
@imbajin imbajin changed the title 成功开启HugegraphServer服务之后,输入“curl http://localhost:8080/graphs/hugegraph/graph/vertices ”命令,报错:{"exception":"class jakarta.ws.rs.NotFoundException","message":"Graph 'hugegraph' does not exist","cause":""} [Question] graphs/hugegraph/graph/vertices API 报 NotFoundException Apr 12, 2023
@imbajin
Copy link
Member

imbajin commented Apr 12, 2023

Thanks for the report, we need more context to ensure the problem

  1. ensure the hugegraph exist (try visit localhost:8080/graphs to see the result)
  2. ensure we use the correct HTTP Method with vertex API

@lanerbean
Copy link
Author

lanerbean commented Apr 12, 2023

1、访问 localhost:8080/graphs 没有出现问题:
![image](https://user-images.githubusercontent.com/18582787/231384940-c71d06e8-5dbd-455e-9b75-> 4feaf5a2a5ca.png)
image

显然这是没有任何图初始化的输出呢, 是不符合预期的, 你需要 init-store 确认成功, 文档应该有这个步骤

返回应该是 {"graphs":["hugegraph"]}才对

@lanerbean
Copy link
Author

我在进行init操作时,出现的日志是这样的:
[root@DESKTOP-UABNU86 bin]# ./init-store.sh
Initializing HugeGraph Store...
2023-04-12 13:48:45 [main] [INFO] o.a.h.u.ConfigUtil - Scanning option 'graphs' directory './conf/graphs'
2023-04-12 13:48:45 [main] [INFO] o.a.h.c.InitStore - Init graph with config file: ./conf/graphs/hugegraph.properties
2023-04-12 13:48:45 [main] [WARN] o.a.h.c.HugeConfig - The config option 'jdbc.sslmode' is redundant, please ensure it has been registered
2023-04-12 13:48:45 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/?socketTimeout=0&useSSL=false'
Loading class com.mysql.jdbc.Driver'. This is deprecated. The new driver class is com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
2023-04-12 13:48:45 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?characterEncoding=utf-8&rewriteBatchedStatements=true&useServerPrepStmts=false&autoReconnect=false&maxReconnects=3&initialTimeout=3&useSSL=false'
2023-04-12 13:48:45 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?characterEncoding=utf-8&rewriteBatchedStatements=true&useServerPrepStmts=false&autoReconnect=true&maxReconnects=3&initialTimeout=3&useSSL=false'
2023-04-12 13:48:45 [main] [INFO] o.a.h.b.c.CacheManager - Init RamCache for 'schema-id-hugegraph' with capacity 10000
2023-04-12 13:48:45 [main] [INFO] o.a.h.b.c.CacheManager - Init RamCache for 'schema-name-hugegraph' with capacity 100002023-04-12 13:48:45 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/?socketTimeout=0&useSSL=false'
2023-04-12 13:48:45 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?characterEncoding=utf-8&rewriteBatchedStatements=true&useServerPrepStmts=false&autoReconnect=false&maxReconnects=3&initialTimeout=3&useSSL=false'
2023-04-12 13:48:45 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?characterEncoding=utf-8&rewriteBatchedStatements=true&useServerPrepStmts=false&autoReconnect=true&maxReconnects=3&initialTimeout=3&useSSL=false'
main dict load finished, time elapsed 585 ms
model load finished, time elapsed 39 ms.
2023-04-12 13:48:46 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/?socketTimeout=0&useSSL=false'
2023-04-12 13:48:46 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?characterEncoding=utf-8&rewriteBatchedStatements=true&useServerPrepStmts=false&autoReconnect=false&maxReconnects=3&initialTimeout=3&useSSL=false'
2023-04-12 13:48:46 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?characterEncoding=utf-8&rewriteBatchedStatements=true&useServerPrepStmts=false&autoReconnect=true&maxReconnects=3&initialTimeout=3&useSSL=false'
2023-04-12 13:48:46 [main] [INFO] o.c.o.l.Uns - OHC using JNA OS native malloc/free
2023-04-12 13:48:46 [main] [INFO] o.a.h.b.c.CacheManager - Init LevelCache for 'vertex-hugegraph' with capacity 10000:10000000
2023-04-12 13:48:46 [main] [INFO] o.a.h.b.c.CacheManager - Init LevelCache for 'edge-hugegraph' with capacity 1000:1000000
2023-04-12 13:48:46 [main] [INFO] o.a.h.b.c.CacheManager - Init RamCache for 'users-hugegraph' with capacity 10240
2023-04-12 13:48:46 [main] [INFO] o.a.h.b.c.CacheManager - Init RamCache for 'users_pwd-hugegraph' with capacity 10240
2023-04-12 13:48:46 [main] [INFO] o.a.h.b.c.CacheManager - Init RamCache for 'token-hugegraph' with capacity 10240
2023-04-12 13:48:46 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/?socketTimeout=0&useSSL=false'
2023-04-12 13:48:46 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?socketTimeout=0&useSSL=false'
2023-04-12 13:48:46 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?socketTimeout=0&useSSL=false'
2023-04-12 13:48:46 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?socketTimeout=0&useSSL=false'
2023-04-12 13:48:46 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?socketTimeout=0&useSSL=false'
2023-04-12 13:48:46 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?socketTimeout=0&useSSL=false'
2023-04-12 13:48:46 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?socketTimeout=0&useSSL=false'
2023-04-12 13:48:46 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?socketTimeout=0&useSSL=false'
2023-04-12 13:48:46 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?socketTimeout=0&useSSL=false'
2023-04-12 13:48:46 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?socketTimeout=0&useSSL=false'
2023-04-12 13:48:46 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?socketTimeout=0&useSSL=false'
2023-04-12 13:48:46 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?socketTimeout=0&useSSL=false'
2023-04-12 13:48:46 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?socketTimeout=0&useSSL=false'
2023-04-12 13:48:46 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/?socketTimeout=0&useSSL=false'
2023-04-12 13:48:46 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?socketTimeout=0&useSSL=false'
2023-04-12 13:48:46 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?socketTimeout=0&useSSL=false'
2023-04-12 13:48:46 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?socketTimeout=0&useSSL=false'
2023-04-12 13:48:46 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?socketTimeout=0&useSSL=false'
2023-04-12 13:48:46 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?socketTimeout=0&useSSL=false'
2023-04-12 13:48:46 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?socketTimeout=0&useSSL=false'
2023-04-12 13:48:46 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?socketTimeout=0&useSSL=false'
2023-04-12 13:48:46 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?socketTimeout=0&useSSL=false'
2023-04-12 13:48:46 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?socketTimeout=0&useSSL=false'
2023-04-12 13:48:46 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?socketTimeout=0&useSSL=false'
2023-04-12 13:48:46 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?socketTimeout=0&useSSL=false'
2023-04-12 13:48:46 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/?socketTimeout=0&useSSL=false'
2023-04-12 13:48:46 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?socketTimeout=0&useSSL=false'
2023-04-12 13:48:46 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?socketTimeout=0&useSSL=false'
2023-04-12 13:48:46 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?socketTimeout=0&useSSL=false'
2023-04-12 13:48:46 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?socketTimeout=0&useSSL=false'
2023-04-12 13:48:47 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?socketTimeout=0&useSSL=false'
2023-04-12 13:48:47 [main] [INFO] o.a.h.c.InitStore - Skip init-store due to the backend store of 'hugegraph' had been initialized
2023-04-12 13:48:47 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/?socketTimeout=0&useSSL=false'
2023-04-12 13:48:47 [main] [INFO] o.a.h.StandardHugeGraph - Close graph standardhugegraph[hugegraph]
2023-04-12 13:48:47 [main] [INFO] o.a.h.HugeFactory - HugeFactory shutdown
2023-04-12 13:48:47 [hugegraph-shutdown] [INFO] o.a.h.HugeFactory - HugeGraph is shutting down
Initialization finished.

在init操作之前,我在lib中,引用了“mysql-connector-java-8.0.30.jar”这个包

@imbajin
Copy link
Member

imbajin commented Apr 12, 2023

2023-04-12 13:48:47 [main] [INFO] o.a.h.c.InitStore - Skip init-store due to the backend store of 'hugegraph' had been initialized

不好意思之前编辑了你的 comment, 本来是回复一下.. 从这里看它跳过了 hugegraph 的初始化:

  • 那你需要看看是否启动 start-server 的时候日志里报错信息, 以及是否初始化完整了
  • 如果不确定是否完整, 又是空的 db, 可以在 mysql 里删掉之前的 hugegraph 然后重新初始化一次看看

@lanerbean
Copy link
Author

1、访问 localhost:8080/graphs 没有出现问题:
![image](https://user-images.githubusercontent.com/18582787/231384940-c71d06e8-5dbd-455e-9b75-> 4feaf5a2a5ca.png)
image

显然这是没有任何图初始化的输出呢, 是不符合预期的, 你需要 init-store 确认成功, 文档应该有这个步骤

返回应该是 {"graphs":["hugegraph"]}才对

已经解决问题了,原因是hugegraph.properties中mysql的配置少写了一个:jdbc.connect_database=hugegraph,
目前修改之后的配置是这样的:
image

@lanerbean
Copy link
Author

2023-04-12 13:48:47 [main] [INFO] o.a.h.c.InitStore - Skip init-store due to the backend store of 'hugegraph' had been initialized

不好意思之前编辑了你的 comment, 本来是回复一下.. 从这里看它跳过了 hugegraph 的初始化:

  • 那你需要看看是否启动 start-server 的时候日志里报错信息, 以及是否初始化完整了
  • 如果不确定是否完整, 又是空的 db, 可以在 mysql 里删掉之前的 hugegraph 然后重新初始化一次看看

谢谢你,确实是因为数据库没有配置好导致的问题,现在get vertex已经没有问题了:
image

image

@imbajin
Copy link
Member

imbajin commented Apr 12, 2023

已经解决问题了,原因是 hugegraph.properties 中 mysql 的配置少写了一个:jdbc.connect_database=hugegraph, 目前修改之后的配置是这样的: image

OK, 默认配置文件(模板)里没有么, 或者文档里缺失的话, 可以直接提交两个 PR 分别完善一下, 帮助一下其他同学, 另外也可以把

在 lib 中,引用了 “mysql-connector-java-8.0.30.jar” 包现在需要手动下载写到默认的配置文件注释上面, 以及 doc 里补充一下, Thanks

可以参考这个 issue 添加一下文档的说明

@imbajin imbajin added question Further information is requested doc Document expected mysql and removed bug Something isn't working labels Apr 12, 2023
@lanerbean
Copy link
Author

好的

@imbajin
Copy link
Member

imbajin commented May 6, 2023

好的

不知道有空在 server & doc 仓库提交两个小 PR 么? 可以帮助下其它 MySQL 用户

@lanerbean
Copy link
Author

好的

不知道有空在 server & doc 仓库提交两个小 PR 么? 可以帮助下其它 MySQL 用户

您好,我刚刚提交了一个doc更改:新增MySQL做后端数据库的配置,不知道这样提交对不对
image

@imbajin
Copy link
Member

imbajin commented May 12, 2023

您好,我刚刚提交了一个 doc 更改:新增 MySQL 做后端数据库的配置,不知道这样提交对不对 image

可以的, 您可以直接在 doc 仓库那边提交 PR, 提交后我们可以直接 review / 修改更新的, 这样更直观准确一些 (好像现在还没提交 PR). 如果是不熟悉 PR 过程可以参考这里, 使用 Github 客户端会大幅简化流程

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Document expected mysql question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants