apache / apache/hugegraph-toolchain

[Bug] 无法导入从导出的schema

Open
#296 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
121
Forks
125
Avg merge
10d 10h
Merged PRs (30d)
3

Description

### Bug Type (问题类型)

other exception / error (其他异常报错)

### Before submit

- [X] 我已经确认现有的 [Issues](https://github.com/hugegraph/hugegraph/issues) 与 [FAQ](https://hugegraph.github.io/hugegraph-doc/guides/faq.html) 中没有相同 / 重复问题

### Environment (环境信息)

- Server Version: v0.12.0
- Backend: RocksDB 1 nodes, HDD
- OS: 8 CPUs, 16 G RAM, Ubuntu 20.04
- Data Size: 0

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

正常情况下应可以导入方才导出的schema数据

导出语句为
```shell
bin/hugegraph --user admin --password xxx backup -t vertex_label,edge_label,property_key,index_label -d schema-bak --compress false
```

后清空schema后执行导入语句,语句为
```shell
bin/hugegraph --user admin --password xxx restore -t vertex_label,edge_label,property_key,index_label -d schema-bak
```

产生如下错误信息
```plain
Warning: please set JAVA_HOME variable, otherwise some libraries related to https may be missing
Graph 'hugegraph' start restore in mode 'RESTORING'!
Init 4 executors
Vertex label restore started
Failed to execute Undefined property key: '手机号'
Type y(yes) to print exception stack[default n]?
yes
class java.lang.IllegalArgumentException: Undefined property key: '手机号'
at com.baidu.hugegraph.exception.ServerException.fromResponse(ServerException.java:47)
at com.baidu.hugegraph.client.RestClient.checkStatus(RestClient.java:93)
at com.baidu.hugegraph.rest.AbstractRestClient.post(AbstractRestClient.java:231)
at com.baidu.hugegraph.rest.AbstractRestClient.post(AbstractRestClient.java:205)
at com.baidu.hugegraph.api.schema.VertexLabelAPI.create(VertexLabelAPI.java:47)
at com.baidu.hugegraph.driver.SchemaManager.addVertexLabel(SchemaManager.java:155)
at com.baidu.hugegraph.manager.RestoreManager.lambda$restoreVertexLabels$7(RestoreManager.java:210)
at com.baidu.hugegraph.manager.BackupRestoreBaseManager.read(BackupRestoreBaseManager.java:186)
at com.baidu.hugegraph.manager.RestoreManager.restore(RestoreManager.java:258)
at com.baidu.hugegraph.manager.RestoreManager.restoreVertexLabels(RestoreManager.java:215)
at com.baidu.hugegraph.manager.RestoreManager.doRestore(RestoreManager.java:87)
at com.baidu.hugegraph.manager.RestoreManager.restore(RestoreManager.java:64)
at com.baidu.hugegraph.cmd.HugeGraphCommand.execute(HugeGraphCommand.java:216)
at com.baidu.hugegraph.cmd.HugeGraphCommand.execute(HugeGraphCommand.java:409)
at com.baidu.hugegraph.cmd.HugeGraphCommand.main(HugeGraphCommand.java:547)

```

是否跟汉字作为节点label有关?

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

_No response_

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

_No response_

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the backup and restore commands with the reported schema and RocksDB environment. Start with RestoreManager.restoreVertexLabels, SchemaManager.addVertexLabel, and BackupRestoreBaseManager.read, following the stack trace and restore order. Done means a schema exported with the listed targets can be restored after the schema is cleared without the undefined property key error.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.