Neo4j Browser blank screen with error when loading json using apoc.load.json

52 Views Asked by At

I am using neo4j to load a json file which is 103 MB worth. It has only 6500 records though.

I created a apoc.config in the right Configuration location and added the property:

apoc.import.file.enabled=true

I placed the file in dbmss/<dbms_id>/import/<client_name>/data_dump/<file_name.json>. I am able to apoc procedure using:

CALL apoc.load.json("file:///<client_name>/data_dump/<file_name.json>")
YIELD value
RETURN value; 

However, after ~1 mins 50 seconds, the process stops with a blank browser page.

Neo4j Browser error

The following error is shown in the console.

[14:07:54.869] [info]  Neo4j @ 7687 is up and running!
[14:07:54.885] [info]  Neo4j @ 7474 is up and running!






Error sending from webFrameMain:  Error: Render frame was disposed before WebFrameMain could be accessed
    at n.send (node:electron/js2c/browser_init:165:417)
    at b.send (node:electron/js2c/browser_init:161:2494)
    at send (/tmp/.mount_neo4j-WfMZ7l/resources/app.asar/dist/main.prod.js:6062:13)
    at /tmp/.mount_neo4j-WfMZ7l/resources/app.asar/dist/main.prod.js:6066:63
    at Array.forEach (<anonymous>)
    at broadcast (/tmp/.mount_neo4j-WfMZ7l/resources/app.asar/dist/main.prod.js:6066:48)
    at Timeout.onlineCheck [as _onTimeout] (/tmp/.mount_neo4j-WfMZ7l/resources/app.asar/dist/main.prod.js:13066:38)
    at process.processTicksAndRejections (node:internal/process/task_queues:96:5)

I googled somewhere and added:

apoc.http.timeout.connect=600000
apoc.http.timeout.read=600000

No change. Still errors out around 1 min 50 seconds. Not sure what this config is. It is consistently reproducable.

This happens on all of Ubuntu VM, Ubuntu standalone system and Windows. Doesn't look like a display issue. Please help.

1

There are 1 best solutions below

6
cybersam On

[UPDATED]

You are asking the Browser to display 103 MB of data, which may be overtaxing it. The Browser is not really designed to display that much data all at once.

TO BE CLEAR: the issue is not that the neo4j server cannot handle huge amounts of inout data (it certainly can), but with asking the Browser to display huge amounts of data.

If JSON file contains an array of objects

In this case, the apoc.load.json procedure returns each object in a separate row. Try showing just a portion of the array (say, the first 50 items, which will still take up about 800 KB):

CALL apoc.load.json("file:///<client_name>/data_dump/<file_name.json>") YIELD value
RETURN value
LIMIT 50

If JSON file contains an object that contains an array of sub-objects

In this case, the apoc.load.json procedure will return the outer object (with all 103 MB of data) in a single row. If "items" is the key of the array in the outer object, you can show just a portion of the array (say, the first 50 items) this way:

CALL apoc.load.json("file:///<client_name>/data_dump/<file_name.json>") YIELD value
UNWIND value.items AS item
RETURN item
LIMIT 50