NEO4J: Couldn't load the external resource at: file:/var/lib/neo4j/import/ - docker

I am running Neo4J on Docker within Vagrant.
I am attempting to LOAD CSV WITH HEADERS from a file within the /import/ directory (I had to move my file there) via a cURL request. My request looks something like this:
"LOAD CSV WITH HEADERS FROM \"file:///insert-neo4j.csv\" AS row ...
This provides me with the following error:
{"results":[],"errors [{"code":"Neo.ClientError.Statement.ExternalResourceFailed","message":"Couldn't load the external resource at: file:/var/lib/neo4j/import/insert-neo4j.csv"}]}
It is often suggested to me that I append the following to my '/conf/neo4j.conf' file, however this file DOES NOT EXIST, and creating it manually does not seem to work...
dbms.directories.import=import
dbms.security.allow_csv_import_from_file_urls=true
So I created the file /conf/neo4j.conf with the above variables, and I also tried adding these as environment variables to my docker-compose file. I seem to continuously have no luck uploading via CSV this way.
My questions are:
Is there anything blatantky wrong with this implementation?
Why does my /conf/neo4j.conf file NOT exist and how can I get it created?
Thank you
(p.s. my insert-neo4j.csv has -rwxr-xr-x)

The error message indicates it found the file but there is an error in the CSV ... most likely the formatting. Check this and if you can't see it, please post a few rows, including the header, of it so we might help.

Related

Informatica Cloud (IICS) filename using wildcard

In Data Integration module, I have created a mapping to load data from Csv file to Oracle table. I want to give a file pattern as the file name will have date in it. When I try to provide file pattern in the Source object, it is throwing the below error.
If someone can assist on letting me know how to load file with a file pattern, it will be very helpful.
Please let me know if you need any further details.
Try using a File Listener as the source for this mapping. In File Listener settings you can provide the pattern - and in turn, File Listener will trigger the mapping with the file found.

Neo.ClientError.Statement.ExternalResourceFailed

load csv with headers from 'file:///C:/Users/user/Desktop/Neo4J'
as row
Create (:State_Code {state_cd:row.st_cd})
I have tried this code and it is throwing an error as:
Neo.ClientError.Statement.ExternalResourceFailed: Couldn't load the external resource at: file:/C:/Users/ssarse/Desktop/Neo4J
Can anyone help me out with this?
By default, Neo4j doesn't allow loading data from file URLs. And if allowed it reads files from the import directory only.
If you want to load files from other directories, you have to allow that in neo4j.conf
You can easily configure this:
Find the neo4j.conf file for your Neo4j installation. Read here about file locations.
Comment this line(By adding # in the start):
dbms.directories.import=import
Uncomment this line to allow CSV import from file URL:
#dbms.security.allow_csv_import_from_file_urls=true
Restart Neo4j
Make sure the file is clean and that you don't use the wrong extention; because in my experience not doing that can cause it to not be imported.

SP2-0310: unable to open file "dba_files_all.sql"

Please advise. This SQLPlus call:
SQL > #dba_files_all
...is not working.
SP2-0310: unable to open file "dba_files_all.sql"
How can I resolve the error?
You need to provide the path of the file as string.
Put the path in double quotes and it will work.
For example:
#"C:\Users\Arpan Saini\Zions R2\Reports Statements and Notices\Patch\08312017_Patch_16.2.3.17\DB Scripts\snsp.sql";
I encountered this error when attempting to execute a file in the same folder as the calling function. In my example, this process:
Was executed in SQL Developer;
Has been a long-standing part of my system (moving a setup file with some settings and variable names through various folders; those folder names include the feature IDs and a short description);
Has worked fine in the past;
Did not require any pathing in my case because the files were in the same folder;
Failed on the most recent attempt with the error above (SP2-0310).
The issue in my situation was that the folder name in which it failed included a character (#) that was valid for a Windows file name, but confusing to SQL Developer.
1.Use absolute path:
/u01/app/oaracle/test.sql
2.Check the path to see if script exists:
ls -l /u01/app/oaracle/test.sql
Note that
SQL> #some_file.sql
means that sql app you are using will look for that using "absolute path" so if you want to use "relative path" use following format [add ?]
SQL> #?some_file.sql
else, use "full path" with first command.
All the answers so far imply that absolute paths are required. That aren't. Relative paths in sql is pretty universal in sql tools. Sometimes, you have to configure a lost default configuration such as in the case of SQLDeveloper as explained in this answer:
https://stackoverflow.com/a/24003529/442968
I just run into same error when I was trying to unlock oe schema.
While reading the error, I realized that when I run the following line:
>SQL #?/demo/schema/order_entry/oe_main.sql
The error returned a completely different path
SP2-0310: unable to open file "C:/app/USER/product/18.0.0/dbhomeXE/demo/schema/order_entry/oe_main.sql"
Thus I copied my sql file to the path specified by the error and everything worked. I recommend that you do the same. Check the path in the error and adjust accordingly.
Use absolute path or run sqlplus command from a shell/dos that points to the path of the script. Also, to use a masterscript, refer to subscripts with ##.
verify that your file has an extension .sql not .sql.txt

Jmeter doesn't save response data or headers

I'm building some simple load testing for my API, and to make sure everything is on the up and up I'd like to also review the response headers and data. But when I run my test using the command line and then re-open the GUI to add a View Results Tree listener and load the created file the response headers or response data is empty.
I entered the following values into user.properties (also tried uncommenting those values in jmeter.properties and changing them there, same result)
jmeter.save.saveservice.output_format=csv (tried xml, omitting it, jtl)
jmeter.save.saveservice.data_type=false
jmeter.save.saveservice.label=true
jmeter.save.saveservice.response_code=true
jmeter.save.saveservice.response_data.on_error=true
jmeter.save.saveservice.response_message=true
jmeter.save.saveservice.successful=true
jmeter.save.saveservice.thread_name=true
jmeter.save.saveservice.time=true
jmeter.save.saveservice.subresults=false
jmeter.save.saveservice.assertions=false
jmeter.save.saveservice.latency=true
jmeter.save.saveservice.bytes=true
jmeter.save.saveservice.hostname=true
jmeter.save.saveservice.thread_counts=true
jmeter.save.saveservice.sample_count=true
jmeter.save.saveservice.response_message=true
jmeter.save.saveservice.assertion_results_failure_message=true
jmeter.save.saveservice.timestamp_format=HH:mm:ss
jmeter.save.saveservice.default_delimiter=;
jmeter.save.saveservice.print_field_names=true
But still no luck when opening the result file. I tried declaring the file after the -l tag as results.csv, .jtl, even .xml but none of them show me the headers and data.
I'm running it locally on Mac OS X 10.10 using the following command, jmeter version is 2.12
java -jar ApacheJMeter.jar -n -t /Users/[username]/Documents/API_test.jmx -l results_15.jtl
I don't know if it's not even saving that data, or if the Listeners can't read it or if I've been cursed but any help is appreciated.
It works fine if I add a Listener and run it using the GUI, but if I try to run my larger tests that way, well, things don't end well for anyone.
So my question is:
How do I save the response header and data to a file when using the command line, and how do I then view said file in jmeter?
Add a Simple Data Writer (under Listeners) and output to a file (NB: different file than your log). Under the 'configure' button, there are all sorts of options of what to save. One of the check boxes is Save Response Header.
This file can get huge if you're saving a bunch of things for every request- one strategy is to check everything, but only save for errors. But you can do whatever works for you.
You can also turn on "Functional Test Mode" which will produce a large file but will contain pretty much anything you might need to debug your test.
Beware, this can create a very large JTL file, so don't forget to turn it off for your large test runs! See JMeter Maven mojo throws IllegalArgumentException with large JTL file
Alternatively use a Tree View Listener in the GUI for a small sample of the requests and check the request/response in the GUI (including headers) to debug or check your test.
Add Below lines in user.properties file
jmeter.save.saveservice.output_format=xml
jmeter.save.saveservice.response_data=true
jmeter.save.saveservice.samplerData=true
jmeter.save.saveservice.requestHeaders=true
jmeter.save.saveservice.url=true
Restart cmd prompt.

How do I change directory and copy a file using FTP?

This code logs in, and tries to change the directory, and then list the files in the directory:
Net::FTP.open(DOMAIN_NAME, LOGIN, PASSWORD) do |ftp|
files = ftp.chdir("forms/")
puts files.list
end
I get this error when I run it:
undefined method `list' for nil:NilClass
The folder definitely exists. I saw it when I tried connecting using cyberduck, and if I do ftp.list.
What am I doing wrong?
Also how would I download a CSV file from the FTP server and then open it?
I tried reading the docs on rubylang and am quite stuck. If anyone could help that would be great!
chdir changes the directory. If you look at the underlying source, it doesn't return anything.
list returns the list of files:
Returns an array of file information in the directory (the output is like ls -l). If a block is given, it iterates through the listing.
As a result files will be nil, because chdir didn't return anything. Instead you need to do something like:
ftp.chdir('forms/')
files = ftp.list
Look at Example #2 in the docs for an example, and ignore that they try to assign the result of chdir.
nlist would be even better than list if all you want is the list of names. Use list if you want a long-listing of the files so you can parse out permissions, sizes, etc.

Resources