Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] PDF does not download, no response after clicking #1852

Open
1 task done
KShivum opened this issue Apr 6, 2024 · 1 comment
Open
1 task done

[Bug] PDF does not download, no response after clicking #1852

KShivum opened this issue Apr 6, 2024 · 1 comment
Assignees
Labels
bug Something isn't working needs triage Issues that need to be triaged v4 Issues related to the latest version

Comments

@KShivum
Copy link

KShivum commented Apr 6, 2024

Is there an existing issue for this?

  • Yes, I have searched the existing issues and none of them match my problem.

Product Variant

Self-Hosted

Current Behavior

Clicking on Download PDF or export PDF has it do the circle loading animation, then just stops.

Expected Behavior

Downloads the PDF

Steps To Reproduce

No response

What browsers are you seeing the problem on?

Chrome, Microsoft Edge

What template are you using?

None

Anything else?

Using this docker compose. Both domains are using cloudflared, the public url points to the ip :5160, Storageurl checks the url with the /default then sends it to ip:5140

version: "3.8"

# In this Docker Compose example, it assumes that you maintain a reverse proxy externally (or chose not to).
# The only two exposed ports here are from minio (:9000) and the app itself (:3000).
# If these ports are changed, ensure that the env vars passed to the app are also changed accordingly.

services:
  # Database (Postgres)
  postgres:
    image: postgres:15-alpine
    restart: unless-stopped
    volumes:
      - /mnt/user/appdata/ReactiveResume/db:/var/lib/postgresql/data
    environment:
      POSTGRES_DB: postgres
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: postgres
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U postgres -d postgres"]
      interval: 10s
      timeout: 5s
      retries: 5

  # Storage (for image uploads)
  minio:
    image: minio/minio
    restart: unless-stopped
    command: server /data
    ports:
      - 5140:9000
    volumes:
      - /mnt/user/appdata/ReactiveResume/minio:/data
    environment:
      MINIO_ROOT_USER: minioadmin
      MINIO_ROOT_PASSWORD: minioadmin

  # Chrome Browser (for printing and previews)
  chrome:
    image: ghcr.io/browserless/chromium:latest
    restart: unless-stopped
    extra_hosts:
      - host.docker.internal:host-gateway
    environment:
      TIMEOUT: 10000
      CONCURRENT: 10
      TOKEN: chrome_token
      EXIT_ON_HEALTH_FAILURE: true
      PRE_REQUEST_HEALTH_CHECK: true

  # Redis (for cache & server session management)
  redis:
    image: redis:alpine
    restart: unless-stopped
    command: redis-server --requirepass password

  app:
    image: amruthpillai/reactive-resume:latest
    restart: unless-stopped
    ports:
      - 5160:3000
    depends_on:
      - postgres
      - minio
      - redis
      - chrome
    environment:
      # -- Environment Variables --
      PORT: 3000
      NODE_ENV: production

      # -- URLs --
      PUBLIC_URL: https://resume.xxxx
      STORAGE_URL: http://resume.xxxx/default

      # -- Printer (Chrome) --
      CHROME_TOKEN: chrome_token
      CHROME_URL: ws://chrome:3000

      # -- Database (Postgres) --
      DATABASE_URL: postgresql://postgres:postgres@postgres:5432/postgres

      # -- Auth --
      ACCESS_TOKEN_SECRET: xxx
      REFRESH_TOKEN_SECRET: xxx

      # -- Emails --
      MAIL_FROM: xxx
      # SMTP_URL: smtp://user:pass@smtp:587 # Optional

      # -- Storage (Minio) --
      STORAGE_ENDPOINT: minio
      STORAGE_PORT: 9000
      STORAGE_REGION: us-east-1 # Optional
      STORAGE_BUCKET: default
      STORAGE_ACCESS_KEY: minioadmin
      STORAGE_SECRET_KEY: minioadmin
      STORAGE_USE_SSL: false

      # -- Cache (Redis) --
      REDIS_URL: redis://default:password@redis:6379

Looking at the app logs I'm getting

Trace: TargetCloseError: Protocol error (IO.read): Target closed
    at CallbackRegistry.clear (/app/node_modules/.pnpm/puppeteer-core@22.6.1/node_modules/puppeteer-core/lib/cjs/puppeteer/common/CallbackRegistry.js:72:36)
    at CdpCDPSession._onClosed (/app/node_modules/.pnpm/puppeteer-core@22.6.1/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/CDPSession.js:101:25)
    at #onClose (/app/node_modules/.pnpm/puppeteer-core@22.6.1/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/Connection.js:157:21)
    at WebSocket.<anonymous> (/app/node_modules/.pnpm/puppeteer-core@22.6.1/node_modules/puppeteer-core/lib/cjs/puppeteer/node/NodeWebSocketTransport.js:47:30)
    at callListener (/app/node_modules/.pnpm/ws@8.16.0/node_modules/ws/lib/event-target.js:290:14)
    at WebSocket.onClose (/app/node_modules/.pnpm/ws@8.16.0/node_modules/ws/lib/event-target.js:220:9)
    at WebSocket.emit (node:events:518:28)
    at WebSocket.emit (node:domain:488:12)
    at WebSocket.emitClose (/app/node_modules/.pnpm/ws@8.16.0/node_modules/ws/lib/websocket.js:265:10)
    at Socket.socketOnClose (/app/node_modules/.pnpm/ws@8.16.0/node_modules/ws/lib/websocket.js:1289:15) {
  cause: ProtocolError
      at <instance_members_initializer> (/app/node_modules/.pnpm/puppeteer-core@22.6.1/node_modules/puppeteer-core/lib/cjs/puppeteer/common/CallbackRegistry.js:93:14)
      at new Callback (/app/node_modules/.pnpm/puppeteer-core@22.6.1/node_modules/puppeteer-core/lib/cjs/puppeteer/common/CallbackRegistry.js:97:16)
      at CallbackRegistry.create (/app/node_modules/.pnpm/puppeteer-core@22.6.1/node_modules/puppeteer-core/lib/cjs/puppeteer/common/CallbackRegistry.js:22:26)
      at Connection._rawSend (/app/node_modules/.pnpm/puppeteer-core@22.6.1/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/Connection.js:80:26)
      at CdpCDPSession.send (/app/node_modules/.pnpm/puppeteer-core@22.6.1/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/CDPSession.js:66:33)
      at Object.pull (/app/node_modules/.pnpm/puppeteer-core@22.6.1/node_modules/puppeteer-core/lib/cjs/puppeteer/common/util.js:252:63)
      at ensureIsPromise (node:internal/webstreams/util:185:19)
      at readableStreamDefaultControllerCallPullIfNeeded (node:internal/webstreams/readablestream:2354:5)
      at node:internal/webstreams/readablestream:2359:9
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
}
    at PrinterService.generateResume (/app/dist/apps/server/main.js:13261:21)
    at async PrinterService.printResume (/app/dist/apps/server/main.js:13158:21)
    at async ResumeService.printResume (/app/dist/apps/server/main.js:13993:21)
    at async ResumeController.printResume (/app/dist/apps/server/main.js:13615:25)

I've looked at similar issues but it seems to still happen anyways

@KShivum KShivum added bug Something isn't working needs triage Issues that need to be triaged v4 Issues related to the latest version labels Apr 6, 2024
@KShivum KShivum changed the title [Bug] <title> [Bug] PDF does not download, no response after clicking Apr 9, 2024
@andrew-cullen
Copy link

Would suggest trying the suggestions I placed in this comment ( #1828 (comment) ) - it appears to have worked for a number of other people, and it may work for you as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage Issues that need to be triaged v4 Issues related to the latest version
Projects
None yet
Development

No branches or pull requests

3 participants