You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hugegraph.apache.org by "guijinxin (via GitHub)" <gi...@apache.org> on 2026/01/07 07:43:10 UTC

[I] [Bug] Unexpected "Illegal key 'LABEL'..." happens [incubator-hugegraph]

guijinxin opened a new issue, #2933:
URL: https://github.com/apache/incubator-hugegraph/issues/2933

   ### Bug Type (问题类型)
   
   gremlin (结果不合预期)
   
   ### Before submit
   
   - [x] 我已经确认现有的 [Issues](https://github.com/apache/hugegraph/issues) 与 [FAQ](https://hugegraph.apache.org/docs/guides/faq/) 中没有相同 / 重复问题 (I have confirmed and searched that there are no similar problems in the historical issue and documents)
   
   ### Environment (环境信息)
   
   - Server Version: 1.7.0
   - Backend: RocksDB x nodes
   - OS: 192 CPUs, 256 G RAM, Ubuntu 22.04
   - Data Size:  50 vertices, 100 edges
   
   ### Expected & Actual behavior (期望与实际表现)
   
   ### Expected behavior
   For the two query below, the same result should be returned:
   ```gremlin
   g.V().inE('el0').hasLabel('el0','el2').hasLabel('el1')
   
   g.V().match(__.as('start1').repeat(__.inE('el0')).times(1).as('m1')).select('m1').hasLabel('el0','el2').hasLabel('el1')
   ```
   ### Actual behavior
   + The first query thrown a exception: ```java.lang.IllegalStateException: Illegal key 'LABEL' with more than one value: [1, 3]```
   + The second query returned the results normally.
   + We replaced the ```inE('el0')``` step in the first query with ```match(__.as('start1').repeat(__.inE('el0')).times(1).as('m1')).select('m1')```, which should not affect the result.
   + When I executed these two queries on Janusgraph and Tinkerpop, they both returned the same results and were consistent with the results of the second query.
   + This issue was previously resolved in https://github.com/apache/incubator-hugegraph/pull/1737#issue-1109290490, but it has occurred again.
   
   ### Vertex/Edge example (问题点 / 边数据举例)
   
   ```javascript
   none
   ```
   
   ### Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)
   
   ```javascript
   none
   ```


-- 
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: dev-unsubscribe@hugegraph.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] Unexpected "Illegal key 'LABEL'..." happens [incubator-hugegraph]

Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #2933:
URL: https://github.com/apache/incubator-hugegraph/issues/2933#issuecomment-3717699470

   <!-- Answer -->
   This is a known inconsistency in HugeGraph 1.7.0. The IllegalStateException about "Illegal key 'LABEL' with more than one value" is actually thrown by TinkerPop's Gremlin layer, not HugeGraph itself. It happens because HugeGraph's query planner pushes top-level label filters (like in your first query) into the backend, which triggers stricter validation and sometimes exceptions. In contrast, when you use `match` or nest the filters (like your second query), HugeGraph applies those filters in-memory after retrieving the data, so the exception doesn't occur and results are returned as expected. Other graph databases like JanusGraph and TinkerPop don't have this inconsistency—they return consistent results for both query forms.
   
   There is no recent fix or workaround documented for this specific regression. The best approach for now is to use the query form that works (e.g., using `match` or nested traversals) and avoid the problematic pattern with top-level multiple label filters after `inE()` or similar steps. This behavior is a result of HugeGraph's current query planner design and is not unique to your case—other users have reported similar inconsistencies between equivalent queries in HugeGraph 1.7.0.  
   [Reference](https://github.com/apache/incubator-hugegraph/issues/2929)
   
   
   <!-- 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/9c4f9946-cffc-4677-865d-33456afc8164?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/9c4f9946-cffc-4677-865d-33456afc8164?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/9c4f9946-cffc-4677-865d-33456afc8164?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/9c4f9946-cffc-4677-865d-33456afc8164?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/9c4f9946-cffc-4677-865d-33456afc8164?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/9c4f9946-cffc-4677-865d-33456afc8164?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/9c4f9946-cffc-4677-865d-33456afc8164?feedback_type=other)</sup>
   
   [![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/e5e246fa-a522-4d8a-ab3c-e2588b5b501b/ask?utm_source=github)&nbsp;[![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=This%20is%20a%20known%20inconsistency%20in%20HugeGraph%201.7.0.%20The%20IllegalStateException%20about%20%22Illegal%20key%20%27LABEL%27%20with%20more%20than%20one%20value%22%20is%20actually%20thrown%20by%20TinkerPop%27s%20Gremlin%20layer%2C%20not%20HugeGraph%20itself.%20It%20happens%20because%20HugeGraph%27s%20query%20planner%20pushes%20top-level%20label%20filters%20%28like%20in%20your%20first%20query%29%20into%20the%20backend%2C%20which%20triggers%20stricter%20validation%20and%20sometimes%20exceptions.%20In%20contrast%2C%20when%20you%20use%20%60match%60%20or%20nest%20the%20filters%20%28like%20your%20second%20query%29%2C%20HugeGraph%20applies%20those%20filters%20in-memory%20after%20retrieving%20the%20data%2C%20so%20the%20exception%20doesn%27t%20occu
 r%20and%20results%20are%20returned%20as%20expected.%20Other%20graph%20databases%20like%20JanusGraph%20and%20TinkerPop%20don%27t%20have%20this%20inconsistency%E2%80%94they%20return%20consistent%20results%20for%20both%20query%20forms.%0A%0AThere%20is%20no%20recent%20fix%20or%20workaround%20documented%20for%20this%20specific%20regression.%20The%20best%20approach%20for%20now%20is%20to%20use%20the%20query%20form%20that%20works%20%28e.g.%2C%20using%20%60match%60%20or%20nested%20traversals%29%20and%20avoid%20the%20problematic%20pattern%20with%20top-level%20multiple%20label%20filters%20after%20%60inE%28%29%60%20or%20similar%20steps.%20This%20behavior%20is%20a%20result%20of%20HugeGraph%27s%20current%20query%20planner%20design%20and%20is%20not%20unique%20to%20your%20case%E2%80%94other%20users%20have%20reported%20similar%20inconsistencies%20between%20equivalent%20queries%20in%20HugeGraph%201.7.0.%20%20%0A%5BReference%5D%28https%3A//github.com/apache/incubator-hugegraph/issues/2929%29)&nbsp;[![
 Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/incubator-hugegraph/issues/2933)


-- 
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: issues-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org


Re: [I] [Bug] Unexpected "Illegal key 'LABEL'..." happens [hugegraph]

Posted by "imbajin (via GitHub)" <gi...@apache.org>.
imbajin closed issue #2933: [Bug] Unexpected "Illegal key 'LABEL'..." happens
URL: https://github.com/apache/hugegraph/issues/2933


-- 
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: dev-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org