[GH-ISSUE #3683] [bug]: Hoppscotch not starting ( ERROR: relation "public.InfraConfig" does not exist ) #1271

Closed
opened 2026-03-16 19:33:34 +03:00 by kerem · 4 comments
Owner

Originally created by @czepan on GitHub (Dec 20, 2023).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/3683

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

When starting Hoppscotch I get the following error message and the aio container starts bootlooping:

hoppscotch-aio    | Backend Server | Initialize PubSub
hoppscotch-db_1   | 2023-12-20 10:11:18.926 UTC [80] ERROR:  relation "public.InfraConfig" does not exist at character 209
hoppscotch-db_1   | 2023-12-20 10:11:18.926 UTC [80] STATEMENT:  SELECT "public"."InfraConfig"."id", "public"."InfraConfig"."name", "public"."InfraConfig"."value", "public"."InfraConfig"."active", "public"."InfraConfig"."createdOn", "public"."InfraConfig"."updatedOn" FROM "public"."InfraConfig" WHERE 1=1 OFFSET $1
hoppscotch-aio    | Backend Server | /usr/src/app/packages/hoppscotch-backend/dist/utils.js:14
hoppscotch-aio    | Backend Server |     throw new Error(errMessage);
hoppscotch-aio    | Backend Server |           ^
hoppscotch-aio    | Backend Server | 
hoppscotch-aio    | 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
hoppscotch-aio    | Backend Server |     at throwErr (/usr/src/app/packages/hoppscotch-backend/dist/utils.js:14:11)
hoppscotch-aio    | Backend Server |     at InfraConfigService.initializeInfraConfigTable (/usr/src/app/packages/hoppscotch-backend/dist/infra-config/infra-config.service.js:89:38)
hoppscotch-aio    | Backend Server |     at async InfraConfigService.onModuleInit (/usr/src/app/packages/hoppscotch-backend/dist/infra-config/infra-config.service.js:28:9)
hoppscotch-aio    | Backend Server |     at async Promise.all (index 0)
hoppscotch-aio    | Backend Server |     at async callModuleInitHook (/usr/src/app/node_modules/.pnpm/@nestjs+core@10.2.7_@nestjs+common@10.2.7_@nestjs+platform-express@10.2.7_reflect-metadata@0.1.13_rxjs@7.6.0/node_modules/@nestjs/core/hooks/on-module-init.hook.js:43:5)
hoppscotch-aio    | Backend Server |     at async NestApplication.callInitHook (/usr/src/app/node_modules/.pnpm/@nestjs+core@10.2.7_@nestjs+common@10.2.7_@nestjs+platform-express@10.2.7_reflect-metadata@0.1.13_rxjs@7.6.0/node_modules/@nestjs/core/nest-application-context.js:223:13)
hoppscotch-aio    | Backend Server |     at async NestApplication.init (/usr/src/app/node_modules/.pnpm/@nestjs+core@10.2.7_@nestjs+common@10.2.7_@nestjs+platform-express@10.2.7_reflect-metadata@0.1.13_rxjs@7.6.0/node_modules/@nestjs/core/nest-application.js:100:9)
hoppscotch-aio    | Backend Server |     at async NestApplication.listen (/usr/src/app/node_modules/.pnpm/@nestjs+core@10.2.7_@nestjs+common@10.2.7_@nestjs+platform-express@10.2.7_reflect-metadata@0.1.13_rxjs@7.6.0/node_modules/@nestjs/core/nest-application.js:169:33)
hoppscotch-aio    | Backend Server |     at async bootstrap (/usr/src/app/packages/hoppscotch-backend/dist/main.js:42:5)
hoppscotch-aio    | Backend Server | 
hoppscotch-aio    | Backend Server | Node.js v18.16.0
hoppscotch-aio    | Backend Server | ELIFECYCLE  Command failed with exit code 1.

This is my docker-compose.yml, it's completely simple and taken from the official one in the repo:

version: "3.7"

services:
  hoppscotch-aio:
    image: hoppscotch/hoppscotch
    container_name: hoppscotch-aio
    restart: unless-stopped
    env_file:
      - ./.env
    depends_on:
      hoppscotch-db:
        condition: service_healthy
    ports:
      - "3000:3000"
      - "3100:3100"
      - "3170:3170"
      - "3080:80"
  
  hoppscotch-db:
    image: postgres:15
    ports:
      - "5432:5432"
    user: postgres
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: testpass
      POSTGRES_DB: hoppscotch
    healthcheck:
      test:
        [
          "CMD-SHELL",
          "sh -c 'pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}'"
        ]
      interval: 5s
      timeout: 5s
      retries: 10

My .env file is exactly the same as in the repo.

Using the 3 single Containers instead of the AIO one also crash with the same error message.

I tried using an older release ( 2023.8.4 ) and this one works.

Greetings

Encz

Steps to reproduce

  1. Check out repository
  2. Strip docker-compose.yml of everything except "hoppscotch-aio" and "hoppscotch-db"
  3. (optional) use the official dockerhub image "hoppscotch/hoppscotch:latest" instead of building it
  4. copy .env.sample to .env
  5. docker-compose up -d; docker-compose-logs -f

Environment

Production

Version

Self-hosted

Originally created by @czepan on GitHub (Dec 20, 2023). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/3683 ### Is there an existing issue for this? - [X] I have searched the existing issues ### Current behavior When starting Hoppscotch I get the following error message and the aio container starts bootlooping: ``` hoppscotch-aio | Backend Server | Initialize PubSub hoppscotch-db_1 | 2023-12-20 10:11:18.926 UTC [80] ERROR: relation "public.InfraConfig" does not exist at character 209 hoppscotch-db_1 | 2023-12-20 10:11:18.926 UTC [80] STATEMENT: SELECT "public"."InfraConfig"."id", "public"."InfraConfig"."name", "public"."InfraConfig"."value", "public"."InfraConfig"."active", "public"."InfraConfig"."createdOn", "public"."InfraConfig"."updatedOn" FROM "public"."InfraConfig" WHERE 1=1 OFFSET $1 hoppscotch-aio | Backend Server | /usr/src/app/packages/hoppscotch-backend/dist/utils.js:14 hoppscotch-aio | Backend Server | throw new Error(errMessage); hoppscotch-aio | Backend Server | ^ hoppscotch-aio | Backend Server | hoppscotch-aio | 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 hoppscotch-aio | Backend Server | at throwErr (/usr/src/app/packages/hoppscotch-backend/dist/utils.js:14:11) hoppscotch-aio | Backend Server | at InfraConfigService.initializeInfraConfigTable (/usr/src/app/packages/hoppscotch-backend/dist/infra-config/infra-config.service.js:89:38) hoppscotch-aio | Backend Server | at async InfraConfigService.onModuleInit (/usr/src/app/packages/hoppscotch-backend/dist/infra-config/infra-config.service.js:28:9) hoppscotch-aio | Backend Server | at async Promise.all (index 0) hoppscotch-aio | Backend Server | at async callModuleInitHook (/usr/src/app/node_modules/.pnpm/@nestjs+core@10.2.7_@nestjs+common@10.2.7_@nestjs+platform-express@10.2.7_reflect-metadata@0.1.13_rxjs@7.6.0/node_modules/@nestjs/core/hooks/on-module-init.hook.js:43:5) hoppscotch-aio | Backend Server | at async NestApplication.callInitHook (/usr/src/app/node_modules/.pnpm/@nestjs+core@10.2.7_@nestjs+common@10.2.7_@nestjs+platform-express@10.2.7_reflect-metadata@0.1.13_rxjs@7.6.0/node_modules/@nestjs/core/nest-application-context.js:223:13) hoppscotch-aio | Backend Server | at async NestApplication.init (/usr/src/app/node_modules/.pnpm/@nestjs+core@10.2.7_@nestjs+common@10.2.7_@nestjs+platform-express@10.2.7_reflect-metadata@0.1.13_rxjs@7.6.0/node_modules/@nestjs/core/nest-application.js:100:9) hoppscotch-aio | Backend Server | at async NestApplication.listen (/usr/src/app/node_modules/.pnpm/@nestjs+core@10.2.7_@nestjs+common@10.2.7_@nestjs+platform-express@10.2.7_reflect-metadata@0.1.13_rxjs@7.6.0/node_modules/@nestjs/core/nest-application.js:169:33) hoppscotch-aio | Backend Server | at async bootstrap (/usr/src/app/packages/hoppscotch-backend/dist/main.js:42:5) hoppscotch-aio | Backend Server | hoppscotch-aio | Backend Server | Node.js v18.16.0 hoppscotch-aio | Backend Server | ELIFECYCLE  Command failed with exit code 1. ``` This is my docker-compose.yml, it's completely simple and taken from the official one in the repo: ``` version: "3.7" services: hoppscotch-aio: image: hoppscotch/hoppscotch container_name: hoppscotch-aio restart: unless-stopped env_file: - ./.env depends_on: hoppscotch-db: condition: service_healthy ports: - "3000:3000" - "3100:3100" - "3170:3170" - "3080:80" hoppscotch-db: image: postgres:15 ports: - "5432:5432" user: postgres environment: POSTGRES_USER: postgres POSTGRES_PASSWORD: testpass POSTGRES_DB: hoppscotch healthcheck: test: [ "CMD-SHELL", "sh -c 'pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}'" ] interval: 5s timeout: 5s retries: 10 ``` My .env file is exactly the same as in the repo. Using the 3 single Containers instead of the AIO one also crash with the same error message. I tried using an older release ( [2023.8.4](https://hub.docker.com/layers/hoppscotch/hoppscotch/2023.8.4/images/sha256-f4a45ef4f30fe0fca338159f835aa32b992f470428ede2d0fc1da82cab4d0539?context=explore) ) and this one works. Greetings Encz ### Steps to reproduce 1. Check out repository 2. Strip docker-compose.yml of everything except "hoppscotch-aio" and "hoppscotch-db" 3. (optional) use the official dockerhub image "hoppscotch/hoppscotch:latest" instead of building it 4. copy .env.sample to .env 5. docker-compose up -d; docker-compose-logs -f ### Environment Production ### Version Self-hosted
kerem 2026-03-16 19:33:34 +03:00
Author
Owner

@sats268842 commented on GitHub (Dec 20, 2023):

If you are using Docker Compose, use this command to perform migrations:

docker compose run --entrypoint sh <Service_name>
pnpx prisma migrate deploy
<!-- gh-comment-id:1864318415 --> @sats268842 commented on GitHub (Dec 20, 2023): If you are using Docker Compose, use this command to perform migrations: ``` docker compose run --entrypoint sh <Service_name> pnpx prisma migrate deploy ```
Author
Owner

@czepan commented on GitHub (Dec 20, 2023):

If you are using Docker Compose, use this command to perform migrations:

docker compose run --entrypoint sh <Service_name>
pnpx prisma migrate deploy

@sats268842
I saw that in the official documentation but this sadly doesn't seem to be possible in the current scenario because the hoppscotch container is constantly rebooting because of the error above.

CONTAINER ID   IMAGE                          COMMAND                  CREATED          STATUS                                  PORTS                                       NAMES
b7725e2ad875   hoppscotch/hoppscotch:latest   "tini -- node /usr/s…"   14 seconds ago   Restarting (1) Less than a second ago                                               hoppscotch-aio

<!-- gh-comment-id:1864366267 --> @czepan commented on GitHub (Dec 20, 2023): > If you are using Docker Compose, use this command to perform migrations: > > ``` > docker compose run --entrypoint sh <Service_name> > pnpx prisma migrate deploy > ``` @sats268842 I saw that in the official documentation but this sadly doesn't seem to be possible in the current scenario because the hoppscotch container is constantly rebooting because of the error above. ``` CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES b7725e2ad875 hoppscotch/hoppscotch:latest "tini -- node /usr/s…" 14 seconds ago Restarting (1) Less than a second ago hoppscotch-aio ```
Author
Owner

@czepan commented on GitHub (Dec 20, 2023):

Ah I got it to work. I needed to give postgres a persistent volume:

    volumes:
      - pgdata:/var/lib/postgresql/data

Then I was able to do the manual migration.

Seems a little bit cumbersome to me that the docker images don't work ( as in constantly crash ) when one is starting them on a fresh installation :/ but as long as it works.

Thanks for your feedback! :)

Greetings

Encz

<!-- gh-comment-id:1864382021 --> @czepan commented on GitHub (Dec 20, 2023): Ah I got it to work. I needed to give postgres a persistent volume: ``` volumes: - pgdata:/var/lib/postgresql/data ``` Then I was able to do the manual migration. Seems a little bit cumbersome to me that the docker images don't work ( as in constantly crash ) when one is starting them on a fresh installation :/ but as long as it works. Thanks for your feedback! :) Greetings Encz
Author
Owner

@balub commented on GitHub (Dec 21, 2023):

@czepan for next time, when trying to use the entrypoint approach to get it to work you will have to temporarily stop the container and then restart the container once the migration has been run.

<!-- gh-comment-id:1866075793 --> @balub commented on GitHub (Dec 21, 2023): @czepan for next time, when trying to use the `entrypoint` approach to get it to work you will have to temporarily stop the container and then restart the container once the migration has been run.
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#1271
No description provided.