Skip to main content

Error writing to exceptions file in COPY command

  • January 24, 2014
  • 2 replies
  • 17 views

Allan_Cochrane_1
Forum|alt.badge.img
Hi,

I'm seeing this error when using the COPY command:
ERROR 4368:  Permission denied for storage location [/tmp/exceptions]
My command line looks like:
cat data.txt | /opt/vertica/bin/vsql   <host,user,password args> -c "COPY table1(col1,col2) FROM STDIN   EXCEPTIONS '/tmp/exceptions' STREAM NAME 'test load'"
The permissions seem correct:
$ ls -la /tmp
total 40
drwxrwxrwt 4 root root 4096 Jan 23 17:07 .
drwxr-xr-x 32 root root 4096 Sep 25 15:23 ..
srw-rw-rw- 1 spread verticadba 0 Jan 23 06:03 4803
-rw-r--r-- 1 ntp ntp 7 Jan 23 15:24 drift
-rwxrwxrwx 1 acochran acochran 0 Jan 23 17:03 exceptions
drwx------ 2 root root 16384 Jun 3 2011 lost+found

I'm the user acochran

If I remove the EXCEPTIONS and filename from the COPY command then I don't get any errors but I also don't get any data loaded into the table.

The dba checked vertica.log but that didn't show any errors with the COPY command.

I am running vsql on the same host as I am connecting to in the vsql command line.



2 replies

Chandra_Prakash
Forum|alt.badge.img+1
  • Participating Frequently
  • March 7, 2014
if you want to run with exception then it has to run via admin. It is similar as loading data directly from file without using STDIN where normal user are not allowed to load it and will get same errer unless it reads the data file via 'cat' command.

Forum|alt.badge.img+2
  • Participating Frequently
  • March 7, 2014
Hi all,

Actually, there are two solutions here -- run as admin, or grant Vertica (in addition to Linux) permissions on the directory.

Vertica has the notion of "Storage Locations":

https://my.vertica.com/docs/6.1.x/HTML/index.htm#12383.htm
https://my.vertica.com/docs/6.1.x/HTML/index.htm#17722.htm

Non-admin users can only read data from or write data to a location that they have the appropriate access to within Vertica.

Adam