Issue exporting files with new extension version. Error: [ERR_STREAM_WRITE_AFTER_END]
Hello!
Thank you for the great app! We find it extremely useful to export files in bulk from our org.
When trying to export files from Opportunities today like usual, I am getting the error:
Bulk Query: SELECT ContentDocumentId,LinkedEntityId FROM ContentDocumentLink WHERE LinkedEntityId IN ('%%OPPIDs%%','006OJ00000...node:events:497
throw er; // Unhandled 'error' event
^
Error [ERR_STREAM_WRITE_AFTER_END]: write after end
at _write (node:internal/streams/writable:487:11)
at Writable.write (node:internal/streams/writable:508:10)
at DuplexifiedStream.ondata (node:internal/streams/readable:1007:22)
at DuplexifiedStream.emit (node:events:519:28)
at addChunk (node:internal/streams/readable:559:12)
at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)
at Readable.push (node:internal/streams/readable:390:5)
at DuplexifiedStream._readStream (%%USER%%\AppData\Local\sf\node_modules\@jsforce\jsforce-node\lib\util\stream.js:81:18)
at PassThrough.<anonymous> (%%USER%%\AppData\Local\sf\node_modules\@jsforce\jsforce-node\lib\util\stream.js:64:18)
at PassThrough.emit (node:events:519:28)
at emitReadable_ (node:internal/streams/readable:832:12)
at process.processTicksAndRejections (node:internal/process/task_queues:81:21)
Emitted 'error' event on PassThrough instance at:
at PassThrough.onerror (node:internal/streams/readable:1026:14)
at PassThrough.emit (node:events:519:28)
at emitErrorNT (node:internal/streams/destroy:169:8)
at emitErrorCloseNT (node:internal/streams/destroy:128:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
code: 'ERR_STREAM_WRITE_AFTER_END'
}
Node.js v20.17.0
I have replaced actual Ids and names with placeholders for confidentiality reasons.
Let me know if you need any more information!
Thank you in advance!
@arpit-beautifi is it happening everytime, or is it just bad luck ? I'm not sure there is an error handling in case Bulk API does not reply for a while ^^
@nvuillam Still happening! I have tried creating completely new SFDX projects, reinstalling the plugin, downgrading the version, etc. Nothing seems to be working.
@arpit-beautifi you can use the downgrade workaround until I succeed to reproduce it :)
https://github.com/hardisgroupcom/sfdx-hardis/issues/809
@arpit-beautifi do you still have the problem ?
All plugin dependencies have been upgraded.... who knows, maybe jsforce has been fixed ^^
Hey @nvuillam I am trying to run exports currently on the most recent version and am hitting the mentioned error here. Will downgrade for the time being
I don't succeed to reproduce the issue with latest version :(
@arpit-beautifi @reedwi please can you run sf version --verbose --json and post the result here ?
@arpit-beautifi @reedwi I published enhancements with more logs, please can you check again, using the new Files Export/Import Workbench ?
You can now also increase timeout
@arpit-beautifi @reedwi the issues should be solved, please reopen an issue if you see errors again :)