Project

General

Profile

Actions

Bug #2063

open

Database will always try to create a new user on log in

Added by Zoé Scarlett Jaekel 14 days ago. Updated 12 days ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
07/01/2026
Due date:
% Done:

0%

Estimated time:

Description

Description

A freeciv-server started with authentification configured, see `auth.conf` and the corresponding pre-filled password database: `user_auth.sqlite` that was created during a previous run with `--Newusers` will always try to create a new user and not allow logins already present.

Reproduction

  1. Start freeciv-server version 3.2.4
    freeciv-server -m --auth --Database auth.conf --Newusers
    
  2. Connect with a client
    I used the gtk client (gtk 3.22).
    Log in with `user` and password `password`, confirm the password.
    Then disconnect again.
  3. Connect with the client (again)
    (again, gtk client)
    Use the same credentials and observe the failure in the server logs:
    1: lua error:
        /etc/freeciv/database.lua:281: LuaSQL: UNIQUE constraint failed: fcdb_auth.name
    stack traceback:
        : in function 'assert'
        /etc/freeciv/database.lua:281: in function 'user_save'
    1: Error writing to database for: user
    
    

Comments

It seems to me that user recognition is broken, because when the server is run with registrations closed, it won't even let me enter any password for the pre-registered user and reject the connection.

Versions

I can reproduce this on 3.2.4 no flakiness.

Version 3.2.2 works as expected.


Files

auth.conf (54 Bytes) auth.conf Zoé Scarlett Jaekel, 07/01/2026 03:04 PM
2026-07-02 11-40-48.mp4 (2.79 MB) 2026-07-02 11-40-48.mp4 The registration is issued twice, and the lua crashes. Zoé Scarlett Jaekel, 07/02/2026 12:52 PM
freeciv.log (374 KB) freeciv.log Zoé Scarlett Jaekel, 07/02/2026 01:01 PM
UserExistsLog.patch (362 Bytes) UserExistsLog.patch Marko Lindqvist, 07/02/2026 04:30 PM
BoolReturnLog.patch (721 Bytes) BoolReturnLog.patch Marko Lindqvist, 07/03/2026 12:46 PM
Actions

Also available in: Atom PDF