Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
08-26-2018 12:48 PM
I’m having an issue importing from a cypher file using neo4j-shell -file <file>
. The file includes transaction directives. The first few clear old data, reset and rebuild the schema. Then I have a ~300 line single query that seeds default data (runs fine in the browser). On this, the shell dies with “Transaction started\nWarning: Exiting with unterminated multi-line input.”
Is there a limit to the size of a query the shell can import? Thanks!
Solved! Go to Solution.
08-27-2018 02:22 PM
I think it should also work with cypher-shell if you moved your comments a bit, or perhaps use /* */
style comments
08-26-2018 12:51 PM
Could it be that you either have stray quotes in your script, like 15" Monitor
or perhaps an &&
which is command separator in neo4j-shell?
Please note that neo4j-shell is deprecated, and you should move to cypher-shell instead.
08-26-2018 01:20 PM
No stray quotes or &&. I tried with cat seeder.cql | cypher-shell
, but this method does not seem to support multiple transactions in the file? For instance, if the following file only contains the first transaction, it works, but if the second is included, it dies.
:begin
MATCH (n) DETACH DELETE n
:commit
:begin
CALL apoc.schema.assert({}, {});
CREATE CONSTRAINT ON (n:Axis) ASSERT n.uuid IS UNIQUE;
:commit
08-26-2018 01:21 PM
Do you get any exceptions? How big is your graph? If it is too large you might want to batch the deletes.
08-26-2018 01:27 PM
The graph is quite tiny, under 300KiB, all-in.
With the above, the error is (and exception starting at org.neo4j.driver.internal.util.ErrorUtil.newNeo4jError(ErrorUtil.java:61)
:
WITH is required between DELETE and CALL (line 5, column 1 (offset: 42))
"CALL apoc.schema.assert({}, {});"
^
08-26-2018 01:33 PM
Derp, ok fixed by NOT omitting semicolons, even for single-statement transactions.
AND, I see my initial issue is due to having comments in the input file. Comments not supported with cypher-shell?
08-27-2018 01:36 AM
Yes, there is an open issue, for fixing comments in cypher-shell input files. Which has unfortunately not been addressed.
08-27-2018 11:39 AM
Thanks for the info! Well when I fixed my lack of semicolons, everything's working with neo4j-shell, for now. #newb. I'll watch for the bug to be fixed in cypher-shell so I can get on the modern stuff.
08-27-2018 02:22 PM
I think it should also work with cypher-shell if you moved your comments a bit, or perhaps use /* */
style comments
All the sessions of the conference are now available online