Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
03-09-2021 05:53 AM
Hi
I am new here and just going through importing data in the academy. I am referring to exercise 18 of the neo4j-intro-exercises.
I am struggling to run the neo4j-admin import command in the terminal to import the crimes data using the admin tool. I have followed all the steps and get the following error:
..\bin\neo4j-admin.ps1 : Cannot process argument because the value of
argument "name" is not valid. Change the value of the "name" argument and run the
operation again.
+ CategoryInfo : InvalidArgument: (:) [neo4j-admin.ps1], PSArgumentE
xception
+ FullyQualifiedErrorId : Argument,neo4j-admin.ps1
I am not sure which name argument they are referring to. Has anyone come across a similar error and know how to fix it. My command is:
bin\neo4j-admin import --database crimes --nodes crimes_header.csv,crimes.csv --nodes beats.csv --nodes=PrimaryType=primaryTypes.csv -
-relationships crimesBeats.csv --relationships=PRIMARY_TYPE=crimesPrimaryTypes.csv --trim-strings=true > import.out
Regards,
Grant Magne
Solved! Go to Solution.
03-10-2021 08:36 AM
Hello @glevang
In the Browser Guide for Exercise 18, there is an extra line feed character in the solution text. The command you enter should enter is:
../bin/neo4j-admin import --database crimes --nodes crimes_header.csv,crimes.csv --nodes beats.csv --nodes=PrimaryType=primaryTypes.csv --relationships crimesBeats.csv --relationships=PRIMARY_TYPE=crimesPrimaryTypes.csv --trim-strings=true > import.out
but.... in trying this on a 4.2.1 database, I received an error: insufficient memory. Apparently in 4.2.1, one needs more heap to perform this import. This course was tested on a previous release (4.1).
Before you perform the import change this setting for the database:
dbms.memory.heap.max_size=2G
I will modify the browser guide to include these instructions for heap.
Elaine
03-09-2021 08:06 AM
Hello @glevang and welcome to the Neo4j community!
I think you might be running the windows shell script inside powershell rather than in the Windows console.
To manage Neo4j from within Powershell, see this page for instructions:
Let me know if that helps.
Best,
ABK
03-09-2021 11:24 AM
Hi @abk . Thank you for your welcoming message.
Thank you for your answer. I actually ran the command in my DBMS terminal on neo4j desktop.
After reading your message, I tried running it in the windows command line (same error) and then in Powershell as an admin. I don't get an error when running it in Powershell but I don't get any processing output (and the execution is a few seconds). The import.out file is empty.
I followed the Windows Installation Operations Manager as best I can when I downloaded neo4j the first time. I tried following downloading it again but I noticed the download is identical to the version I have (I installed it for the first time a week ago).
I'm not a developer so I'm not sure if I have done something incorrectly in the installation guide. Do I have to run the windows serice commands and powershell module commands each time I start up Powershell/command line?
Kind regards,
Grant Magne
03-09-2021 01:01 PM
Grant,
What version is the Neo4j database?
Elaine
03-09-2021 10:15 PM
The DBMS is version 4.2.1. I don't have an existing crimes database as per the requirement for using neo4j-admin import tool.
Kind regards,
Grant Magne
03-10-2021 05:08 AM
Hello @glevang ,
It could be that Desktop's terminal is opening a DOS session. Could you try using the .bat
script?
bin\neo4j-admin.bat import --database crimes --nodes crimes_header.csv,crimes.csv --nodes beats.csv --nodes=PrimaryType=primaryTypes.csv -
-relationships crimesBeats.csv --relationships=PRIMARY_TYPE=crimesPrimaryTypes.csv --trim-strings=true > import.out
-ABK
03-10-2021 08:36 AM
Hello @glevang
In the Browser Guide for Exercise 18, there is an extra line feed character in the solution text. The command you enter should enter is:
../bin/neo4j-admin import --database crimes --nodes crimes_header.csv,crimes.csv --nodes beats.csv --nodes=PrimaryType=primaryTypes.csv --relationships crimesBeats.csv --relationships=PRIMARY_TYPE=crimesPrimaryTypes.csv --trim-strings=true > import.out
but.... in trying this on a 4.2.1 database, I received an error: insufficient memory. Apparently in 4.2.1, one needs more heap to perform this import. This course was tested on a previous release (4.1).
Before you perform the import change this setting for the database:
dbms.memory.heap.max_size=2G
I will modify the browser guide to include these instructions for heap.
Elaine
03-10-2021 09:46 AM
Thank you for your help. Changing that setting led to a successful run in the neo4j terminal.
I did however have to add import\
to all of the csv file names to get it to look in the right directory.
Thank you @abk for your help too. The command you suggested also ran successfully in Powershell after I had changed the dbms memory setting. Again I had to add import\
as a prefix to the csv files.
Kind regards,
Grant Magne
All the sessions of the conference are now available online