duplicate key value violates unique constraint "auth_name_key" Key (name)=(basu) already exists. #1189

Closed
opened 2021-12-19 14:36:02 +00:00 by AliasAlreadyTaken · 9 comments

2021-12-19 11:56:00: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod '' in callback createAuth(): PostgreSQL database error: ERROR: duplicate key value violates unique constraint "auth_name_key"
2021-12-19 11:56:00: ERROR[Main]: DETAIL: Key (name)=(basu) already exists.
2021-12-19 11:56:00: ERROR[Main]: stack traceback:
2021-12-19 11:56:00: ERROR[Main]: [C]: at 0x557f09c49420

2021-12-19 11:56:00: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod '' in callback createAuth(): PostgreSQL database error: ERROR: duplicate key value violates unique constraint "auth_name_key" 2021-12-19 11:56:00: ERROR[Main]: DETAIL: Key (name)=(basu) already exists. 2021-12-19 11:56:00: ERROR[Main]: stack traceback: 2021-12-19 11:56:00: ERROR[Main]: [C]: at 0x557f09c49420
AliasAlreadyTaken added the
1. kind/bug
2. prio/critical
labels 2021-12-19 14:36:10 +00:00
Author
Owner
https://github.com/minetest/minetest/issues/11877
Author
Owner
Minetest version
mt 5.4.1
OS / Hardware

Operating system: debian 11
CPU: AMD Epyc 7282
Postgres postgresql-13 13.5-0+deb11u1

Summary
2021-12-19 11:56:00: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod '' in callback createAuth(): PostgreSQL database error: ERROR: duplicate key value violates unique constraint "auth_name_key"
2021-12-19 11:56:00: ERROR[Main]: DETAIL: Key (name)=(basu) already exists.
2021-12-19 11:56:00: ERROR[Main]: stack traceback:
2021-12-19 11:56:00: ERROR[Main]: [C]: at 0x557f09c49420

Backup of 2021-12-16-19-29 does not have a player called "basu" in the auth table, now there is one but logindate is -1

There is a different playername that includes "basu" , like Xyzbasu

Repro

I do not have a repro of any kind, the error happened over the course of 2 years more than once, while the other 16 000 accs had no trouble of that kind.

For my reference 1189

##### Minetest version ``` mt 5.4.1 ``` ##### OS / Hardware <!-- General information about your hardware and operating system --> Operating system: debian 11 CPU: AMD Epyc 7282 Postgres postgresql-13 13.5-0+deb11u1 ##### Summary ``` 2021-12-19 11:56:00: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod '' in callback createAuth(): PostgreSQL database error: ERROR: duplicate key value violates unique constraint "auth_name_key" 2021-12-19 11:56:00: ERROR[Main]: DETAIL: Key (name)=(basu) already exists. 2021-12-19 11:56:00: ERROR[Main]: stack traceback: 2021-12-19 11:56:00: ERROR[Main]: [C]: at 0x557f09c49420 ``` Backup of 2021-12-16-19-29 does not have a player called "basu" in the auth table, now there is one but logindate is -1 There is a different playername that includes "basu" , like Xyzbasu ##### Repro I do not have a repro of any kind, the error happened over the course of 2 years more than once, while the other 16 000 accs had no trouble of that kind. For my reference 1189
AliasAlreadyTaken added the
3. source/mod upstream
label 2021-12-20 09:58:53 +00:00
Author
Owner

Happened again:

2022-03-31 12:48:29: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod '' in callback createAuth(): PostgreSQL database error: ERROR:  duplicate key value violates unique constraint "auth_name_key"
2022-03-31 12:48:29: ERROR[Main]: DETAIL:  Key (name)=(klorenzo) already exists.
2022-03-31 12:48:29: ERROR[Main]: stack traceback:
2022-03-31 12:48:29: ERROR[Main]: 	[C]: at 0x55c4fd2cba30

This time MT server version 5.5.0, OS debian testing, database postgresql 14.2

Happened again: ``` 2022-03-31 12:48:29: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod '' in callback createAuth(): PostgreSQL database error: ERROR: duplicate key value violates unique constraint "auth_name_key" 2022-03-31 12:48:29: ERROR[Main]: DETAIL: Key (name)=(klorenzo) already exists. 2022-03-31 12:48:29: ERROR[Main]: stack traceback: 2022-03-31 12:48:29: ERROR[Main]: [C]: at 0x55c4fd2cba30 ``` This time MT server version 5.5.0, OS debian testing, database postgresql 14.2
Member

I wonder if this happens if 2 attempts are made to register a player "at the same time"? Or, possibly if a "register new player" packet is sent by a client for an already registered name?

I wonder if this happens if 2 attempts are made to register a player "at the same time"? Or, possibly if a "register new player" packet is sent by a client for an already registered name?
Member

when i try to replicate this locally i get a different error:

AsyncErr: Lua: Runtime error from mod '*builtin*' in callback on_prejoinplayer(): PostgreSQL database error: ERROR:  current transaction is aborted, commands ignored until end of transaction block

stack traceback:
	[C]: in function 'read'
	/usr/share/minetest/builtin/game/auth.lua:134: in function </usr/share/minetest/builtin/game/auth.lua:130>
	/usr/share/minetest/builtin/game/register.lua:425: in function </usr/share/minetest/builtin/game/register.lua:409>
when i try to replicate this locally i get a different error: ``` AsyncErr: Lua: Runtime error from mod '*builtin*' in callback on_prejoinplayer(): PostgreSQL database error: ERROR: current transaction is aborted, commands ignored until end of transaction block stack traceback: [C]: in function 'read' /usr/share/minetest/builtin/game/auth.lua:134: in function </usr/share/minetest/builtin/game/auth.lua:130> /usr/share/minetest/builtin/game/register.lua:425: in function </usr/share/minetest/builtin/game/register.lua:409> ```
Member

or

AsyncErr: Lua: Runtime error from mod '' in callback getAuth(): PostgreSQL database error: ERROR:  current transaction is aborted, commands ignored until end of transaction block

stack traceback:
	[C]: in function 'read'
	/usr/share/minetest/builtin/game/auth.lua:14: in function </usr/share/minetest/builtin/game/auth.lua:12>
or ``` AsyncErr: Lua: Runtime error from mod '' in callback getAuth(): PostgreSQL database error: ERROR: current transaction is aborted, commands ignored until end of transaction block stack traceback: [C]: in function 'read' /usr/share/minetest/builtin/game/auth.lua:14: in function </usr/share/minetest/builtin/game/auth.lua:12> ```
Member

https://github.com/minetest/minetest/pull/12234 was merged; we should make use of that ASAP

https://github.com/minetest/minetest/pull/12234 was merged; we should make use of that ASAP
Author
Owner

Instead of a 5.5.1 like they should have done, they made a backport branch: https://github.com/minetest/minetest/tree/backport-5

I'll rebuild the engine based on this branch.

Instead of a 5.5.1 like they should have done, they made a backport branch: https://github.com/minetest/minetest/tree/backport-5 I'll rebuild the engine based on this branch.
Author
Owner

The backport branch is active now, no more crashes occurred until now.

The backport branch is active now, no more crashes occurred until now.
AliasAlreadyTaken added the
5. result/fixed
label 2022-05-09 23:14:11 +00:00
AliasAlreadyTaken added this to the 1.1.111 milestone 2022-05-13 05:09:33 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
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: your-land/bugtracker#1189
No description provided.