Error write PIPE in AWS using buffer
See original GitHub issueHey guys,
I having this error when i get the buffer of content of pdf and save in S3.
The error:
errors: {error: {message: "write EPIPE", name: "Error",…}}
error: {message: "write EPIPE", name: "Error",…}
frames: [{file: "internal/stream_base_commons.js", filePath: "internal/stream_base_commons.js",…},…]
0: {file: "internal/stream_base_commons.js", filePath: "internal/stream_base_commons.js",…}
1: {file: "internal/stream_base_commons.js", filePath: "internal/stream_base_commons.js",…}
2: {file: "net.js", filePath: "net.js", method: "Socket._writeGeneric", line: 776, column: 11,…}
3: {file: "net.js", filePath: "net.js", method: "Socket._write", line: 788, column: 8, context: {},…}
4: {file: "_stream_writable.js", filePath: "_stream_writable.js", method: "doWrite", line: 435,…}
5: {file: "_stream_writable.js", filePath: "_stream_writable.js", method: "writeOrBuffer", line: 419,…}
6: {file: "_stream_writable.js", filePath: "_stream_writable.js", method: "Socket.Writable.write",…}
7: {file: "node_modules/html-pdf/lib/pdf.js",…}
8: {file: "node_modules/html-pdf/lib/pdf.js",…}
9: {file: "src/app/services/ClienteService.ts",…}
10: {file: "src/app/services/ClienteService.ts",…}
11: {file: "internal/process/task_queues.js", filePath: "internal/process/task_queues.js",…}
12: {file: "src/app/controllers/ClienteController.ts",…}
message: "write EPIPE"
name: "Error"
How i doing the generate PDF
let html = fs.readFileSync('contrato.html', 'utf8');
return new Promise((resolve, reject) => {
pdf.create(html).toBuffer(async function(err, buffer) {
const saveS3 = await salvaS3(buffer, dados.documento);
if (saveS3.status !== 200) {
resolve({
status: 400,
data: 'Erro'
});
}
resolve({
status: 200
});
});
});
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:10
Top Results From Across the Web
node.js Error: write after end - AWS Polly - Stack Overflow
I am trying to use AWS Polly for speech synthesis in my node.js app. When I run the speak(text) function for the first...
Read more >Can not pass PassThrough stream to send object · Issue #1920
Describe the bug There is no possibility to pass stream as type PassThrough to the Body.
Read more >Resolve errors uploading data to or downloading data ... - AWS
First, follow the steps below to run the SELECT INTO OUTFILE S3 or LOAD DATA FROM S3 commands using Amazon Aurora. If you...
Read more >Amazon Kinesis Data Firehose FAQs - Streaming Data Pipeline
If “all documents” mode is used, Amazon Kinesis Data Firehose concatenates multiple incoming records based on buffering configuration of your delivery stream, ...
Read more >Troubleshooting Amazon Kinesis Data Firehose
This happens if you take DynamoDB data that includes the Set type, stream it through Lambda to a delivery stream, and use an...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Have you tried adding
phantomPath
?Hi, I think I’m having a very similar issue. I’m not an experienced dev, could you please share the steps you did to fix it¿?
This is my error, i’m using pdf-creator- node which uses phantom.js
events.js:292 throw er; // Unhandled ‘error’ event ^
Error: write EPIPE at afterWriteDispatched (internal/stream_base_commons.js:156:25) at writeGeneric (internal/stream_base_commons.js:147:3) at Socket._writeGeneric (net.js:785:11) at Socket._write (net.js:797:8) at writeOrBuffer (internal/streams/writable.js:358:12) at Socket.Writable.write (internal/streams/writable.js:303:10) at PDF.PdfExec [as exec] (/app/node_modules/html-pdf/lib/pdf.js:156:15) at PDF.PdfToFile [as toFile] (/app/node_modules/html-pdf/lib/pdf.js:85:8) at /app/node_modules/pdf-creator-node/index.js:69:20 at new Promise (<anonymous>) Emitted ‘error’ event on Socket instance at: at emitErrorNT (internal/streams/destroy.js:106:8) at emitErrorCloseNT (internal/streams/destroy.js:74:3) at processTicksAndRejections (internal/process/task_queues.js:80:21) { errno: -32, code: ‘EPIPE’, syscall: ‘write’ }