[GH-ISSUE #1913] Documenso (self hosted - Docker - MINIO) throws error when you try to upload a PDF document #555

Open
opened 2026-02-26 18:47:33 +03:00 by kerem · 16 comments
Owner

Originally created by @Muntasir2001 on GitHub (Jul 20, 2025).
Original GitHub issue: https://github.com/documenso/documenso/issues/1913

Issue Description

It seems like documenso throws an error after you upload a PDF on dashboard.

This is the error it throws

at async createDocument (file:///app/apps/remix/build/server/hono/packages/lib/server-only/document/create-document.js:63:29)

              at async file:///app/apps/remix/build/server/hono/packages/trpc/server/document-router/router.js:349:12

              at async resolveMiddleware (file:///app/node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:102:30)

              at async callRecursive (file:///app/node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:143:24)

              at async callRecursive (file:///app/node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:143:24)

              at async file:///app/apps/remix/build/server/hono/packages/trpc/server/trpc.js:101:10

          caused by: TypeError: fetch failed

              at node:internal/deps/undici/undici:13510:13

              at process.processTicksAndRejections (node:internal/process/task_queues:105:5)

              at async flattenForm (file:///app/apps/remix/build/server/hono/packages/lib/server-only/pdf/flatten-form.js:15:20)

              at async normalizePdf (file:///app/apps/remix/build/server/hono/packages/lib/server-only/pdf/normalize-pdf.js:11:3)

              at async createDocument (file:///app/apps/remix/build/server/hono/packages/lib/server-only/document/create-document.js:63:29)

              at async file:///app/apps/remix/build/server/hono/packages/trpc/server/document-router/router.js:349:12

              at async resolveMiddleware (file:///app/node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:102:30)

              at async callRecursive (file:///app/node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:143:24)

              at async callRecursive (file:///app/node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:143:24)

              at async file:///app/apps/remix/build/server/hono/packages/trpc/server/trpc.js:101:10

          caused by: AggregateError [ECONNREFUSED]: 

              at internalConnectMultiple (node:net:1139:18)

              at afterConnectMultiple (node:net:1714:7)

              at TCPConnectWrap.callbackTrampoline (node:internal/async_hooks:130:17)

      "code": "INTERNAL_SERVER_ERROR",

      "name": "TRPCError"

    }
Image
[{"error":{"json":{"message":"fetch failed","code":-32603,"data":{"code":"INTERNAL_SERVER_ERROR","httpStatus":500,"stack":"TypeError: fetch failed\n    at node:internal/deps/undici/undici:13510:13\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async flattenForm (file:///app/apps/remix/build/server/hono/packages/lib/server-only/pdf/flatten-form.js:15:20)\n    at async normalizePdf (file:///app/apps/remix/build/server/hono/packages/lib/server-only/pdf/normalize-pdf.js:11:3)\n    at async createDocument (file:///app/apps/remix/build/server/hono/packages/lib/server-only/document/create-document.js:63:29)\n    at async file:///app/apps/remix/build/server/hono/packages/trpc/server/document-router/router.js:349:12\n    at async resolveMiddleware (file:///app/node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:102:30)\n    at async callRecursive (file:///app/node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:143:24)\n    at async callRecursive (file:///app/node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:143:24)\n    at async file:///app/apps/remix/build/server/hono/packages/trpc/server/trpc.js:101:10","path":"document.createDocument"}}}}]

Payload:

{"0":{"json":{"title":"idhni-doc.pdf","documentDataId":"cmdc0zxfd0005mt21sveu42sy","timezone":"Europe/London","folderId":null},"meta":{"values":{"folderId":["undefined"]}}}}

Steps to Reproduce

Docker setup

documenso:
    image: documenso/documenso:v1.12.1
    restart: always
    ports:
      - 8093:3000
    environment:
      - NEXT_PRIVATE_DATABASE_URL=${NEXT_PRIVATE_DATABASE_URL}
      - NEXT_PRIVATE_DIRECT_DATABASE_URL=${NEXT_PRIVATE_DIRECT_DATABASE_URL}
      - NEXTAUTH_SECRET=${NEXTAUTH_SECRET}
      - NEXT_PRIVATE_ENCRYPTION_KEY=${NEXT_PRIVATE_ENCRYPTION_KEY}
      - NEXT_PRIVATE_ENCRYPTION_SECONDARY_KEY=${NEXT_PRIVATE_ENCRYPTION_SECONDARY_KEY}
      - NEXTAUTH_URL=${NEXTAUTH_URL}
      - NEXT_PUBLIC_MARKETING_URL=${NEXT_PUBLIC_MARKETING_URL}
      - NEXT_PUBLIC_WEBAPP_URL=${NEXT_PUBLIC_WEBAPP_URL}
      - NEXT_PRIVATE_INTERNAL_WEBAPP_URL=${NEXT_PRIVATE_INTERNAL_WEBAPP_URL:-http://localhost:3000}
      - NEXT_PRIVATE_SMTP_TRANSPORT=${NEXT_PRIVATE_SMTP_TRANSPORT}
      - NEXT_PRIVATE_SMTP_HOST=${NEXT_PRIVATE_SMTP_HOST}
      - NEXT_PRIVATE_SMTP_PORT=${NEXT_PRIVATE_SMTP_PORT}
      - NEXT_PRIVATE_SMTP_USERNAME=${NEXT_PRIVATE_SMTP_USERNAME}
      - NEXT_PRIVATE_SMTP_PASSWORD=${NEXT_PRIVATE_SMTP_PASSWORD}
      - NEXT_PRIVATE_SMTP_APIKEY=${NEXT_PRIVATE_SMTP_APIKEY}
      - NEXT_PRIVATE_RESEND_API_KEY=${NEXT_PRIVATE_RESEND_API_KEY}
      - NEXT_PRIVATE_SMTP_FROM_NAME=${NEXT_PRIVATE_SMTP_FROM_NAME}
      - NEXT_PRIVATE_SMTP_FROM_ADDRESS=${NEXT_PRIVATE_SMTP_FROM_ADDRESS}
      - NEXT_PUBLIC_UPLOAD_TRANSPORT=${NEXT_PUBLIC_UPLOAD_TRANSPORT}
      - NEXT_PRIVATE_UPLOAD_ENDPOINT=${NEXT_PRIVATE_UPLOAD_ENDPOINT}
      - NEXT_PRIVATE_UPLOAD_BUCKET=${NEXT_PRIVATE_UPLOAD_BUCKET}
      - NEXT_PRIVATE_UPLOAD_FORCE_PATH_STYLE=${NEXT_PRIVATE_UPLOAD_FORCE_PATH_STYLE}
      # - NEXT_PRIVATE_UPLOAD_REGION=${NEXT_PRIVATE_UPLOAD_REGION}
      - NEXT_PRIVATE_UPLOAD_ACCESS_KEY_ID=${NEXT_PRIVATE_UPLOAD_ACCESS_KEY_ID}
      - NEXT_PRIVATE_UPLOAD_SECRET_ACCESS_KEY=${NEXT_PRIVATE_UPLOAD_SECRET_ACCESS_KEY}
      - NEXT_PUBLIC_DISABLE_SIGNUP=${NEXT_PUBLIC_DISABLE_SIGNUP}
    depends_on:
      - documenso-postgres
      - minio
    volumes:
      - ./certificates/certificate.p12:/opt/documenso/cert.p12
    

  documenso-postgres:
    image: postgres:15.8
    environment:
      POSTGRES_PASSWORD: postgres
      POSTGRES_DB: medical-app
    volumes:
      - documenso-postgres-data:/var/lib/postgresql/data
    restart: always

  minio:
    image: minio/minio:latest
    restart: always
    ports:
      - 9000:9000 # MinIO API
      - 9001:9001 # MinIO Console
    environment:
      - MINIO_ROOT_USER=${MINIO_ROOT_USER} # Define this in your .env
      - MINIO_ROOT_PASSWORD=${MINIO_ROOT_PASSWORD} # Define this in your .env
      - MINIO_DEFAULT_BUCKETS=${MINIO_DEFAULT_BUCKETS} # Optional: e.g., "documenso"
    volumes:
      - minio-data:/data
    command: server /data --console-address ":9001"

.env

# Documenso
NEXT_PRIVATE_DATABASE_URL=postgresql://postgres:postgres@documenso-postgres:5432/medical-app?schema=public
NEXT_PRIVATE_DIRECT_DATABASE_URL=postgresql://postgres:postgres@documenso-postgres:5432/medical-app?schema=public
NEXTAUTH_SECRET==
NEXT_PRIVATE_ENCRYPTION_KEY==
NEXT_PRIVATE_ENCRYPTION_SECONDARY_KEY=
NEXT_PUBLIC_WEBAPP_URL=http://localhost:8093 # TEMP
NEXTAUTH_URL=http://localhost:8093
NEXT_PUBLIC_MARKETING_URL=http://localhost:8093
NEXT_PRIVATE_INTERNAL_WEBAPP_URL=http://documenso:3000
NEXT_PRIVATE_SMTP_TRANSPORT=resend
NEXT_PRIVATE_SMTP_HOST=smtp.resend.com
NEXT_PRIVATE_SMTP_PORT=2465
NEXT_PRIVATE_SMTP_USERNAME=resend
NEXT_PRIVATE_SMTP_APIKEY=
NEXT_PRIVATE_SMTP_PASSWORD=
NEXT_PRIVATE_RESEND_API_KEY=
NEXT_PRIVATE_SMTP_FROM_NAME="Do Not Reply"
NEXT_PRIVATE_SMTP_FROM_ADDRESS=
NEXT_PUBLIC_UPLOAD_TRANSPORT=s3
NEXT_PRIVATE_UPLOAD_ENDPOINT=http://minio:9000
NEXT_PRIVATE_UPLOAD_BUCKET=documenso
NEXT_PRIVATE_UPLOAD_ACCESS_KEY_ID=admin
NEXT_PRIVATE_UPLOAD_SECRET_ACCESS_KEY=admin1234
NEXT_PRIVATE_UPLOAD_FORCE_PATH_STYLE=true
NEXT_PUBLIC_DISABLE_SIGNUP=false

# minio
MINIO_ROOT_USER=admin
MINIO_ROOT_PASSWORD=admin1234
MINIO_DEFAULT_BUCKETS=documenso

Expected Behavior

The document should upload and should be visible on the dashboard

Current Behavior

As soon as you upload, documenso shows error but surprisingly, the document is uploaded to MINIO.

Image

Screenshots (optional)

No response

Operating System [e.g., Windows 10]

MacOS

Browser [e.g., Chrome, Firefox]

Arc Browser

Version [e.g., 2.0.1]

Version 1.97.0 (63507)

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 @Muntasir2001 on GitHub (Jul 20, 2025). Original GitHub issue: https://github.com/documenso/documenso/issues/1913 ### Issue Description It seems like documenso throws an error after you upload a PDF on dashboard. This is the error it throws ``` at async createDocument (file:///app/apps/remix/build/server/hono/packages/lib/server-only/document/create-document.js:63:29) at async file:///app/apps/remix/build/server/hono/packages/trpc/server/document-router/router.js:349:12 at async resolveMiddleware (file:///app/node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:102:30) at async callRecursive (file:///app/node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:143:24) at async callRecursive (file:///app/node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:143:24) at async file:///app/apps/remix/build/server/hono/packages/trpc/server/trpc.js:101:10 caused by: TypeError: fetch failed at node:internal/deps/undici/undici:13510:13 at process.processTicksAndRejections (node:internal/process/task_queues:105:5) at async flattenForm (file:///app/apps/remix/build/server/hono/packages/lib/server-only/pdf/flatten-form.js:15:20) at async normalizePdf (file:///app/apps/remix/build/server/hono/packages/lib/server-only/pdf/normalize-pdf.js:11:3) at async createDocument (file:///app/apps/remix/build/server/hono/packages/lib/server-only/document/create-document.js:63:29) at async file:///app/apps/remix/build/server/hono/packages/trpc/server/document-router/router.js:349:12 at async resolveMiddleware (file:///app/node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:102:30) at async callRecursive (file:///app/node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:143:24) at async callRecursive (file:///app/node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:143:24) at async file:///app/apps/remix/build/server/hono/packages/trpc/server/trpc.js:101:10 caused by: AggregateError [ECONNREFUSED]: at internalConnectMultiple (node:net:1139:18) at afterConnectMultiple (node:net:1714:7) at TCPConnectWrap.callbackTrampoline (node:internal/async_hooks:130:17) "code": "INTERNAL_SERVER_ERROR", "name": "TRPCError" } ``` <img width="726" height="179" alt="Image" src="https://github.com/user-attachments/assets/7aa6f05b-cc74-45a2-8d2a-7f429a57a634" /> ``` [{"error":{"json":{"message":"fetch failed","code":-32603,"data":{"code":"INTERNAL_SERVER_ERROR","httpStatus":500,"stack":"TypeError: fetch failed\n at node:internal/deps/undici/undici:13510:13\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async flattenForm (file:///app/apps/remix/build/server/hono/packages/lib/server-only/pdf/flatten-form.js:15:20)\n at async normalizePdf (file:///app/apps/remix/build/server/hono/packages/lib/server-only/pdf/normalize-pdf.js:11:3)\n at async createDocument (file:///app/apps/remix/build/server/hono/packages/lib/server-only/document/create-document.js:63:29)\n at async file:///app/apps/remix/build/server/hono/packages/trpc/server/document-router/router.js:349:12\n at async resolveMiddleware (file:///app/node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:102:30)\n at async callRecursive (file:///app/node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:143:24)\n at async callRecursive (file:///app/node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:143:24)\n at async file:///app/apps/remix/build/server/hono/packages/trpc/server/trpc.js:101:10","path":"document.createDocument"}}}}] ``` Payload: ``` {"0":{"json":{"title":"idhni-doc.pdf","documentDataId":"cmdc0zxfd0005mt21sveu42sy","timezone":"Europe/London","folderId":null},"meta":{"values":{"folderId":["undefined"]}}}} ``` ### Steps to Reproduce Docker setup ```yaml documenso: image: documenso/documenso:v1.12.1 restart: always ports: - 8093:3000 environment: - NEXT_PRIVATE_DATABASE_URL=${NEXT_PRIVATE_DATABASE_URL} - NEXT_PRIVATE_DIRECT_DATABASE_URL=${NEXT_PRIVATE_DIRECT_DATABASE_URL} - NEXTAUTH_SECRET=${NEXTAUTH_SECRET} - NEXT_PRIVATE_ENCRYPTION_KEY=${NEXT_PRIVATE_ENCRYPTION_KEY} - NEXT_PRIVATE_ENCRYPTION_SECONDARY_KEY=${NEXT_PRIVATE_ENCRYPTION_SECONDARY_KEY} - NEXTAUTH_URL=${NEXTAUTH_URL} - NEXT_PUBLIC_MARKETING_URL=${NEXT_PUBLIC_MARKETING_URL} - NEXT_PUBLIC_WEBAPP_URL=${NEXT_PUBLIC_WEBAPP_URL} - NEXT_PRIVATE_INTERNAL_WEBAPP_URL=${NEXT_PRIVATE_INTERNAL_WEBAPP_URL:-http://localhost:3000} - NEXT_PRIVATE_SMTP_TRANSPORT=${NEXT_PRIVATE_SMTP_TRANSPORT} - NEXT_PRIVATE_SMTP_HOST=${NEXT_PRIVATE_SMTP_HOST} - NEXT_PRIVATE_SMTP_PORT=${NEXT_PRIVATE_SMTP_PORT} - NEXT_PRIVATE_SMTP_USERNAME=${NEXT_PRIVATE_SMTP_USERNAME} - NEXT_PRIVATE_SMTP_PASSWORD=${NEXT_PRIVATE_SMTP_PASSWORD} - NEXT_PRIVATE_SMTP_APIKEY=${NEXT_PRIVATE_SMTP_APIKEY} - NEXT_PRIVATE_RESEND_API_KEY=${NEXT_PRIVATE_RESEND_API_KEY} - NEXT_PRIVATE_SMTP_FROM_NAME=${NEXT_PRIVATE_SMTP_FROM_NAME} - NEXT_PRIVATE_SMTP_FROM_ADDRESS=${NEXT_PRIVATE_SMTP_FROM_ADDRESS} - NEXT_PUBLIC_UPLOAD_TRANSPORT=${NEXT_PUBLIC_UPLOAD_TRANSPORT} - NEXT_PRIVATE_UPLOAD_ENDPOINT=${NEXT_PRIVATE_UPLOAD_ENDPOINT} - NEXT_PRIVATE_UPLOAD_BUCKET=${NEXT_PRIVATE_UPLOAD_BUCKET} - NEXT_PRIVATE_UPLOAD_FORCE_PATH_STYLE=${NEXT_PRIVATE_UPLOAD_FORCE_PATH_STYLE} # - NEXT_PRIVATE_UPLOAD_REGION=${NEXT_PRIVATE_UPLOAD_REGION} - NEXT_PRIVATE_UPLOAD_ACCESS_KEY_ID=${NEXT_PRIVATE_UPLOAD_ACCESS_KEY_ID} - NEXT_PRIVATE_UPLOAD_SECRET_ACCESS_KEY=${NEXT_PRIVATE_UPLOAD_SECRET_ACCESS_KEY} - NEXT_PUBLIC_DISABLE_SIGNUP=${NEXT_PUBLIC_DISABLE_SIGNUP} depends_on: - documenso-postgres - minio volumes: - ./certificates/certificate.p12:/opt/documenso/cert.p12 documenso-postgres: image: postgres:15.8 environment: POSTGRES_PASSWORD: postgres POSTGRES_DB: medical-app volumes: - documenso-postgres-data:/var/lib/postgresql/data restart: always minio: image: minio/minio:latest restart: always ports: - 9000:9000 # MinIO API - 9001:9001 # MinIO Console environment: - MINIO_ROOT_USER=${MINIO_ROOT_USER} # Define this in your .env - MINIO_ROOT_PASSWORD=${MINIO_ROOT_PASSWORD} # Define this in your .env - MINIO_DEFAULT_BUCKETS=${MINIO_DEFAULT_BUCKETS} # Optional: e.g., "documenso" volumes: - minio-data:/data command: server /data --console-address ":9001" ``` .env ``` # Documenso NEXT_PRIVATE_DATABASE_URL=postgresql://postgres:postgres@documenso-postgres:5432/medical-app?schema=public NEXT_PRIVATE_DIRECT_DATABASE_URL=postgresql://postgres:postgres@documenso-postgres:5432/medical-app?schema=public NEXTAUTH_SECRET== NEXT_PRIVATE_ENCRYPTION_KEY== NEXT_PRIVATE_ENCRYPTION_SECONDARY_KEY= NEXT_PUBLIC_WEBAPP_URL=http://localhost:8093 # TEMP NEXTAUTH_URL=http://localhost:8093 NEXT_PUBLIC_MARKETING_URL=http://localhost:8093 NEXT_PRIVATE_INTERNAL_WEBAPP_URL=http://documenso:3000 NEXT_PRIVATE_SMTP_TRANSPORT=resend NEXT_PRIVATE_SMTP_HOST=smtp.resend.com NEXT_PRIVATE_SMTP_PORT=2465 NEXT_PRIVATE_SMTP_USERNAME=resend NEXT_PRIVATE_SMTP_APIKEY= NEXT_PRIVATE_SMTP_PASSWORD= NEXT_PRIVATE_RESEND_API_KEY= NEXT_PRIVATE_SMTP_FROM_NAME="Do Not Reply" NEXT_PRIVATE_SMTP_FROM_ADDRESS= NEXT_PUBLIC_UPLOAD_TRANSPORT=s3 NEXT_PRIVATE_UPLOAD_ENDPOINT=http://minio:9000 NEXT_PRIVATE_UPLOAD_BUCKET=documenso NEXT_PRIVATE_UPLOAD_ACCESS_KEY_ID=admin NEXT_PRIVATE_UPLOAD_SECRET_ACCESS_KEY=admin1234 NEXT_PRIVATE_UPLOAD_FORCE_PATH_STYLE=true NEXT_PUBLIC_DISABLE_SIGNUP=false # minio MINIO_ROOT_USER=admin MINIO_ROOT_PASSWORD=admin1234 MINIO_DEFAULT_BUCKETS=documenso ``` ### Expected Behavior The document should upload and should be visible on the dashboard ### Current Behavior As soon as you upload, documenso shows error but surprisingly, the document is uploaded to MINIO. <img width="1286" height="813" alt="Image" src="https://github.com/user-attachments/assets/75d2e353-36f9-4934-b41e-110ee76cd1c5" /> ### Screenshots (optional) _No response_ ### Operating System [e.g., Windows 10] MacOS ### Browser [e.g., Chrome, Firefox] Arc Browser ### Version [e.g., 2.0.1] Version 1.97.0 (63507) ### 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
Author
Owner

@github-actions[bot] commented on GitHub (Jul 20, 2025):

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:3094703337 --> @github-actions[bot] commented on GitHub (Jul 20, 2025): 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

@cch1985 commented on GitHub (Jul 20, 2025):

Quick Fixes to Try:

Fix the internal URL - try using the container IP instead of hostname:

yamlenvironment:

or

Add container hostname explicitly:

yamldocumenso:
image: documenso/documenso:v1.12.1
container_name: documenso
hostname: documenso # Add this line

... rest of config

Ensure all containers are on same network:

yamlservices:
documenso:
# ... your config
networks:
- documenso-network

documenso-postgres:
# ... your config
networks:
- documenso-network

minio:
# ... your config
networks:
- documenso-network

networks:
documenso-network:
driver: bridge
Debug Steps:

Check if containers can communicate: docker exec -it documenso ping minio
Verify MinIO is accessible: docker exec -it documenso curl http://minio:9000
Check Documenso logs: docker logs documenso

The fact that files upload to MinIO but processing fails suggests the upload works but internal PDF processing can't reach required services.

<!-- gh-comment-id:3094762976 --> @cch1985 commented on GitHub (Jul 20, 2025): Quick Fixes to Try: Fix the internal URL - try using the container IP instead of hostname: yamlenvironment: - NEXT_PRIVATE_INTERNAL_WEBAPP_URL=http://127.0.0.1:3000 # or - NEXT_PRIVATE_INTERNAL_WEBAPP_URL=http://localhost:3000 Add container hostname explicitly: yamldocumenso: image: documenso/documenso:v1.12.1 container_name: documenso hostname: documenso # Add this line # ... rest of config Ensure all containers are on same network: yamlservices: documenso: # ... your config networks: - documenso-network documenso-postgres: # ... your config networks: - documenso-network minio: # ... your config networks: - documenso-network networks: documenso-network: driver: bridge Debug Steps: Check if containers can communicate: docker exec -it documenso ping minio Verify MinIO is accessible: docker exec -it documenso curl http://minio:9000 Check Documenso logs: docker logs documenso The fact that files upload to MinIO but processing fails suggests the upload works but internal PDF processing can't reach required services.
Author
Owner

@Muntasir2001 commented on GitHub (Jul 21, 2025):

Thanks

I will try these and let you know how it goes

<!-- gh-comment-id:3098118147 --> @Muntasir2001 commented on GitHub (Jul 21, 2025): Thanks I will try these and let you know how it goes
Author
Owner

@Muntasir2001 commented on GitHub (Jul 22, 2025):

So I have tried this and I get the same error:

appError: {

      "code": "UNKNOWN_ERROR",

      "message": "fetch failed"

    }

    err: {

      "type": "TRPCError",

      "message": "fetch failed: fetch failed: ",

      "stack":

          TypeError: fetch failed

              at node:internal/deps/undici/undici:13510:13

              at process.processTicksAndRejections (node:internal/process/task_queues:105:5)

              at async flattenForm (file:///app/apps/remix/build/server/hono/packages/lib/server-only/pdf/flatten-form.js:15:20)

              at async normalizePdf (file:///app/apps/remix/build/server/hono/packages/lib/server-only/pdf/normalize-pdf.js:11:3)

              at async createDocument (file:///app/apps/remix/build/server/hono/packages/lib/server-only/document/create-document.js:63:29)

              at async file:///app/apps/remix/build/server/hono/packages/trpc/server/document-router/router.js:349:12

              at async resolveMiddleware (file:///app/node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:102:30)

              at async callRecursive (file:///app/node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:143:24)

              at async callRecursive (file:///app/node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:143:24)

              at async file:///app/apps/remix/build/server/hono/packages/trpc/server/trpc.js:101:10

          caused by: TypeError: fetch failed

<!-- gh-comment-id:3102664729 --> @Muntasir2001 commented on GitHub (Jul 22, 2025): So I have tried this and I get the same error: ``` appError: { "code": "UNKNOWN_ERROR", "message": "fetch failed" } err: { "type": "TRPCError", "message": "fetch failed: fetch failed: ", "stack": TypeError: fetch failed at node:internal/deps/undici/undici:13510:13 at process.processTicksAndRejections (node:internal/process/task_queues:105:5) at async flattenForm (file:///app/apps/remix/build/server/hono/packages/lib/server-only/pdf/flatten-form.js:15:20) at async normalizePdf (file:///app/apps/remix/build/server/hono/packages/lib/server-only/pdf/normalize-pdf.js:11:3) at async createDocument (file:///app/apps/remix/build/server/hono/packages/lib/server-only/document/create-document.js:63:29) at async file:///app/apps/remix/build/server/hono/packages/trpc/server/document-router/router.js:349:12 at async resolveMiddleware (file:///app/node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:102:30) at async callRecursive (file:///app/node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:143:24) at async callRecursive (file:///app/node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:143:24) at async file:///app/apps/remix/build/server/hono/packages/trpc/server/trpc.js:101:10 caused by: TypeError: fetch failed ```
Author
Owner

@Muntasir2001 commented on GitHub (Jul 22, 2025):

I ran docker exec -it documenso ping minio and it was able to ping minio.

This command docker exec -it documenso curl http://minio:9000/ failed to run as CURL doesn't exist

OCI runtime exec failed: exec failed: unable to start container process: exec: "curl": executable file not found in $PATH: unknown

<!-- gh-comment-id:3102683103 --> @Muntasir2001 commented on GitHub (Jul 22, 2025): I ran `docker exec -it documenso ping minio` and it was able to ping minio. This command `docker exec -it documenso curl http://minio:9000/` failed to run as CURL doesn't exist `OCI runtime exec failed: exec failed: unable to start container process: exec: "curl": executable file not found in $PATH: unknown`
Author
Owner

@fyusuf-a commented on GitHub (Aug 12, 2025):

I have the same problem and I am trying to debug it.
@Muntasir2001 : in order to have curl, you can follow these steps:

docker exec -it --user root documenso sh -l
apk update
apk add curl
<!-- gh-comment-id:3179850879 --> @fyusuf-a commented on GitHub (Aug 12, 2025): I have the same problem and I am trying to debug it. @Muntasir2001 : in order to have curl, you can follow these steps: ```bash docker exec -it --user root documenso sh -l apk update apk add curl ```
Author
Owner

@Muntasir2001 commented on GitHub (Aug 12, 2025):

Ah great thanks

I will try that but I am 99% sure documenso is able to communicate with minio.

I have done a bit of digging and I think I know the cause behind it.

The browsers tries to use http://minio:9001 URL to show the PDF in preview mode on Documenso. The thing is, that URL is for internal use only and browers won't be able to read that.

I think there must be something like NEXT_PUBLIC_UPLOAD_ENDPOINT too for the external apps like browsers to show the documents in preview mode.

For now, I am using Cloudflare R2 storage but I think this is kind of like a bug.

<!-- gh-comment-id:3179980435 --> @Muntasir2001 commented on GitHub (Aug 12, 2025): Ah great thanks I will try that but I am 99% sure documenso is able to communicate with `minio`. I have done a bit of digging and I think I know the cause behind it. The browsers tries to use http://minio:9001 URL to show the PDF in preview mode on Documenso. The thing is, that URL is for internal use only and browers won't be able to read that. I think there must be something like `NEXT_PUBLIC_UPLOAD_ENDPOINT` too for the external apps like browsers to show the documents in preview mode. For now, I am using Cloudflare R2 storage but I think this is kind of like a bug.
Author
Owner

@fyusuf-a commented on GitHub (Aug 12, 2025):

It seems that the fetch in question is in packages/lib/server-only-pdf/flatten-form.ts.
Documenso tries to fetch a Noto font using NEXT_PUBLIC_WEB_APP_URL. I think it should use NEXT_PRIVATE_INTERNAL_WEBAPP_URL because the fetch seems to occur on the server. Should I make a PR?
@Muntasir2001 I made a quickfix in my docker-compose.yml:

  documenso:
    ports:
      - 3000:3000
...
      - NEXT_PUBLIC_WEBAPP_URL=http://localhost:3000
      - NEXT_PRIVATE_INTERNAL_WEBAPP_URL=http://localhost:3000

But I am pretty sure it would fail if there was another port binding.

<!-- gh-comment-id:3180005640 --> @fyusuf-a commented on GitHub (Aug 12, 2025): It seems that the `fetch` in question is in `packages/lib/server-only-pdf/flatten-form.ts`. Documenso tries to fetch a Noto font using `NEXT_PUBLIC_WEB_APP_URL`. I think it should use `NEXT_PRIVATE_INTERNAL_WEBAPP_URL` because the fetch seems to occur on the server. Should I make a PR? @Muntasir2001 I made a quickfix in my docker-compose.yml: ``` documenso: ports: - 3000:3000 ... - NEXT_PUBLIC_WEBAPP_URL=http://localhost:3000 - NEXT_PRIVATE_INTERNAL_WEBAPP_URL=http://localhost:3000 ``` But I am pretty sure it would fail if there was another port binding.
Author
Owner

@Muntasir2001 commented on GitHub (Aug 12, 2025):

Sorry what was the fix you made here again?
Was it the NEXT_PRIVATE_INTERNAL_WEBAPP_URL?

<!-- gh-comment-id:3180120377 --> @Muntasir2001 commented on GitHub (Aug 12, 2025): Sorry what was the fix you made here again? Was it the `NEXT_PRIVATE_INTERNAL_WEBAPP_URL`?
Author
Owner

@fyusuf-a commented on GitHub (Aug 13, 2025):

Yes, for me, it was using the same port internally and externally.

<!-- gh-comment-id:3183811220 --> @fyusuf-a commented on GitHub (Aug 13, 2025): Yes, for me, it was using the same port internally and externally.
Author
Owner

@ephraimduncan commented on GitHub (Aug 23, 2025):

@Muntasir2001 did it fix it for you???

<!-- gh-comment-id:3216717612 --> @ephraimduncan commented on GitHub (Aug 23, 2025): @Muntasir2001 did it fix it for you???
Author
Owner

@Muntasir2001 commented on GitHub (Aug 23, 2025):

Hi

Sorry I didn't get the chance to test this. Am I testing the PR? Or the docker compose you have shared? @fyusuf-a

<!-- gh-comment-id:3216812499 --> @Muntasir2001 commented on GitHub (Aug 23, 2025): Hi Sorry I didn't get the chance to test this. Am I testing the PR? Or the docker compose you have shared? @fyusuf-a
Author
Owner

@ephraimduncan commented on GitHub (Aug 27, 2025):

The docker compose

<!-- gh-comment-id:3227778837 --> @ephraimduncan commented on GitHub (Aug 27, 2025): The docker compose
Author
Owner

@marcozac commented on GitHub (Aug 27, 2025):

Hello, I'm facing a similar issue.

Using NEXT_PRIVATE_UPLOAD_ENDPOINT="http://minio:9000" the files are correctly uploaded to minio, but there is a fetch failed error when the browser tries to get the file from the same address, that obviously is not reachable.

Using instead NEXT_PRIVATE_UPLOAD_ENDPOINT="http://127.0.0.1:9000" (or localhost), if the minio port is forwarded, the browser can fetch the file, but the upload fails, probably because the minio port is forwarded to the host, not to the documenso container.

I fixed the problem with NEXT_PRIVATE_UPLOAD_ENDPOINT="http://minio.localhost:9000" and adding minio.localhost:host-gateway to documenso extra hosts.

This a part of my compose file:

services:
  documenso:
    depends_on:
      - minio
    image: documenso/documenso:latest
    environment:
      - NEXT_PRIVATE_UPLOAD_ENDPOINT="http://minio.localhost:9000"
    extra_hosts:
      - 'minio.localhost:host-gateway'
    # ...
<!-- gh-comment-id:3229357143 --> @marcozac commented on GitHub (Aug 27, 2025): Hello, I'm facing a similar issue. Using `NEXT_PRIVATE_UPLOAD_ENDPOINT="http://minio:9000"` the files are correctly uploaded to minio, but there is a `fetch failed ` error when the browser tries to get the file from the same address, that obviously is not reachable. Using instead `NEXT_PRIVATE_UPLOAD_ENDPOINT="http://127.0.0.1:9000"` (or localhost), if the minio port is forwarded, the browser can fetch the file, but the upload fails, probably because the minio port is forwarded to the host, not to the documenso container. I fixed the problem with `NEXT_PRIVATE_UPLOAD_ENDPOINT="http://minio.localhost:9000"` and adding `minio.localhost:host-gateway` to documenso extra hosts. This a part of my compose file: ```yaml services: documenso: depends_on: - minio image: documenso/documenso:latest environment: - NEXT_PRIVATE_UPLOAD_ENDPOINT="http://minio.localhost:9000" extra_hosts: - 'minio.localhost:host-gateway' # ... ```
Author
Owner

@Manalisatpute commented on GitHub (Sep 10, 2025):

Yeah I also faced the same issue working with minio
services:
documenso:
depends_on:
- minio
image: documenso/documenso:latest
environment:
- NEXT_PRIVATE_UPLOAD_ENDPOINT="http://minio.localhost:9000"
extra_hosts:
- 'minio.localhost:host-gateway'
# ...
making the above changes provided by @ marcozac helped me and I can store the document in minio and also can preview it in both documenso and minio

<!-- gh-comment-id:3274710280 --> @Manalisatpute commented on GitHub (Sep 10, 2025): Yeah I also faced the same issue working with minio services: documenso: depends_on: - minio image: documenso/documenso:latest environment: - NEXT_PRIVATE_UPLOAD_ENDPOINT="http://minio.localhost:9000" extra_hosts: - 'minio.localhost:host-gateway' # ... making the above changes provided by **@ marcozac** helped me and I can store the document in minio and also can preview it in both documenso and minio
Author
Owner

@racso-dev commented on GitHub (Oct 13, 2025):

Quick Fixes to Try:

Fix the internal URL - try using the container IP instead of hostname:

yamlenvironment:

or

Add container hostname explicitly:

yamldocumenso: image: documenso/documenso:v1.12.1 container_name: documenso hostname: documenso # Add this line

... rest of config

Ensure all containers are on same network:

yamlservices: documenso: # ... your config networks: - documenso-network

documenso-postgres: # ... your config networks: - documenso-network

minio: # ... your config networks: - documenso-network

networks: documenso-network: driver: bridge Debug Steps:

Check if containers can communicate: docker exec -it documenso ping minio Verify MinIO is accessible: docker exec -it documenso curl http://minio:9000 Check Documenso logs: docker logs documenso

The fact that files upload to MinIO but processing fails suggests the upload works but internal PDF processing can't reach required services.

Hey @cch1985, I have a similar issue, except I'm not using minio. My problem is indeed tied to the fact that my documenso instance when uploading refers to my public url. I tried setting the NEXT_PRIVATE_INTERNAL_WEBAPP_URL to localhost:3000 but It keeps on using the public url, can you confirm that setting NEXT_PRIVATE_INTERNAL_WEBAPP_URL is working properly on your end?

<!-- gh-comment-id:3396711108 --> @racso-dev commented on GitHub (Oct 13, 2025): > Quick Fixes to Try: > > Fix the internal URL - try using the container IP instead of hostname: > > yamlenvironment: > > * NEXT_PRIVATE_INTERNAL_WEBAPP_URL=http://127.0.0.1:3000 > > # or > * NEXT_PRIVATE_INTERNAL_WEBAPP_URL=http://localhost:3000 > > Add container hostname explicitly: > > yamldocumenso: image: documenso/documenso:v1.12.1 container_name: documenso hostname: documenso # Add this line > > # ... rest of config > Ensure all containers are on same network: > > yamlservices: documenso: # ... your config networks: - documenso-network > > documenso-postgres: # ... your config networks: - documenso-network > > minio: # ... your config networks: - documenso-network > > networks: documenso-network: driver: bridge Debug Steps: > > Check if containers can communicate: docker exec -it documenso ping minio Verify MinIO is accessible: docker exec -it documenso curl http://minio:9000 Check Documenso logs: docker logs documenso > > The fact that files upload to MinIO but processing fails suggests the upload works but internal PDF processing can't reach required services. Hey @cch1985, I have a similar issue, except I'm not using minio. My problem is indeed tied to the fact that my documenso instance when uploading refers to my public url. I tried setting the NEXT_PRIVATE_INTERNAL_WEBAPP_URL to localhost:3000 but It keeps on using the public url, can you confirm that setting NEXT_PRIVATE_INTERNAL_WEBAPP_URL is working properly on your end?
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#555
No description provided.