diff --git a/arangosh/Dump/DumpFeature.cpp b/arangosh/Dump/DumpFeature.cpp index a8590d0c75..0b73f3ccc4 100644 --- a/arangosh/Dump/DumpFeature.cpp +++ b/arangosh/Dump/DumpFeature.cpp @@ -237,7 +237,8 @@ arangodb::Result dumpJsonObjects(arangodb::DumpFeature::JobData& jobData, file.write(result->c_str(), result->length()); if (file.status().fail()) { - return {TRI_ERROR_CANNOT_WRITE_FILE}; + return {TRI_ERROR_CANNOT_WRITE_FILE, std::string("cannot write file '") + file.path() + + "': " + file.status().errorMessage()}; } jobData.stats.totalWritten += static_cast(result->length()); @@ -476,15 +477,16 @@ arangodb::Result processJob(arangodb::httpclient::SimpleHttpClient& client, dumpData = jobData.maskings->shouldDumpData(jobData.name); } - if (dumpData) { - // save the actual data - auto file = jobData.directory.writableFile(jobData.name + "_" + - hexString + ".data.json", + // always create the file so that arangorestore does not complain + auto file = jobData.directory.writableFile(jobData.name + "_" + hexString + + ".data.json", true); if (!::fileOk(file.get())) { return ::fileError(file.get(), true); } + if (dumpData) { + // save the actual data if (jobData.options.clusterMode) { result = ::handleCollectionCluster(client, jobData, *file); } else {