[GH-ISSUE #4481] [bug]: How to migrate after runnning if it doesn't run at all?... #1639

Closed
opened 2026-03-16 21:12:35 +03:00 by kerem · 2 comments
Owner

Originally created by @nvroot on GitHub (Oct 26, 2024).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/4481

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

Has anyone ever tried to run this something on Caprover or Coolify? Feels like devs do everything to make that painful and impossible...
After some painful hours get that error and check related document:
how to run that pnpx prisma migrate deploy if that container only stopping a second after run due to that error?

stdout Backend Server | Initialize PubSub stderr Backend Server | /dist/backend/dist/utils.js:16 stderr Backend Server | throw new Error(errMessage); stderr Backend Server | ^ stderr Backend Server | stderr Backend Server | Error: Database migration not found. Please check the documentation for assistance: https://docs.hoppscotch.io/documentation/self-host/community-edition/install-and-build#running-migrations stderr Backend Server | at throwErr (/dist/backend/dist/utils.js:16:11) stderr Backend Server | at InfraConfigService.initializeInfraConfigTable (/dist/backend/dist/infra-config/infra-config.service.js:66:38) stderr Backend Server | at async InfraConfigService.onModuleInit (/dist/backend/dist/infra-config/infra-config.service.js:40:9) stderr Backend Server | at async Promise.all (index 0) stderr Backend Server | at async callModuleInitHook (/dist/backend/node_modules/.pnpm/@nestjs+core@10.2.7_@nestjs+common@10.2.7_class-transformer@0.5.1_class-validator@0.14.1_refl_i5vxtddbnp5qhu6jmywguprp3e/node_modules/@nestjs/core/hooks/on-module-init.hook.js:43:5) stderr Backend Server | at async NestApplication.callInitHook (/dist/backend/node_modules/.pnpm/@nestjs+core@10.2.7_@nestjs+common@10.2.7_class-transformer@0.5.1_class-validator@0.14.1_refl_i5vxtddbnp5qhu6jmywguprp3e/node_modules/@nestjs/core/nest-application-context.js:223:13) stderr Backend Server | at async NestApplication.init (/dist/backend/node_modules/.pnpm/@nestjs+core@10.2.7_@nestjs+common@10.2.7_class-transformer@0.5.1_class-validator@0.14.1_refl_i5vxtddbnp5qhu6jmywguprp3e/node_modules/@nestjs/core/nest-application.js:100:9) stderr Backend Server | at async NestApplication.listen (/dist/backend/node_modules/.pnpm/@nestjs+core@10.2.7_@nestjs+common@10.2.7_class-transformer@0.5.1_class-validator@0.14.1_refl_i5vxtddbnp5qhu6jmywguprp3e/node_modules/@nestjs/core/nest-application.js:169:33) stderr Backend Server | at async bootstrap (/dist/backend/dist/main.js:69:5) stderr Backend Server | stderr Backend Server | Node.js v20.18.0 stdout Exiting process because Backend Server exited with code 1

Steps to reproduce

  1. Try to install to Coolify
    or
  2. Try to install to Caprover

Environment

Production

Version

Self-hosted

Originally created by @nvroot on GitHub (Oct 26, 2024). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/4481 ### Is there an existing issue for this? - [X] I have searched the existing issues ### Current behavior Has anyone ever tried to run this something on Caprover or Coolify? Feels like devs do everything to make that painful and impossible... After some painful hours get that error and check related document: how to run that `pnpx prisma migrate deploy` if that container only stopping a second after run due to that error? `stdout Backend Server | Initialize PubSub stderr Backend Server | /dist/backend/dist/utils.js:16 stderr Backend Server | throw new Error(errMessage); stderr Backend Server | ^ stderr Backend Server | stderr Backend Server | Error: Database migration not found. Please check the documentation for assistance: https://docs.hoppscotch.io/documentation/self-host/community-edition/install-and-build#running-migrations stderr Backend Server | at throwErr (/dist/backend/dist/utils.js:16:11) stderr Backend Server | at InfraConfigService.initializeInfraConfigTable (/dist/backend/dist/infra-config/infra-config.service.js:66:38) stderr Backend Server | at async InfraConfigService.onModuleInit (/dist/backend/dist/infra-config/infra-config.service.js:40:9) stderr Backend Server | at async Promise.all (index 0) stderr Backend Server | at async callModuleInitHook (/dist/backend/node_modules/.pnpm/@nestjs+core@10.2.7_@nestjs+common@10.2.7_class-transformer@0.5.1_class-validator@0.14.1_refl_i5vxtddbnp5qhu6jmywguprp3e/node_modules/@nestjs/core/hooks/on-module-init.hook.js:43:5) stderr Backend Server | at async NestApplication.callInitHook (/dist/backend/node_modules/.pnpm/@nestjs+core@10.2.7_@nestjs+common@10.2.7_class-transformer@0.5.1_class-validator@0.14.1_refl_i5vxtddbnp5qhu6jmywguprp3e/node_modules/@nestjs/core/nest-application-context.js:223:13) stderr Backend Server | at async NestApplication.init (/dist/backend/node_modules/.pnpm/@nestjs+core@10.2.7_@nestjs+common@10.2.7_class-transformer@0.5.1_class-validator@0.14.1_refl_i5vxtddbnp5qhu6jmywguprp3e/node_modules/@nestjs/core/nest-application.js:100:9) stderr Backend Server | at async NestApplication.listen (/dist/backend/node_modules/.pnpm/@nestjs+core@10.2.7_@nestjs+common@10.2.7_class-transformer@0.5.1_class-validator@0.14.1_refl_i5vxtddbnp5qhu6jmywguprp3e/node_modules/@nestjs/core/nest-application.js:169:33) stderr Backend Server | at async bootstrap (/dist/backend/dist/main.js:69:5) stderr Backend Server | stderr Backend Server | Node.js v20.18.0 stdout Exiting process because Backend Server exited with code 1` ### Steps to reproduce 1. Try to install to Coolify or 1. Try to install to Caprover ### Environment Production ### Version Self-hosted
kerem 2026-03-16 21:12:35 +03:00
Author
Owner

@pmcnano commented on GitHub (Feb 16, 2025):

Would've been nice posting how did you solve it 😄

<!-- gh-comment-id:2661184413 --> @pmcnano commented on GitHub (Feb 16, 2025): Would've been nice posting how did you solve it 😄
Author
Owner

@nvroot commented on GitHub (Feb 17, 2025):

@pmcnano

I created a custom docker-compose file for AIO and set it as the default template in Coolify, switching to it.
on docker-compose at least one authentication provider must be configured, and the DATA_ENCRYPTION_KEY must be exactly 32 characters long. Sometimes, after a restart and migration, the backend doesn't start automatically but runs successfully after a manual restart using:
docker compose down && docker compose up -d

Working Docker-Compose for AIO Hoppscotch without separate .env:

services:
  hoppscotch:
    image: 'hoppscotch/hoppscotch:latest'
    environment:
      - 'VITE_ALLOWED_AUTH_PROVIDERS=EMAIL'
      - 'DATABASE_URL=postgresql://hoppscotch:changeme@hoppscotch-db:5432/hoppscotch'
      - 'JWT_SECRET=changejwt'
      - 'TOKEN_SALT_COMPLEXITY=10'
      - 'MAGIC_LINK_TOKEN_VALIDITY=3'
      - 'REFRESH_TOKEN_VALIDITY=604800000'
      - 'ACCESS_TOKEN_VALIDITY=86400000'
      - 'SESSION_SECRET=changesecret'
      - 'ALLOW_SECURE_COOKIES=true'
      - 'DATA_ENCRYPTION_KEY=mustbeexactry32characterlikethat'
      - 'REDIRECT_URL=https://hop.site.com'
      - 'WHITELISTED_ORIGINS=https://hop.site.com/backend,https://hop.site.com,https://hop.site.com/admin'
      - 'MAILER_SMTP_ENABLE=true'
      - 'MAILER_USE_CUSTOM_CONFIGS=true'
      - 'MAILER_SMTP_URL=smtps://test@gmail.com:changeme@smtp.gmail.com:587'
      - 'MAILER_ADDRESS_FROM=test@gmail.com'
      - 'MAILER_SMTP_HOST=smtp.gmail.com'
      - 'MAILER_SMTP_PORT=587'
      - 'MAILER_SMTP_SECURE=false'
      - 'MAILER_SMTP_USER=test@gmail.com'
      - 'MAILER_SMTP_PASSWORD=changesmtp'
      - 'MAILER_TLS_REJECT_UNAUTHORIZED=false'
      - 'RATE_LIMIT_TTL=${RATE_LIMIT_TTL:-60}'
      - 'RATE_LIMIT_MAX=${RATE_LIMIT_MAX:-100}'
      - 'VITE_BASE_URL=https://hop.site.com'
      - 'VITE_SHORTCODE_BASE_URL=https://hop.site.com'
      - 'VITE_ADMIN_URL=https://hop.site.com/admin'
      - 'VITE_BACKEND_GQL_URL=https://hop.site.com/backend/graphql'
      - 'VITE_BACKEND_WS_URL=wss://hop.site.com/backend/graphql'
      - 'VITE_BACKEND_API_URL=https://hop.site.com/backend/v1'
      - 'VITE_APP_TOS_LINK=https://docs.hoppscotch.io/support/terms'
      - 'VITE_APP_PRIVACY_POLICY_LINK=https://docs.hoppscotch.io/support/privacy'
      - ENABLE_SUBPATH_BASED_ACCESS=true
    depends_on:
      db-migration:
        condition: service_completed_successfully
    healthcheck:
      test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:80/"]
      interval: 5s
      timeout: 20s
      retries: 10
  hoppscotch-db:
    image: 'postgres:latest'
    volumes:
      - 'hopp-db:/var/lib/postgresql/data'
    environment:
      - 'POSTGRES_USER=hoppscotch'
      - 'POSTGRES_PASSWORD=changeme'
      - 'POSTGRES_DB=hoppscotch'
    healthcheck:
      test:
        - CMD-SHELL
        - 'pg_isready -h localhost -U hoppscotch -d hoppscotch'
      interval: 5s
      timeout: 10s
      retries: 10
  db-migration:
    image: 'hoppscotch/hoppscotch:latest'
    depends_on:
      hoppscotch-db:
        condition: service_healthy
    command: 'pnpx prisma migrate deploy'
    restart: on-failure
    environment:
      - 'POSTGRES_USER=hoppscotch'
      - 'POSTGRES_PASSWORD=changeme'
      - 'POSTGRES_DB=hoppscotch'
      - 'DATABASE_URL=postgres://hoppscotch:changeme@hoppscotch-db:5432/hoppscotch'
volumes:
  hopp-db:

Proxyscotch clone and build using script:
https://github.com/ssqlone/proxyscotch-linux-arm64 - only for linux arm
https://github.com/hoppscotch/proxyscotch - all others

<!-- gh-comment-id:2663112231 --> @nvroot commented on GitHub (Feb 17, 2025): @pmcnano I created a custom docker-compose file for AIO and set it as the default template in Coolify, switching to it. on docker-compose at least one authentication provider must be configured, and the DATA_ENCRYPTION_KEY must be exactly 32 characters long. Sometimes, after a restart and migration, the backend doesn't start automatically but runs successfully after a manual restart using: `docker compose down && docker compose up -d` Working Docker-Compose for AIO Hoppscotch without separate .env: ```yaml services: hoppscotch: image: 'hoppscotch/hoppscotch:latest' environment: - 'VITE_ALLOWED_AUTH_PROVIDERS=EMAIL' - 'DATABASE_URL=postgresql://hoppscotch:changeme@hoppscotch-db:5432/hoppscotch' - 'JWT_SECRET=changejwt' - 'TOKEN_SALT_COMPLEXITY=10' - 'MAGIC_LINK_TOKEN_VALIDITY=3' - 'REFRESH_TOKEN_VALIDITY=604800000' - 'ACCESS_TOKEN_VALIDITY=86400000' - 'SESSION_SECRET=changesecret' - 'ALLOW_SECURE_COOKIES=true' - 'DATA_ENCRYPTION_KEY=mustbeexactry32characterlikethat' - 'REDIRECT_URL=https://hop.site.com' - 'WHITELISTED_ORIGINS=https://hop.site.com/backend,https://hop.site.com,https://hop.site.com/admin' - 'MAILER_SMTP_ENABLE=true' - 'MAILER_USE_CUSTOM_CONFIGS=true' - 'MAILER_SMTP_URL=smtps://test@gmail.com:changeme@smtp.gmail.com:587' - 'MAILER_ADDRESS_FROM=test@gmail.com' - 'MAILER_SMTP_HOST=smtp.gmail.com' - 'MAILER_SMTP_PORT=587' - 'MAILER_SMTP_SECURE=false' - 'MAILER_SMTP_USER=test@gmail.com' - 'MAILER_SMTP_PASSWORD=changesmtp' - 'MAILER_TLS_REJECT_UNAUTHORIZED=false' - 'RATE_LIMIT_TTL=${RATE_LIMIT_TTL:-60}' - 'RATE_LIMIT_MAX=${RATE_LIMIT_MAX:-100}' - 'VITE_BASE_URL=https://hop.site.com' - 'VITE_SHORTCODE_BASE_URL=https://hop.site.com' - 'VITE_ADMIN_URL=https://hop.site.com/admin' - 'VITE_BACKEND_GQL_URL=https://hop.site.com/backend/graphql' - 'VITE_BACKEND_WS_URL=wss://hop.site.com/backend/graphql' - 'VITE_BACKEND_API_URL=https://hop.site.com/backend/v1' - 'VITE_APP_TOS_LINK=https://docs.hoppscotch.io/support/terms' - 'VITE_APP_PRIVACY_POLICY_LINK=https://docs.hoppscotch.io/support/privacy' - ENABLE_SUBPATH_BASED_ACCESS=true depends_on: db-migration: condition: service_completed_successfully healthcheck: test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:80/"] interval: 5s timeout: 20s retries: 10 hoppscotch-db: image: 'postgres:latest' volumes: - 'hopp-db:/var/lib/postgresql/data' environment: - 'POSTGRES_USER=hoppscotch' - 'POSTGRES_PASSWORD=changeme' - 'POSTGRES_DB=hoppscotch' healthcheck: test: - CMD-SHELL - 'pg_isready -h localhost -U hoppscotch -d hoppscotch' interval: 5s timeout: 10s retries: 10 db-migration: image: 'hoppscotch/hoppscotch:latest' depends_on: hoppscotch-db: condition: service_healthy command: 'pnpx prisma migrate deploy' restart: on-failure environment: - 'POSTGRES_USER=hoppscotch' - 'POSTGRES_PASSWORD=changeme' - 'POSTGRES_DB=hoppscotch' - 'DATABASE_URL=postgres://hoppscotch:changeme@hoppscotch-db:5432/hoppscotch' volumes: hopp-db: ``` Proxyscotch clone and build using script: https://github.com/ssqlone/proxyscotch-linux-arm64 - only for linux arm https://github.com/hoppscotch/proxyscotch - all others
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/hoppscotch#1639
No description provided.