Thanks to visit codestin.com
Credit goes to github.com

Skip to content

SQL error during quick scan #714

@pryszczoskor

Description

@pryszczoskor

Hey Grimsi! :)

I got to latest 2.1 preview update and everything was running great, however after couple of scans and new game additions - I cannot run scan anymore.

I'm getting scan error pointing to SQL:

2025-09-20T20:59:16.647 WARN o.h.engine.jdbc.spi.SqlExceptionHelper : SQL Error: 23505, SQLState: 23505

2025-09-20T20:59:16.648 ERROR o.h.engine.jdbc.spi.SqlExceptionHelper : Unique index or primary key violation: "PUBLIC.UK52RQ62FLPBNTI77BYKM7UAHKQ_INDEX_2 ON PUBLIC.GAME(COVER_IMAGE_ID NULLS FIRST) VALUES ( /* 2731 */ CAST(24736 AS BIGINT) )"; SQL statement:

insert into game (comment,cover_image_id,created_at,critic_rating,header_image_id,library_id,download_count,file_size,match_confirmed,path,release,summary,title,updated_at,user_rating,id) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) [23505-232]

2025-09-20T20:59:16.667 ERROR o.g.app.libraries.LibraryScanService : Error during quick scan for library 1: could not execute statement [Unique index or primary key violation: "PUBLIC.UK52RQ62FLPBNTI77BYKM7UAHKQ_INDEX_2 ON PUBLIC.GAME(COVER_IMAGE_ID NULLS FIRST) VALUES ( /* 2731 */ CAST(24736 AS BIGINT) )"; SQL statement:

insert into game (comment,cover_image_id,created_at,critic_rating,header_image_id,library_id,download_count,file_size,match_confirmed,path,release,summary,title,updated_at,user_rating,id) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) [23505-232]] [insert into game (comment,cover_image_id,created_at,critic_rating,header_image_id,library_id,download_count,file_size,match_confirmed,path,release,summary,title,updated_at,user_rating,id) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)]; SQL [insert into game (comment,cover_image_id,created_at,critic_rating,header_image_id,library_id,download_count,file_size,match_confirmed,path,release,summary,title,updated_at,user_rating,id) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)]; constraint [PUBLIC.UK52RQ62FLPBNTI77BYKM7UAHKQ_INDEX_2]

2025-09-20T21:00:24.148 ERROR org.gameyfin.app.games.GameService : Could not identify game at path '/library/The Guild Gold Edition v2.0.0.5 [GOG]'

2025-09-20T21:00:24.260 ERROR org.gameyfin.app.games.GameService : Could not identify game at path '/library/Stick it to The Man! [GOG]'

2025-09-20T21:00:24.363 ERROR org.gameyfin.app.games.GameService : Could not identify game at path '/library/The Evil Within 2 v1.04 (37471)'

2025-09-20T21:00:25.007 ERROR org.gameyfin.app.games.GameService : Could not identify game at path '/library/The House of Da Vinci 2 GOG'

2025-09-20T21:00:26.281 WARN o.h.engine.jdbc.spi.SqlExceptionHelper : SQL Error: 23505, SQLState: 23505

2025-09-20T21:00:26.281 ERROR o.h.engine.jdbc.spi.SqlExceptionHelper : Unique index or primary key violation: "PUBLIC.UK52RQ62FLPBNTI77BYKM7UAHKQ_INDEX_2 ON PUBLIC.GAME(COVER_IMAGE_ID NULLS FIRST) VALUES ( /* 2731 */ CAST(24736 AS BIGINT) )"; SQL statement:

insert into game (comment,cover_image_id,created_at,critic_rating,header_image_id,library_id,download_count,file_size,match_confirmed,path,release,summary,title,updated_at,user_rating,id) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) [23505-232]

2025-09-20T21:00:26.284 ERROR o.g.app.libraries.LibraryScanService : Error during quick scan for library 1: could not execute statement [Unique index or primary key violation: "PUBLIC.UK52RQ62FLPBNTI77BYKM7UAHKQ_INDEX_2 ON PUBLIC.GAME(COVER_IMAGE_ID NULLS FIRST) VALUES ( /* 2731 */ CAST(24736 AS BIGINT) )"; SQL statement:

insert into game (comment,cover_image_id,created_at,critic_rating,header_image_id,library_id,download_count,file_size,match_confirmed,path,release,summary,title,updated_at,user_rating,id) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) [23505-232]] [insert into game (comment,cover_image_id,created_at,critic_rating,header_image_id,library_id,download_count,file_size,match_confirmed,path,release,summary,title,updated_at,user_rating,id) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)]; SQL [insert into game (comment,cover_image_id,created_at,critic_rating,header_image_id,library_id,download_count,file_size,match_confirmed,path,release,summary,title,updated_at,user_rating,id) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)]; constraint [PUBLIC.UK52RQ62FLPBNTI77BYKM7UAHKQ_INDEX_2]

I tried to run it twice above and it keeps throwing error each time.

I attempted to restart container and same issue happens. My library is currently on 4168 games, not sure if that could affect it.

If I can share some more details, let me know, thanks!

Metadata

Metadata

Assignees

Labels

BackendIssues related to the backend

Type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions