OpenSPG / openspg

OpenSPG is a Knowledge Graph Engine developed by Ant Group in collaboration with OpenKG, based on the SPG (Semantic-enhanced Programmable Graph) framework. Core Capabilities: 1) domain model constrained knowledge modeling, 2) facts and logic fused representation, 3) KAG will be natively supported soon, so please stay tuned...
https://spg.openkg.cn/en-US
Apache License 2.0
627 stars 74 forks source link

Error when executing knext schema commit #206

Closed iwannabewater closed 5 months ago

iwannabewater commented 5 months ago

Follow the installation steps step by step, and there are no errors until this step:

$ knext schema commit Create type: RiskMining.TaxOfRiskUser Create type: RiskMining.TaxOfRiskApp Create type: RiskMining.Cert Create type: RiskMining.App Create type: RiskMining.Company Create relation: [RiskMining.Company] hasCert Create relation: [RiskMining.Company] holdShare Create type: RiskMining.Device Create type: RiskMining.Person Create relation: [RiskMining.Person] hasDevice Create relation: [RiskMining.Person] hasCert Create relation: [RiskMining.Person] holdShare Create relation: [RiskMining.Person] fundTrans Create relation: [RiskMining.Person] developed Create relation: [RiskMining.Person] release ERROR: queryIdx error, and errorMsg=


This error message looks very simple. I don’t know how to debug it. I sincerely ask you for advice❤ I can provide more information if needed.

iwannabewater commented 5 months ago

the complete process:

Stopping and Removing Containers and Network

docker compose down

Output:

[+] Running 5/5
 ✔ Container release-openspg-server         Removed                                                                                                                            1.6s
 ✔ Container release-openspg-tugraph        Removed                                                                                                                           10.5s
 ✔ Container release-openspg-mysql          Removed                                                                                                                            1.0s
 ✔ Container release-openspg-elasticsearch  Removed                                                                                                                            5.2s
 ✔ Network openspg_default                  Removed                                                                                                                            0.4s

Starting Containers

docker compose up -d

Output:

[+] Running 4/5
 ⠋ Network openspg_default                  Created                                                                                                                            1.1s
 ✔ Container release-openspg-elasticsearch  Started                                                                                                                            0.6s
 ✔ Container release-openspg-mysql          Started                                                                                                                            0.6s
 ✔ Container release-openspg-tugraph        Started                                                                                                                            0.4s
 ✔ Container release-openspg-server         Started                                                                                                                            0.8s

Running a Docker Container with Interactive Terminal

docker run --rm --net=host -v /data/xxx/openspg/openspg/:/code -it openspg/openspg-python:latest "/bin/bash"

Output:

(venv) root@host:/# cd code/python/knext/knext/examples/riskmining/
(venv) root@host:/code/python/knext/knext/examples/riskmining# ls
README.md  builder  reasoner  schema

Creating a Project and Committing Schema

knext project create --prj_path .

Output:

Project [RiskMining] with namespace [RiskMining] was successfully created from [.].
knext schema commit

Output:

Create type: RiskMining.TaxOfRiskUser
Create type: RiskMining.TaxOfRiskApp
Create type: RiskMining.Cert
Create type: RiskMining.App
Create type: RiskMining.Company
Create relation: [RiskMining.Company] hasCert
Create relation: [RiskMining.Company] holdShare
Create type: RiskMining.Device
Create type: RiskMining.Person
Create relation: [RiskMining.Person] hasDevice
Create relation: [RiskMining.Person] hasCert
Create relation: [RiskMining.Person] holdShare
Create relation: [RiskMining.Person] fundTrans
Create relation: [RiskMining.Person] developed
Create relation: [RiskMining.Person] release
ERROR: queryIdx error, and errorMsg=
andylau-55 commented 5 months ago

It seems that access to ElasticSearch failed. Please check the local ElasticSearch environment. image

iwannabewater commented 5 months ago

Yes, I changed the elastic search port from 9200 to 9201, and the corresponding location was also changed, like this:

version: "3.7" services: server: restart: always image: openspg/openspg-server:latest container_name: release-openspg-server ports:

Is this yml modified incorrectly? It is normal for me to use the default port 9200, but changing it to 9201 does not work (but the elastic search container is started normally and can be accessed through curl or browser 9201). I want to know how to modify the correct yml. Thank you.

andylau-55 commented 5 months ago

It is not recommended to make any modifications to the contents of the yml file. If you must modify it, you can try changing ports: - "9200:9200" to ports: - "9201:9200"

iwannabewater commented 5 months ago

My 9200 port was occupied by other services, so I changed the port. Moreover, I changed "9200:9200" to "9201:9200", and the server dependencies were also modified accordingly, but there is still elastic search's question, the detailed yml is what I showed in my previous reply. image

andylau-55 commented 5 months ago

You need to restart your Elasticsearch container. Elasticsearch should be accessible via http://localhost:9201

iwannabewater commented 5 months ago

Yes, I do have access to http://localhost:9201/, but it still gives me the error "ERROR: queryIdx error, and errorMsg=", which is very strange and only works if I don't change the default port (9200) for elasticsearch. Anyway, thanks for your patience in replying