Skip to content

Neo4j TypeError: Variables in C parser store nested objects as properties #755

@Kotali-2019

Description

@Kotali-2019

The C parser tries to store tuples/dicts in variable properties, but Neo4j only accepts primitive types

This is a bug in CodeGraphContext's C parser. The properties need to be flattened:

Instead of:
"context": (context_name, context_type, context_line), # Nested - fails in Neo4j

Should be:
"context_name": context_name,
"context_type": context_type,
"context_line": context_line,

Reproduce the error :
git clone https://github.com/ggml-org/llama.cpp.git
cd llama.cpp

~/llama.cpp# cgc index . --force
Loaded configuration from: /root/.codegraphcontext/.env
Using database: Neo4j
Force re-indexing (--force flag detected)
Initializing services and database connection...
Services initialized.
Deleting existing index for: /root/llama.cpp
✓ Deleted old index
Re-indexing: /root/llama.cpp
An error occurred during re-indexing: {neo4j_code:
Neo.ClientError.Statement.TypeError} {message: Property values can only be of
primitive types or arrays thereof. Encountered: Map{name -> String("n"), is_pointer
-> Boolean('false'), is_array -> Boolean('false'), type -> String("int")}.}
{gql_status: 50N42} {gql_status_description: error: general processing exception -
unexpected error. Property values can only be of primitive types or arrays thereof.
Encountered: Map{name -> String("n"), is_pointer -> Boolean('false'), is_array ->
Boolean('false'), type -> String("int")}.}

Update 1: The issue is reproducible in Neo4j and FalkorDB Lite, but not in KùzuDB. As a result, KùzuDB can be used as a workaround.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions