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

fatal error: duplicate key value violates unique constraint "maps_pkey" #262

Open
Skorlok opened this issue Dec 24, 2024 · 5 comments
Open
Assignees

Comments

@Skorlok
Copy link

Skorlok commented Dec 24, 2024

Hi, i'm having some issues with one of my servers running trakman 1.6.0

<FATAL> [24 Dec 2024 01:55:51] (Logger.js:85) Unhandled rejection occured: 
	duplicate key value violates unique constraint "maps_pkey"
	error: duplicate key value violates unique constraint "maps_pkey"
	    at Parser.parseErrorMessage (/app/controller/node_modules/pg-protocol/dist/parser.js:283:98)
	    at Parser.handlePacket (/app/controller/node_modules/pg-protocol/dist/parser.js:122:29)
	    at Parser.parse (/app/controller/node_modules/pg-protocol/dist/parser.js:35:38)
	    at Socket.<anonymous> (/app/controller/node_modules/pg-protocol/dist/index.js:11:42)
	    at Socket.emit (node:events:518:28)
	    at addChunk (node:internal/streams/readable:561:12)
	    at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)
	    at Readable.push (node:internal/streams/readable:392:5)
	    at TCP.onStreamRead (node:internal/stream_base_commons:189:23)

this error is happening at every new map at the "Play" event

as this issue seems related to a duplicated map in the database I search it and found nothing

skservertmu=# \d
                   List of relations
 Schema |          Name           |   Type   |  Owner   
--------+-------------------------+----------+----------
 public | banlist                 | table    | postgres
 public | best_checkpoint_records | table    | postgres
 public | best_sector_records     | table    | postgres
 public | blacklist               | table    | postgres
 public | chat                    | table    | postgres
 public | checkpoint_records      | table    | postgres
 public | donations               | table    | postgres
 public | guestlist               | table    | postgres
 public | map_ids                 | table    | postgres
 public | map_ids_id_seq          | sequence | postgres
 public | maps                    | table    | postgres
 public | mutelist                | table    | postgres
 public | players                 | table    | postgres
 public | players_id_seq          | sequence | postgres
 public | privileges              | table    | postgres
 public | records                 | table    | postgres
 public | records_multilap        | table    | postgres
 public | sector_records          | table    | postgres
 public | votes                   | table    | postgres
(19 rows)

skservertmu=# SELECT uid, COUNT(*) FROM map_ids GROUP BY uid HAVING COUNT(*) > 1;
 uid | count 
-----+-------
(0 rows)

skservertmu=# SELECT id, COUNT(*) FROM map_ids GROUP BY id HAVING COUNT(*) > 1;
 id | count 
----+-------
(0 rows)

skservertmu=# SELECT id, COUNT(*) FROM maps GROUP BY id HAVING COUNT(*) > 1;
 id | count 
----+-------
(0 rows)

If you have a solution I take because the controller is restarting at every new map

@lythx
Copy link
Owner

lythx commented Dec 27, 2024

Theres no duplicates in the database because table constraints prevent the map from being added, so controller basically thinks the map is not in db but it is for some reason. This kinda stuff happening on every play event is really weird. Are you using manualMapLoading (its disabled by default)? Were there any errors in the log prior to the fatal error?

@Skorlok
Copy link
Author

Skorlok commented Jan 2, 2025

image
I use the updateMatchSettingsOnChange: true but not the manual map loading (I presume it's the infinite map mode)

@wsrvn
Copy link
Collaborator

wsrvn commented Jan 6, 2025

have you tried the same on an empty db?

@Skorlok
Copy link
Author

Skorlok commented Jan 17, 2025

it works one time when deleting everything from maps, but after restarting it breaks again

@Skorlok
Copy link
Author

Skorlok commented Jan 17, 2025

TMUF.tar.gz here is a backup of my server (personal info removed), it crashs on empty new database

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants