apache / incubator-hugegraph

A graph database that supports more than 100+ billion data, high performance and scalability (Include OLTP Engine & REST-API & Backends)
https://hugegraph.apache.org
Apache License 2.0
2.63k stars 517 forks source link

创建属性的时候报错 #2501

Closed chenhong1990 closed 4 months ago

chenhong1990 commented 6 months ago

Problem Type (问题类型)

rest-api (结果不合预期)

Before submit

Environment (环境信息)

Your Question (问题描述)

        hugeClient = HugeClientConfig.getHugeClient(un);
        SchemaManager schema = hugeClient.schema();
        PropertyKey.Builder builder = schema.propertyKey(GeneralEnum.SYSTEM_NAME.getCode()).asText().valueSingle();  

错误描述:创建客户端之后,PropertyKey.Builder创建属性的时候报错 Method threw 'org.apache.hugegraph.exception.InvalidOperationException' exception. Cannot evaluate com.sun.proxy.$Proxy159.toString()

hugegraph1.2.0的版本创建属性应该怎么处理?

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

No response

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

No response

dosubot[bot] commented 6 months ago

Hey @chenhong1990, great to see you back here! Hope you're doing well since our last interaction. 😊

Based on the error message you provided, it seems like there's an issue with the toString() method of a proxy object. This could be due to a variety of reasons, such as a null object being returned, or an issue with the proxy implementation itself.

Here are some steps you can take to troubleshoot this issue:

  1. Check the Property Key Definition: Ensure that the property key you are trying to create adheres to the HugeGraph schema requirements. This includes valid data types, cardinality, and naming conventions. You can refer to the TypedOption.java file for more details on these requirements.

  2. Review Schema Management API Usage: Verify that you are using the Schema Management API correctly. The error might be due to incorrect API usage or parameters passed to the API.

  3. Inspect the Stack Trace: A detailed stack trace can offer more insights into where exactly the error is occurring. Look for any custom code or specific operations that might be triggering this exception.

  4. Update HugeGraph if Necessary: Although it's not specified if this issue is a known bug in version 1.2.0, it's a good practice to check the release notes or issues in the HugeGraph repository for any known bugs related to property key creation that might have been fixed in later versions.

  5. Debugging and Logging: Enhance logging around the area where the property key creation is happening. This might provide more insights into the failure. Additionally, debugging the application can help pinpoint the exact line of code causing the issue.

If the issue persists, it would be helpful to have more information about your setup. Specifically, the full stack trace of the error, the complete code snippet where the error occurs, and more details about your environment (like the exact OS version, CPU count, RAM, etc.) would be useful in further diagnosing this issue.

Sources

#### About Dosu This response is meant to be useful and save you time. It is **not meant to be a precise solution**, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot.
github-actions[bot] commented 5 months ago

Due to the lack of activity, the current issue is marked as stale and will be closed after 20 days, any update will remove the stale label