GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Cypher vertex/edge type-kind mismatches leak internal `ClassCastException` · Issue #5194 · ArcadeData/arcadedb

Cypher vertex/edge type-kind mismatches leak internal ClassCastException #5194

New issue
Copy link
New issue
Copy link
Closed
Bug
Closed
Cypher vertex/edge type-kind mismatches leak internal ClassCastException#5194
Bug
Copy link
Assignees
lvca
Milestone
26.8.1

Description

@shulei5831sl
shulei5831sl
opened on Jul 10, 2026
Issue body actions

ArcadeDB version

Observed on the latest Docker image:

docker pull arcadedata/arcadedb:latest
Pulled: 2026-07-10

ArcadeDB version: 26.8.1-SNAPSHOT

The behavior was also reproduced in a fresh isolated Docker container, 3 out of 3 runs.

Environment

  • Host OS: x86_64 Linux
  • Deployment: Docker arcadedata/arcadedb:latest
  • Query interface: HTTP command endpoint
  • Query language: Cypher / OpenCypher

Description

ArcadeDB leaks internal Java ClassCastException details when an existing schema type is used in a Cypher context requiring the other graph-element kind.

The issue occurs in both directions:

  1. An existing vertex type name is used as a relationship type in CREATE.
  2. An existing edge type name is used as a node label in MATCH.

The first case exposes:

LocalVertexType cannot be cast to EdgeType

The reverse case exposes:

Cannot cast the edge ... to a vertex

ArcadeDB may intentionally use a shared namespace for vertex and edge type names. This report does not require creating a vertex type and edge type with the same name to succeed.

The issue is that these queries reach internal Java casts instead of being rejected through user-facing schema-kind validation.

Reproduction 1: vertex type used as relationship type

Run each statement separately in the same clean database.

Setup

MATCH (n) DETACH DELETE n;
CREATE (:SharedCollision {v:1});

This creates SharedCollision as a vertex type.

Failing query

MATCH (a:SharedCollision)
CREATE (a)-[:SharedCollision]->(:TargetCollision {v:2})
RETURN 1 AS ok;

Expected behavior

If vertex and edge types share one schema namespace, ArcadeDB should reject the query with a clean validation error such as:

Type 'SharedCollision' already exists as a vertex type and cannot be used as an edge type

At minimum, no internal Java class-cast details should be exposed.

Actual behavior

The transaction fails with CommandExecutionException, and the error detail includes:

class com.arcadedb.schema.LocalVertexType cannot be cast to class com.arcadedb.schema.EdgeType

The error exposes internal implementation classes instead of reporting a schema type-kind conflict.

Reproduction 2: edge type used as node label

Run from a clean database.

Setup

MATCH (n) DETACH DELETE n;
CREATE
  (a:VertexA {v:1}),
  (b:VertexB {v:2}),
  (a)-[:EdgeOnlyType {w:1}]->(b);

This creates EdgeOnlyType as an edge type.

Failing query

MATCH (a:EdgeOnlyType)
RETURN count(a) AS cnt;

Expected behavior

ArcadeDB should either:

  • reject the query with a clean error explaining that EdgeOnlyType is an edge type and cannot be used in a node pattern; or
  • treat the node pattern as having no matching vertices and return cnt = 0.

It should not attempt to cast matching edges to vertices.

Actual behavior

ArcadeDB returns an internal Java exception:

java.lang.ClassCastException: Cannot cast the edge ... to a vertex

Control queries

Matching an actual vertex type works correctly:

MATCH (a:VertexA)
RETURN count(a) AS cnt;

Result:

cnt = 1

Matching a type that does not exist also works without an internal exception:

MATCH (a:NoSuchType)
RETURN count(a) AS cnt;

Result:

cnt = 0

Using distinct vertex and edge type names works correctly:

MATCH (n) DETACH DELETE n;
CREATE
  (a:ControlNode {v:1}),
  (b:ControlNode {v:2}),
  (a)-[:ControlEdge]->(b)
RETURN 1 AS ok;

Result:

ok = 1

Behavior summary

Schema mismatch Actual behavior
Vertex type used as relationship type LocalVertexType cannot be cast to EdgeType
Edge type used as node label Cannot cast the edge ... to a vertex
Existing vertex type used as node label Works
Non-existent type used as node label Returns zero matches
Distinct vertex and edge type names Works

Impact

These errors expose internal Java implementation details and convert a user-facing schema mismatch into an internal execution failure.

Applications cannot reliably distinguish a malformed Cypher query or schema conflict from an ArcadeDB engine failure. The exceptions may also cause transactions to fail later in execution or commit rather than being rejected during schema/type validation.

Related issue

Possibly related to #498, which involved a same-name vertex/edge collision and an internal edge-to-vertex cast failure in the Gremlin traversal path.

The current reproductions affect the latest image and exercise separate Cypher paths:

  • relationship creation through CREATE;
  • node matching through MATCH.

Summary

ArcadeDB should validate whether a schema type is a vertex type or edge type before using it in a Cypher node or relationship context.

When the type kind is incompatible, the query should return a clean user-facing validation error rather than leaking internal LocalVertexType, EdgeType, edge-to-vertex, or other Java ClassCastException details.

Activity

  1. robfrank
    added this to the 26.8.1 milestone on Jul 10, 2026
  2. lvca
    self-assigned this
    on Jul 10, 2026
  3. lvca
    added the
    Bug
    issue type on Jul 10, 2026
  4. lvca
    added a commit that references this issue on Jul 10, 2026

    fix(#5194): clean schema-kind validation for vertex/edge type-name mi…

    0bb17f2
  5. lvca commented on Jul 10, 2026

    @lvca
    lvca
    on Jul 10, 2026
    Member
    More actions

    Thanks for the detailed report, confirmed and fixed in main (commit 0bb17f2), will be in the next release.

    What changed:

    • MATCH (a:EdgeOnlyType) (or matching a relationship using a vertex type name) now returns 0 matches, the same as a non-existent type. This follows Cypher semantics, where node labels and relationship types are separate namespaces.
    • CREATE (a)-[:SharedCollision]->(b) where SharedCollision already exists as a vertex type now fails with a clear validation error: Type 'SharedCollision' is not an edge type (found a vertex type with the same name). Since ArcadeDB uses a single namespace for vertex and edge types, this operation cannot succeed, but now the error explains why instead of leaking internal details.

    No more internal ClassCastException in either direction. The same validation was also applied to SQL CREATE EDGE and the Java API.

  6. lvca
    closed this as completedon Jul 10, 2026
  7. lvca
    added 3 commits that reference this issue on Jul 11, 2026

    fix(#5226): scoped CALL subquery MATCH (n:Label) must not count edges

    3386d7b

    test(#5228): lock scoped CALL MATCH on edge-label to yield no vertex …

    90cc3df

    Merge branch 'issue-5228': regression tests for scoped CALL MATCH on …

    80fb348
  8. robfrank
    added 3 commits that reference this issue on Aug 14, 2026

    fix(#5194): clean schema-kind validation for vertex/edge type-name mi…

    0ac41f6

    fix(#5226): scoped CALL subquery MATCH (n:Label) must not count edges

    576bc28

    test(#5228): lock scoped CALL MATCH on edge-label to yield no vertex …

    aab99fe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @lvca
    lvca

Labels

No labels
No labels

Type

Bug

Projects

No projects

    Milestone

    • 26.8.1

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.