Error with "Copy to"


#1

Hi I am receiving thie error when doing COPY TO with crate command:

crash --hosts 127.0.0.1 -c “copy metermaster22 to DIRECTORY ‘/crateBackup’”
CONNECT OK
SQLActionException[NotSerializableExceptionWrapper: unhandled_server_exception: Failed to open output: ‘/crateBackup/metermaster22_2_.json (No such file or directory)’]


#2

I tried to recreate the error, are you sure that the ‘/crateBackup’ exists?


#3

Hi,

I’m having exactly the same problem.
We have a install/deployment script which always does the same:

  1. remove all json files from backup dir
  2. create new backup files via COPY TO DIRECTORY

This is what I keep getting, and it is not always on the same table too!

curl -H 'Content-Type: application/json' -sSXPOST 'localhost:4200/_sql?pretty' -d@- << EOF
 {"stmt":"COPY bookndrive.\"station\" TO DIRECTORY ?", "args":["/opt/norepos/data/tmp"]}
EOF
{
  "error" : {
    "message" : "SQLActionException[NotSerializableExceptionWrapper: unhandled_server_exception: Failed to open output: '/opt/norepos/data/tmp/station_0_.json (No such file or directory)']",
    "code" : 5000
  }
}

Any idea how we can pinpoint the exact cause of this?


#4

Hi @senchi,

Did you check if the target directory exists?


#5

Hi @roman,

Thank you for the reply!

Yes, of course I’ve checked. There were some hardware problems in our server setup which caused network issues in the last few weeks. I suppose those network issues were responsible for corrupting the index.
In the end, we’ve updated Crate.IO via apt-get to latest version (from 3.0.5 to 3.2.3), and luckily this unblocked the tables and for now, everything works just fine again.

Thanks,
Senad