Skip to content

"<Player> has not played on the server before." error due to improperly set server_ip in ah_bans #50

@RalphORama

Description

@RalphORama

I am running an offline mode server behind a Velocity proxy.

A player died, and was deathbanned. However, when I run the command undeathban Brohammad, I get the error Brohammad has not played on the server before. I am not sure why this issue is happening. Upon inspecting the database, I see the following:

SELECT player_uuid,last_known_name,last_death FROM ah_player WHERE last_known_name = 'Brohammad';

-- +--------------------------------------+-----------------+---------------------+
-- | player_uuid                          | last_known_name | last_death          |
-- +--------------------------------------+-----------------+---------------------+
-- | 970e5b2b-4326-41b8-bdb8-0f5e5ad49e85 | Brohammad       | 2024-02-14 17:27:01 |
-- +--------------------------------------+-----------------+---------------------+

SELECT ban_id,player_uuid,server_ip,server_port,start_date,expiration_date,ban_time FROM ah_ban WHERE player_uuid = '970e5b2b-4326-41b8-bdb8-0f5e5ad49e85';

-- +--------+--------------------------------------+------------+-------------+---------------------+---------------------+----------+
-- | ban_id | player_uuid                          | server_ip  | server_port | start_date          | expiration_date     | ban_time |
-- +--------+--------------------------------------+------------+-------------+---------------------+---------------------+----------+
-- |      1 | 970e5b2b-4326-41b8-bdb8-0f5e5ad49e85 | 172.18.0.4 |       26602 | 2024-02-14 17:27:01 | 2024-02-15 17:27:01 |     1440 |
-- +--------+--------------------------------------+------------+-------------+---------------------+---------------------+----------+

Old bans (from before I set up Velocity) have NULL set for server_ip and server_port. I tried updating those fields:

UPDATE ah_ban SET server_ip = NULL, server_port = NULL WHERE server_ip = '172.18.0.4';

But this did not fix the issue.


EDIT: I found a fix for the issue.

Running the UPDATE query did not fix the issue while the server was online. When I shut the server down it updated the rows again. I shut the server down, ran the UPDATE query, and started the server again. This fixed the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions