pdf-creator-node: Error: write EPIPE

Sorry if anyone has had this problem and it has been fixed, I have not found it. I’m trying to run the basic example documentation in the application’s Docker container.

Below is my Dockerfile and the error.

# Dockerizing project

FROM node:14-alpine

# Service port
ARG PORT

RUN apk add --no-cache msttcorefonts-installer fontconfig
RUN update-ms-fonts

# Create app directory
RUN mkdir -p /home/node/app/node_modules && chown -R node:node /home/node/app
WORKDIR /home/node/app

# Copy package.json
COPY package*.json ./

# Install dependencies
RUN npm install

# App source
COPY . .

# Change onwner to node user
RUN chown -R node:node /home/node/app

# Chanhe user to node user
USER node

# Bind port
EXPOSE $PORT

CMD ["npm", "start"]

I get this error:

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] (/home/node/app/node_modules/html-pdf/lib/pdf.js:156:15)
    at PDF.PdfToFile [as toFile] (/home/node/app/node_modules/html-pdf/lib/pdf.js:85:8)
    at /home/node/app/node_modules/pdf-creator-node/index.js:42: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'
}

On my machine it works perfectly. Only in the container that generates the error. Anyone to help? Appreciate.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 5
  • Comments: 16 (1 by maintainers)

Most upvoted comments

I have the same issue, has anyone fixed it?