-
Notifications
You must be signed in to change notification settings - Fork 544
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
the package did not work on azure app service #677
Comments
Hi. Locally working fine but I got the same error when the code is running on a Linode server. (and the server crashes somehow after pdf generate error 502 Bad Gateway)
|
@AriGabay I found some solution: |
Exactly same issue...
|
Any luck? Facing a similar issue on my Azure App Service with Node 18 - LTS (18.16.0). |
@shreyasgombi I think I managed to solve it, but it was a while ago, I don't quite remember what exactly I tried. I hope this Dockerfile helps https://github.com/MaurerKrisztian/template-api-tm/blob/main/Dockerfile |
I'm creating HTML and converting it to pdf with jspdf,jspdf-autotable |
Any idea how to use the Docker file on Azure App Service (Web App)? I'm a newbie to Azure app service. Should I include it in my app project and build? |
Idk, I don't use Azure. |
Ah, ok. Got it. May be @AriGabay can suggest? |
The Docker file needs to be in the backend (App Service). |
Ok, Thanks for the help though. 😃 ❤️ |
This can be resolved in Azure by going to the Web App container in portal.azure.com, and under Settings -> Configuration -> General Settings -> Startup Command change to, for example,
This will add the correct font library and fix phantomjs's SSL error that you'd get after that's resolved. |
Hi everyone,
I ran this function on the azure app service and got this error.
function :
const bufferPdf = async (html, options) => {
try {
return new Promise((resolve, reject) => {
pdf.create(html, options).toBuffer(function (err, buffer) {
if (err) {
return reject(err);
}
resolve(buffer);
});
});
} catch (e) {
console.log('ERROR [bufferPdf]:', e);
}
};
the Error :
2022-05-13T19:14:38.225244279Z: [ERROR] events.js:377
2022-05-13T19:14:38.225273879Z: [ERROR] throw er; // Unhandled 'error' event
2022-05-13T19:14:38.225279879Z: [ERROR] ^
2022-05-13T19:14:38.225283879Z: [ERROR]
2022-05-13T19:14:38.225287679Z: [ERROR] Error: write EPIPE
2022-05-13T19:14:38.225291579Z: [ERROR] at afterWriteDispatched (internal/stream_base_commons.js:156:25)
2022-05-13T19:14:38.225303979Z: [ERROR] at writeGeneric (internal/stream_base_commons.js:147:3)
2022-05-13T19:14:38.225309279Z: [ERROR] at Socket._writeGeneric (net.js:787:11)
2022-05-13T19:14:38.225313379Z: [ERROR] at Socket._write (net.js:799:8)
2022-05-13T19:14:38.225317179Z: [ERROR] at writeOrBuffer (internal/streams/writable.js:358:12)
2022-05-13T19:14:38.225321079Z: [ERROR] at Socket.Writable.write (internal/streams/writable.js:303:10)
2022-05-13T19:14:38.225325179Z: [ERROR] at PDF.PdfExec [as exec] (/home/site/wwwroot/node_modules/html-pdf/lib/pdf.js:156:15)
2022-05-13T19:14:38.225329079Z: [ERROR] at PDF.PdfToBuffer [as toBuffer] (/home/site/wwwroot/node_modules/html-pdf/lib/pdf.js:46:8)
2022-05-13T19:14:38.225332979Z: [ERROR] at /home/site/wwwroot/services/email.service.js:22:33
2022-05-13T19:14:38.225336679Z: [ERROR] at new Promise ()
2022-05-13T19:14:38.225341079Z: [ERROR] Emitted 'error' event on Socket instance at:
2022-05-13T19:14:38.225344879Z: [ERROR] at emitErrorNT (internal/streams/destroy.js:106:8)
2022-05-13T19:14:38.225348579Z: [ERROR] at emitErrorCloseNT (internal/streams/destroy.js:74:3)
2022-05-13T19:14:38.225352278Z: [ERROR] at processTicksAndRejections (internal/process/task_queues.js:82:21) {
2022-05-13T19:14:38.225356078Z: [ERROR] errno: -32,
2022-05-13T19:14:38.225369278Z: [ERROR] code: 'EPIPE',
2022-05-13T19:14:38.225373078Z: [ERROR] syscall: 'write'
2022-05-13T19:14:38.225376478Z: [ERROR] }
The text was updated successfully, but these errors were encountered: