[GH-ISSUE #1012] Docker with production config cert error #309

Closed
opened 2026-02-26 18:46:25 +03:00 by kerem · 4 comments
Owner

Originally created by @John-H-Smith on GitHub (Mar 9, 2024).
Original GitHub issue: https://github.com/documenso/documenso/issues/1012

Issue Description

When using the new docker image with compose for production, after signing an document, the container logs shows the following error:

⨯ Error: 'sharp' is required to be installed in standalone mode for the image optimization to function correctly. Read more at: https://nextjs.org/docs/messages/sharp-missing-in-production
 ⨯ Error: 'sharp' is required to be installed in standalone mode for the image optimization to function correctly. Read more at: https://nextjs.org/docs/messages/sharp-missing-in-production
 ⨯ Error: 'sharp' is required to be installed in standalone mode for the image optimization to function correctly. Read more at: https://nextjs.org/docs/messages/sharp-missing-in-production
 ⨯ Error: 'sharp' is required to be installed in standalone mode for the image optimization to function correctly. Read more at: https://nextjs.org/docs/messages/sharp-missing-in-production
 ⨯ Error: 'sharp' is required to be installed in standalone mode for the image optimization to function correctly. Read more at: https://nextjs.org/docs/messages/sharp-missing-in-production
Error: ENOENT: no such file or directory, open './example/cert.p12'
    at Object.openSync (node:fs:596:3)
    at Object.readFileSync (node:fs:464:35)
    at I (/app/apps/web/.next/server/chunks/8690.js:1:350679)
    at async E (/app/apps/web/.next/server/chunks/8690.js:1:349005)
    at async i (/app/apps/web/.next/server/chunks/8690.js:1:5484)
    at async h (/app/apps/web/.next/server/pages/api/trpc/[trpc].js:1:34863)
    at async /app/apps/web/.next/server/pages/api/trpc/[trpc].js:1:101505
    at async resolveMiddleware (file:///app/node_modules/@trpc/server/dist/index.mjs:420:30)
    at async callRecursive (file:///app/node_modules/@trpc/server/dist/index.mjs:456:32)
    at async callRecursive (file:///app/node_modules/@trpc/server/dist/index.mjs:456:32) {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: './example/cert.p12'
}

Also, the pdf itself is marked as signed within the frontend (as of sender's view). But when downloading, the file is as uploaded.

Steps to Reproduce

Create a container depending on the production docker-compose.yml
Set the environement variables as in documentation:

  • POSTGRES_USER
  • POSTGRES_PASSWORD
  • POSTGRES_DB
  • NEXTAUTH_SECRET
  • NEXT_PRIVATE_ENCRYPTION_KEY
  • NEXT_PRIVATE_ENCRYPTION_SECONDARY_KEY
  • NEXT_PUBLIC_WEBAPP_URL
  • NEXT_PRIVATE_SMTP_TRANSPORT
  • NEXT_PRIVATE_SMTP_HOST
  • NEXT_PRIVATE_SMTP_PORT
  • NEXT_PRIVATE_SMTP_USERNAME
  • NEXT_PRIVATE_SMTP_PASSWORD
  • NEXT_PRIVATE_SMTP_FROM_NAME
  • NEXT_PRIVATE_SMTP_FROM_ADDRESS
  • NEXT_PRIVATE_SMTP_SECURE

Upload a document and let it sign from any second-party.
After hitting the "Complete" button (from the signee), the app seems to hung and the backend shows the error above.

Expected Behavior

Signing should be completed without error.

Current Behavior

The error is thrown.

Screenshots (optional)

No response

Operating System [e.g., Windows 10]

Docker version 25.0.4, build 1a576c5

Browser [e.g., Chrome, Firefox]

Brave

Version [e.g., 2.0.1]

1.5.2

Please check the boxes that apply to this issue report.

  • I have searched the existing issues to make sure this is not a duplicate.
  • I have provided steps to reproduce the issue.
  • I have included relevant environment information.
  • I have included any relevant screenshots.
  • I understand that this is a voluntary contribution and that there is no guarantee of resolution.
  • I want to work on creating a PR for this issue if approved
Originally created by @John-H-Smith on GitHub (Mar 9, 2024). Original GitHub issue: https://github.com/documenso/documenso/issues/1012 ### Issue Description When using the new docker image with compose for production, after signing an document, the container logs shows the following error: ``` ⨯ Error: 'sharp' is required to be installed in standalone mode for the image optimization to function correctly. Read more at: https://nextjs.org/docs/messages/sharp-missing-in-production ⨯ Error: 'sharp' is required to be installed in standalone mode for the image optimization to function correctly. Read more at: https://nextjs.org/docs/messages/sharp-missing-in-production ⨯ Error: 'sharp' is required to be installed in standalone mode for the image optimization to function correctly. Read more at: https://nextjs.org/docs/messages/sharp-missing-in-production ⨯ Error: 'sharp' is required to be installed in standalone mode for the image optimization to function correctly. Read more at: https://nextjs.org/docs/messages/sharp-missing-in-production ⨯ Error: 'sharp' is required to be installed in standalone mode for the image optimization to function correctly. Read more at: https://nextjs.org/docs/messages/sharp-missing-in-production Error: ENOENT: no such file or directory, open './example/cert.p12' at Object.openSync (node:fs:596:3) at Object.readFileSync (node:fs:464:35) at I (/app/apps/web/.next/server/chunks/8690.js:1:350679) at async E (/app/apps/web/.next/server/chunks/8690.js:1:349005) at async i (/app/apps/web/.next/server/chunks/8690.js:1:5484) at async h (/app/apps/web/.next/server/pages/api/trpc/[trpc].js:1:34863) at async /app/apps/web/.next/server/pages/api/trpc/[trpc].js:1:101505 at async resolveMiddleware (file:///app/node_modules/@trpc/server/dist/index.mjs:420:30) at async callRecursive (file:///app/node_modules/@trpc/server/dist/index.mjs:456:32) at async callRecursive (file:///app/node_modules/@trpc/server/dist/index.mjs:456:32) { errno: -2, syscall: 'open', code: 'ENOENT', path: './example/cert.p12' } ``` Also, the pdf itself is marked as signed within the frontend (as of sender's view). But when downloading, the file is as uploaded. ### Steps to Reproduce Create a container depending on the [production docker-compose.yml](https://raw.githubusercontent.com/documenso/documenso/release/docker/production/compose.yml) Set the environement variables as in documentation: - POSTGRES_USER - POSTGRES_PASSWORD - POSTGRES_DB - NEXTAUTH_SECRET - NEXT_PRIVATE_ENCRYPTION_KEY - NEXT_PRIVATE_ENCRYPTION_SECONDARY_KEY - NEXT_PUBLIC_WEBAPP_URL - NEXT_PRIVATE_SMTP_TRANSPORT - NEXT_PRIVATE_SMTP_HOST - NEXT_PRIVATE_SMTP_PORT - NEXT_PRIVATE_SMTP_USERNAME - NEXT_PRIVATE_SMTP_PASSWORD - NEXT_PRIVATE_SMTP_FROM_NAME - NEXT_PRIVATE_SMTP_FROM_ADDRESS - NEXT_PRIVATE_SMTP_SECURE Upload a document and let it sign from any second-party. After hitting the "Complete" button (from the signee), the app seems to hung and the backend shows the error above. ### Expected Behavior Signing should be completed without error. ### Current Behavior The error is thrown. ### Screenshots (optional) _No response_ ### Operating System [e.g., Windows 10] Docker version 25.0.4, build 1a576c5 ### Browser [e.g., Chrome, Firefox] Brave ### Version [e.g., 2.0.1] 1.5.2 ### Please check the boxes that apply to this issue report. - [X] I have searched the existing issues to make sure this is not a duplicate. - [X] I have provided steps to reproduce the issue. - [X] I have included relevant environment information. - [ ] I have included any relevant screenshots. - [X] I understand that this is a voluntary contribution and that there is no guarantee of resolution. - [ ] I want to work on creating a PR for this issue if approved
kerem 2026-02-26 18:46:25 +03:00
Author
Owner

@github-actions[bot] commented on GitHub (Mar 9, 2024):

Thank you for opening your first issue and for being a part of the open signing revolution!

One of our team members will review it and get back to you as soon as it possible 💚

Meanwhile, please feel free to hop into our community in Discord

<!-- gh-comment-id:1986910724 --> @github-actions[bot] commented on GitHub (Mar 9, 2024): Thank you for opening your first issue and for being a part of the open signing revolution! <br /> One of our team members will review it and get back to you as soon as it possible 💚 <br /> Meanwhile, please feel free to hop into our community in [Discord](https://documen.so/discord)
Author
Owner

@Mythie commented on GitHub (Mar 10, 2024):

Hey Fabian, this is absolutely our bad! I've made an update to the compose files to address this in the related PR #1013

For a production compose deployment you will need to provide your own keyfile via either volumes or the NEXT_PRIVATE_SIGNING_LOCAL_FILE_CONTENTS environment variable. The docs at docker/README.md will be updated to reflect this as well 😄

Thanks for catching this for us 🙌🏻

<!-- gh-comment-id:1987049749 --> @Mythie commented on GitHub (Mar 10, 2024): Hey Fabian, this is absolutely our bad! I've made an update to the compose files to address this in the related PR #1013 For a production compose deployment you will need to provide your own keyfile via either volumes or the `NEXT_PRIVATE_SIGNING_LOCAL_FILE_CONTENTS` environment variable. The docs at `docker/README.md` will be updated to reflect this as well 😄 Thanks for catching this for us 🙌🏻
Author
Owner

@saschafoerster commented on GitHub (Mar 10, 2024):

@Mythie Might also be helpful to add some information about user rights. I created my keys with the same machine, but then because of 0600 these files couldn't be used by docker.
With chown 1001:1001 key/ -R, I changed the user to the internal docker user, then it worked.

<!-- gh-comment-id:1987249330 --> @saschafoerster commented on GitHub (Mar 10, 2024): @Mythie Might also be helpful to add some information about user rights. I created my keys with the same machine, but then because of 0600 these files couldn't be used by docker. With chown 1001:1001 key/ -R, I changed the user to the internal docker user, then it worked.
Author
Owner

@John-H-Smith commented on GitHub (Mar 11, 2024):

@Mythie Thanks for fixing so fast!
Maybe, just to enhance the docs, you could add how to create the .p12 file.

<!-- gh-comment-id:1987677794 --> @John-H-Smith commented on GitHub (Mar 11, 2024): @Mythie Thanks for fixing so fast! Maybe, just to enhance the docs, you could add how to create the .p12 file.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/documenso#309
No description provided.