Neo.ClientError.Procedure.ProcedureCallFailed: Failed to invoke procedure `apoc.load.json

(keelong) #1

Error
Neo.ClientError.Procedure.ProcedureCallFailed: Failed to invoke procedure apoc.load.json: Caused by: com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'topic_key': was expecting 'null', 'true', 'false' or NaN at [Source: (apoc.export.util.CountingInputStream); line: 1, column: 11]

Statement

<call apoc.load.json('file:///cred_event_TurkRatings.data') yield value
return value
limit 5>

Problem:

  1. I try to load json file stored in the import file to neo4j desktop by apoc.load.json
  2. It keeps failing to invoke procedure 'apoc.load.json', where I cannot figure out anything wrong. I am really wanna dying in the water.:scream::frowning_face:
  3. But it works well if I load some json data from API url.
    The apoc.version is 3.5.01.

What can I do now to fix this problem?

I have enabled the settings in the configuration.
apoc.import.file.enabled=true
apoc.import.file.use_neo4j_config=true
dbms.security.allow_csv_import_from_file_urls=true

0 Likes

(Michael Hunger) #2

You can provide the full path or use the config option:

If you put it into the import directory then enable this in your config.

apoc.import.file.use_neo4j_config=true

Enable reading properties: dbms.directories.import , dbms.security.allow_csv_import_from_file_urls

0 Likes

(keelong) #3

hi, michael,
thank you very much for your reply.
I have enabled these command in the configuration. I have even tried to use the full path. But it still failed.
Moreover, I tried to load csv data by using apoc.load.csv, it cannot work either, which can be loaded successfully by < load csv from...> provided by cypher.

0 Likes

(keelong) #4

0 Likes

(Michael Hunger) #5

Which OS are you running?
And where exactly did you put your file.

0 Likes

(Conker84) #6

Hi @keelong the apoc.load.csv has the following signature:
CALL apoc.load.csv('url',{config}) YIELD lineNo, list, strings, map, stringMap so you can invoke it in the following way:

CALL apoc.load.csv('file:///desktop-csv-import/orders.csv') YIELD lineNo, list, strings, map, stringMap

you can also yield a specific value, i.e.:

CALL apoc.load.csv('file:///desktop-csv-import/orders.csv') YIELD map which returns a map of values

About the apoc.load.json, the input seems not to be a valid json; just to be sure can you try to validate it with this online service?

0 Likes