Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

246
Views
Error de función Lambda: EROFS: sistema de archivos de solo lectura, abrir './tmp/test.zip' El proceso se cerró antes de completar la solicitud

Descargué un archivo zip del cubo s3, luego extraje el archivo zip y finalmente cargué un archivo en el cubo s3 en la función Lambda usando Node JS. Pero recibo el error

==> Error: EROFS: sistema de archivos de solo lectura, abra './tmp/test.zip' "Se cerró el proceso antes de completar la solicitud"

 exports.handler = function (callback) { downloadZipFile(params, downloadPath, function (err) { if (err) { callback(err); } else { processZipFile(downloadPath, function (err) { if (err) { callback(err); } else { callback(null); } }); } }); }; function downloadZipFile(params, downloadPath, callback) { const file = fs.createWriteStream(downloadPath); s3.getObject(params) .on('httpData', function (chunk) { file.write(chunk); }) .on('success', function () { callback(null); }) .on('error', function (err) { callback(err); }) .on('complete', function () { file.end(); }) .send(); } function processZipFile(filePath) { const stats = fs.statSync(filePath) const fileSizeInBytes = stats.size if (fileSizeInBytes > 0) { var srcPath = filePath; var destPath = "./tmp"; targz.decompress({ src: srcPath, dest: destPath }, function (err) { if (err) { console.log(err); } else { console.log("Done!"); UploadFile(); } }); } } function UploadFile() { var body = fs.createReadStream('./tmp/SampleFile.txt') var srcfileKey = "SampleFile.txt"; // Upload the stream var s3obj = new AWS.S3({ params: { Bucket: bucketName, Key: srcfileKey } }); s3obj.upload({ Body: body }, function (err, data) { if (err) { console.log("An error occurred", err); } console.log("Uploaded the file at", data.Location); }) }
about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Debe cambiar la ruta del archivo a solo /tmp en lugar de ./tmp . Lambda solo le permite escribir en el directorio /tmp .

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!