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

Unable to Start new container. #177

Closed
60plus opened this issue Aug 25, 2023 · 11 comments
Closed

Unable to Start new container. #177

60plus opened this issue Aug 25, 2023 · 11 comments
Labels
🪲 bug Something isn't working 🎛️ server There are things to do on the server

Comments

@60plus
Copy link

60plus commented Aug 25, 2023

Describe the bug
unable to start container.

To Reproduce
Deploy new container.

Expected behavior
No issues

Additional context
LOGS.

DB LOG:

2023-08-25 06:24:09.279 UTC [1] LOG: starting PostgreSQL 15.4 (Debian 15.4-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit

2023-08-25 06:24:09.280 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432

2023-08-25 06:24:09.280 UTC [1] LOG: listening on IPv6 address "::", port 5432

2023-08-25 06:24:09.285 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"

2023-08-25 06:24:09.291 UTC [29] LOG: database system was interrupted; last known up at 2023-08-25 06:13:48 UTC

2023-08-25 06:24:09.364 UTC [29] LOG: database system was not properly shut down; automatic recovery in progress

2023-08-25 06:24:09.367 UTC [29] LOG: redo starts at 0/19875D8

2023-08-25 06:24:09.367 UTC [29] LOG: invalid record length at 0/1987610: wanted 24, got 0

2023-08-25 06:24:09.367 UTC [29] LOG: redo done at 0/19875D8 system usage: CPU: user: 0.00 s, system: 0.00 s, elapsed: 0.00 s

2023-08-25 06:24:09.372 UTC [27] LOG: checkpoint starting: end-of-recovery immediate wait

2023-08-25 06:24:09.383 UTC [27] LOG: checkpoint complete: wrote 3 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.004 s, sync=0.002 s, total=0.014 s; sync files=2, longest=0.001 s, average=0.001 s; distance=0 kB, estimate=0 kB

2023-08-25 06:24:09.389 UTC [1] LOG: database system is ready to accept connections

2023-08-25 06:24:10.246 UTC [33] ERROR: relation "game" does not exist at character 2034

2023-08-25 06:24:10.246 UTC [33] STATEMENT: SELECT "Game"."id" AS "Game_id", "Game"."created_at" AS "Game_created_at", "Game"."updated_at" AS "Game_updated_at", "Game"."deleted_at" AS "Game_deleted_at", "Game"."entity_version" AS "Game_entity_version", "Game"."rawg_id" AS "Game_rawg_id", "Game"."title" AS "Game_title", "Game"."rawg_title" AS "Game_rawg_title", "Game"."version" AS "Game_version", "Game"."release_date" AS "Game_release_date", "Game"."rawg_release_date" AS "Game_rawg_release_date", "Game"."cache_date" AS "Game_cache_date", "Game"."file_path" AS "Game_file_path", "Game"."size" AS "Game_size", "Game"."description" AS "Game_description", "Game"."website_url" AS "Game_website_url", "Game"."metacritic_rating" AS "Game_metacritic_rating", "Game"."average_playtime" AS "Game_average_playtime", "Game"."early_access" AS "Game_early_access", "Game"."type" AS "Game_type", "Game"."box_image_id" AS "Game_box_image_id", "Game"."background_image_id" AS "Game_background_image_id", "Game__box_image"."id" AS "Game__box_image_id", "Game__box_image"."created_at" AS "Game__box_image_created_at", "Game__box_image"."updated_at" AS "Game__box_image_updated_at", "Game__box_image"."deleted_at" AS "Game__box_image_deleted_at", "Game__box_image"."entity_version" AS "Game__box_image_entity_version", "Game__box_image"."source" AS "Game__box_image_source", "Game__box_image"."path" AS "Game__box_image_path", "Game__box_image"."media_type" AS "Game__box_image_media_type", "Game__background_image"."id" AS "Game__background_image_id", "Game__background_image"."created_at" AS "Game__background_image_created_at", "Game__background_image"."updated_at" AS "Game__background_image_updated_at", "Game__background_image"."deleted_at" AS "Game__background_image_deleted_at", "Game__background_image"."entity_version" AS "Game__background_image_entity_version", "Game__background_image"."source" AS "Game__background_image_source", "Game__background_image"."path" AS "Game__background_image_path", "Game__background_image"."media_type" AS "Game__background_image_media_type" FROM "game" "Game" LEFT JOIN "image" "Game__box_image" ON "Game__box_image"."id"="Game"."box_image_id" AND ("Game__box_image"."deleted_at" IS NULL) LEFT JOIN "image" "Game__background_image" ON "Game__background_image"."id"="Game"."background_image_id" AND ("Game__background_image"."deleted_at" IS NULL) WHERE "Game"."deleted_at" IS NULL

GameVault-Backend LOG:

/app/node_modules/.pnpm/typeorm@0.3.17_better-sqlite3@8.5.0_pg@8.11.2_ts-node@10.9.1/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:211

        throw new QueryFailedError_1.QueryFailedError(query, parameters, err);

              ^

QueryFailedError: relation "game" does not exist

at PostgresQueryRunner.query (/app/node_modules/.pnpm/typeorm@0.3.17_better-sqlite3@8.5.0_pg@8.11.2_ts-node@10.9.1/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:211:19)

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

at async SelectQueryBuilder.loadRawResults (/app/node_modules/.pnpm/typeorm@0.3.17_better-sqlite3@8.5.0_pg@8.11.2_ts-node@10.9.1/node_modules/typeorm/query-builder/SelectQueryBuilder.js:2183:25)

at async SelectQueryBuilder.executeEntitiesAndRawResults (/app/node_modules/.pnpm/typeorm@0.3.17_better-sqlite3@8.5.0_pg@8.11.2_ts-node@10.9.1/node_modules/typeorm/query-builder/SelectQueryBuilder.js:2034:26)

at async SelectQueryBuilder.getRawAndEntities (/app/node_modules/.pnpm/typeorm@0.3.17_better-sqlite3@8.5.0_pg@8.11.2_ts-node@10.9.1/node_modules/typeorm/query-builder/SelectQueryBuilder.js:684:29)

at async SelectQueryBuilder.getMany (/app/node_modules/.pnpm/typeorm@0.3.17_better-sqlite3@8.5.0_pg@8.11.2_ts-node@10.9.1/node_modules/typeorm/query-builder/SelectQueryBuilder.js:750:25)

at async FilesService.index (/app/dist/src/modules/files/files.service.js:54:33) {

query: 'SELECT "Game"."id" AS "Game_id", "Game"."created_at" AS "Game_created_at", "Game"."updated_at" AS "Game_updated_at", "Game"."deleted_at" AS "Game_deleted_at", "Game"."entity_version" AS "Game_entity_version", "Game"."rawg_id" AS "Game_rawg_id", "Game"."title" AS "Game_title", "Game"."rawg_title" AS "Game_rawg_title", "Game"."version" AS "Game_version", "Game"."release_date" AS "Game_release_date", "Game"."rawg_release_date" AS "Game_rawg_release_date", "Game"."cache_date" AS "Game_cache_date", "Game"."file_path" AS "Game_file_path", "Game"."size" AS "Game_size", "Game"."description" AS "Game_description", "Game"."website_url" AS "Game_website_url", "Game"."metacritic_rating" AS "Game_metacritic_rating", "Game"."average_playtime" AS "Game_average_playtime", "Game"."early_access" AS "Game_early_access", "Game"."type" AS "Game_type", "Game"."box_image_id" AS "Game_box_image_id", "Game"."background_image_id" AS "Game_background_image_id", "Game__box_image"."id" AS "Game__box_image_id", "Game__box_image"."created_at" AS "Game__box_image_created_at", "Game__box_image"."updated_at" AS "Game__box_image_updated_at", "Game__box_image"."deleted_at" AS "Game__box_image_deleted_at", "Game__box_image"."entity_version" AS "Game__box_image_entity_version", "Game__box_image"."source" AS "Game__box_image_source", "Game__box_image"."path" AS "Game__box_image_path", "Game__box_image"."media_type" AS "Game__box_image_media_type", "Game__background_image"."id" AS "Game__background_image_id", "Game__background_image"."created_at" AS "Game__background_image_created_at", "Game__background_image"."updated_at" AS "Game__background_image_updated_at", "Game__background_image"."deleted_at" AS "Game__background_image_deleted_at", "Game__background_image"."entity_version" AS "Game__background_image_entity_version", "Game__background_image"."source" AS "Game__background_image_source", "Game__background_image"."path" AS "Game__background_image_path", "Game__background_image"."media_type" AS "Game__background_image_media_type" FROM "game" "Game" LEFT JOIN "image" "Game__box_image" ON "Game__box_image"."id"="Game"."box_image_id" AND ("Game__box_image"."deleted_at" IS NULL) LEFT JOIN "image" "Game__background_image" ON "Game__background_image"."id"="Game"."background_image_id" AND ("Game__background_image"."deleted_at" IS NULL) WHERE "Game"."deleted_at" IS NULL',

parameters: [],

driverError: error: relation "game" does not exist

  at /app/node_modules/.pnpm/pg@8.11.2/node_modules/pg/lib/client.js:526:17

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

  at async PostgresQueryRunner.query (/app/node_modules/.pnpm/typeorm@0.3.17_better-sqlite3@8.5.0_pg@8.11.2_ts-node@10.9.1/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:178:25)

  at async SelectQueryBuilder.loadRawResults (/app/node_modules/.pnpm/typeorm@0.3.17_better-sqlite3@8.5.0_pg@8.11.2_ts-node@10.9.1/node_modules/typeorm/query-builder/SelectQueryBuilder.js:2183:25)

  at async SelectQueryBuilder.executeEntitiesAndRawResults (/app/node_modules/.pnpm/typeorm@0.3.17_better-sqlite3@8.5.0_pg@8.11.2_ts-node@10.9.1/node_modules/typeorm/query-builder/SelectQueryBuilder.js:2034:26)

  at async SelectQueryBuilder.getRawAndEntities (/app/node_modules/.pnpm/typeorm@0.3.17_better-sqlite3@8.5.0_pg@8.11.2_ts-node@10.9.1/node_modules/typeorm/query-builder/SelectQueryBuilder.js:684:29)

  at async SelectQueryBuilder.getMany (/app/node_modules/.pnpm/typeorm@0.3.17_better-sqlite3@8.5.0_pg@8.11.2_ts-node@10.9.1/node_modules/typeorm/query-builder/SelectQueryBuilder.js:750:25)

  at async FilesService.index (/app/dist/src/modules/files/files.service.js:54:33) {

length: 105,

severity: 'ERROR',

code: '42P01',

detail: undefined,

hint: undefined,

position: '2034',

internalPosition: undefined,

internalQuery: undefined,

where: undefined,

schema: undefined,

table: undefined,

column: undefined,

dataType: undefined,

constraint: undefined,

file: 'parse_relation.c',

line: '1392',

routine: 'parserOpenTable'

},

length: 105,

severity: 'ERROR',

code: '42P01',

detail: undefined,

hint: undefined,

position: '2034',

internalPosition: undefined,

internalQuery: undefined,

where: undefined,

schema: undefined,

table: undefined,

column: undefined,

dataType: undefined,

constraint: undefined,

file: 'parse_relation.c',

line: '1392',

routine: 'parserOpenTable'

}

Node.js v20.5.1

@60plus 60plus added 🎛️ server There are things to do on the server 🪲 bug Something isn't working labels Aug 25, 2023
@Alfagun74
Copy link
Contributor

Are you starting this container from scratch?
What tool are you using to deploy your container?
Can you give me your censored Docker-Compose-Configuration?

@60plus
Copy link
Author

60plus commented Aug 25, 2023

Are you starting this container from scratch?
Yes. I decided to deploy GameVault on my main server.

What tool are you using to deploy your container?
Portainer 2.18.4

Can you give me your censored Docker-Compose-Configuration?
Sure

version: "3.8"
services:
  gamevault-backend:
    image: phalcode/gamevault-backend:latest
    container_name: GameVault
    restart: unless-stopped
    environment:
      DB_HOST: db
      DB_USERNAME: gamevault
      DB_PASSWORD: PASSWORD
      # The Following Line grants Admin Role to account with this username upon registration.
      SERVER_ADMIN_USERNAME: MYNAME
      # Uncomment and Insert your RAWG API Key here if you have one (http://rawg.io/login?forward=developer)
      RAWG_API_KEY: <MYAPI>
    volumes:
      # Mount the folder where your games are
      - PATH TO STORAGE/GameVAULT/Install:/files
      # Mount the folder where gamevault should store its images
      -  PATH TO STORAGE/APPS/GameVault/Images:/images
    ports:
      - 8581:8080
  db:
    image: postgres:15
    container_name: GameVault-DB
    restart: unless-stopped
    environment:
      POSTGRES_USER: gamevault
      POSTGRES_PASSWORD: PASSWORD
      POSTGRES_DB: gamevault
    volumes:
      # Mount the folder where your postgres database files should land
      - PATH TO STORAGE /APPS/GameVault/DB:/var/lib/postgresql/data

PASSWORD is the same in both containers
addig or removing "container_name:" It makes no difference same error.

@Alfagun74
Copy link
Contributor

can you provide me the full log of gamevault 1 minute after starting it aswell?

@60plus
Copy link
Author

60plus commented Aug 25, 2023

can you provide me the full log of gamevault 1 minute after starting it aswell?
sure
gamevault-backend-2023-08-25.log

@Alfagun74
Copy link
Contributor

Alfagun74 commented Aug 25, 2023

The logs dont really show any error. Could you maybe try the following?

  • Stop Gamevault And Database Service
  • Delete everything inside of PATH TO STORAGE /APPS/GameVault/DB on your host system
  • Stop Database and Gamevault Service

@Lucqqq
Copy link

Lucqqq commented Aug 25, 2023

Hi, I got the same. Problem.

  • completely new setup
  • exactly the same error

I already tried clearing all mapped folders and starting from scratch with new containers, but noting seems to help.

@60plus
Copy link
Author

60plus commented Aug 25, 2023

Stop Gamevault And Database Service
Delete everything inside of PATH TO STORAGE /APPS/GameVault/DB on your host system
Stop Database and Gamevault Service

What i did alerady:

  • I deleted entire PATH TO STORAGE /APPS/GameVault
  • Images
  • deleted network created by portainer (gamevault_default)
  • run GameVault as ROOT

It all started yesterday. Maybe it's somehow connected to yesterday's GameVault-app update.

@Alfagun74
Copy link
Contributor

It sounds like some badly updated image broke us.

I can reproduce this aswell now. Will try to fix and keep you guys updated ASAP.

@Alfagun74
Copy link
Contributor

TL;DR: The issue has been resolved in version 4.0.1.

Post Mortem:
Surprisingly, the problem wasn't caused by an external update; it was actually my mistake. During the restructuring of the project, I accidentally messed up the paths for the entities and migrations in the database configuration file. This meant that while the update worked for existing users of gamevault-backend, new installations were affected because databases were not populating. Furthermore, I neglected to update the package version when I released v4.0.0, which ended up overwriting v3.0.0 on Docker. I've just released a functional version 4.0.1. I also corrected the paths and re-published the correct v3.0.0.

Please tell me if it works.

@60plus
Copy link
Author

60plus commented Aug 25, 2023

Yep. It work again.
Thank you.

@Alfagun74
Copy link
Contributor

@60plus Thank you so much for sponsoring!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪲 bug Something isn't working 🎛️ server There are things to do on the server
Projects
Archived in project
Development

No branches or pull requests

3 participants