The client is unauthorized due to authentication failure

I am using a script to create a database:

cp -f data/*.csv ${NEO4J_IMPORT}/
cd "${NEO4J_HOME}"
time bin/cypher-shell < $tmp_dir/create_graph.cypher

But received the following error message:

cp: /person.csv: Read-only file system
The client is unauthorized due to authentication failure.

I installed the Desktop version and already commented out this line:

In the browser I can connect and query without an issue. The authentification error comes as I use the script to create the graph. Maybe should I somewhere in the creation script include the username/password? But I already commented out the security_auth line.

Please help.

It looks like $tmp_dir might not be set? And is therefore trying to access person.csv at the root level, is that what you intend?

@terryfranklin82 Before that there is one line:

So that's probably not a problem for tmp_dir.

What do you mean by root level? Does that cause this error message? I am creating the database on my local machine, so that root level doesn't matter. My command looks like:

bin/cypher-shell < ~/data/create_graph.cypher

Where to specify the username and password?

with username neo4j and password secret:

cypher-shell -uneo4j -psecret

but I'm still not sure that's the real problem, this:

cp: /person.csv: Read-only file system

looks like it is trying to load person.csv in no directory (the root-level), is that where it's actually located?

cp: /person.csv: Read-only file system. This is where it occurs when I copy my data files to ${NEO4J_IMPORT} directory. Where is the NEO4J_IMPORT located? It's automatically created? Maybe i need to change the file system access permission on that. $NEO4J_IMPORT is created silently by Neo4j?

Are you using Neo4j Desktop? If so you can go to Open Folder -> Import to access the import directory, it's db-specific and pretty heavily nested e.g.

/Users/terry/Library/Application Support/Neo4j Desktop/Application/neo4jDatabases/database-92b8ad30-b044-47e4-babf-f4a3ac491877/installation-3.5.3/import

Yes. But I have to use script to load the data. It's already setup.

What's the root cause of this error message? Not typical?

I think the root cause is cypher-shell can't find your person.csv file.

Can you try another approach to passing the csv, perhaps something that isn't based on an env var?