Cannot call write after a stream was destroyed #2546
Labels
api: storage
Issues related to the googleapis/nodejs-storage API.
needs more info
This issue needs more information from the customer to proceed.
PLEASE READ: If you have a support contract with Google, please create an issue in the support console instead of filing on GitHub. This will ensure a timely response.
Node.js version : 16
"@google-cloud/storage": 7.11.3
Error during file upload NodeError: Cannot call write after a stream was destroyed
8|unipin-node-live | at doWrite (/home/unipin/unipin_nodejslive/node_modules/readable-stream/lib/_stream_writable.js:390:38)
8|unipin-node-live | at writeOrBuffer (/home/unipin/unipin_nodejslive/node_modules/readable-stream/lib/_stream_writable.js:381:5)
8|unipin-node-live | at Writable.write (/home/unipin/unipin_nodejslive/node_modules/readable-stream/lib/_stream_writable.js:302:11)
8|unipin-node-live | at HashStreamValidator.ondata (node:internal/streams/readable:809:22)
8|unipin-node-live | at HashStreamValidator.emit (node:events:517:28)
8|unipin-node-live | at addChunk (node:internal/streams/readable:368:12)
8|unipin-node-live | at readableAddChunk (node:internal/streams/readable:341:9)
8|unipin-node-live | at Readable.push (node:internal/streams/readable:278:10)
8|unipin-node-live | at HashStreamValidator._transform (/home/unipin/unipin_nodejslive/node_modules/@google-cloud/storage/build/cjs/src/hash-stream-validator.js:95:14)
8|unipin-node-live | at Transform._write (node:internal/streams/transform:175:8)
const file = cloudStorage.bucket(bucketName).file(fileName);
return new Promise(async (resolve, reject) => {
try {
// Directly save the file content
await file.save(fileData.buffer, {
metadata: {
contentType: fileData.mimetype,
},
resumable: false, // Set to false as we're not using streams,
validation:false
});
The text was updated successfully, but these errors were encountered: