Skip to content

fully deleting people is broken? #1007

@maks2011-2017

Description

@maks2011-2017

i wanted to fully delete user for the test and well uhh
./Refresh.GameServer --fully-delete-user -u 'solidov_h1ggs'

[01/24/26 18:27:56] [Info] [Startup] Bunkum is storing its data at /home/bredum/Server.
[01/24/26 18:27:57] [Info] [Startup] You can override where data is stored using the BUNKUM_DATA_FOLDER environment variable.
[01/24/26 18:28:01] [Error] [Database/RelationalEventId.CommandError] Failed executing DbCommand (10ms) [Parameters=[@p0='?', @p1='?', @p2='?'], CommandType='                     Text', CommandTimeout='30']
DELETE FROM "GameNotifications"
WHERE "NotificationId" = @p0;
DELETE FROM "GameNotifications"
WHERE "NotificationId" = @p1;
DELETE FROM "GameUsers"
WHERE "UserId" = @p2;
An internal error occurred: Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while saving the entity changes. See the inner exception for de                     tails.
 ---> Npgsql.PostgresException (0x80004005): 23503: update or delete on table "GameUsers" violates foreign key constraint "FK_GameAssets_GameUsers_OriginalUpl                     oaderUserId" on table "GameAssets"

DETAIL: Detail redacted as it may contain sensitive data. Specify 'Include Error Detail' in the connection string to include this information.
   at Npgsql.Internal.NpgsqlConnector.ReadMessageLong(Boolean async, DataRowLoadingMode dataRowLoadingMode, Boolean readingNotifications, Boolean isReadingPre                     pendedMessage)
   at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResul                     t(Int16 token)
   at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming, CancellationToken cancellationToken)
   at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming, CancellationToken cancellationToken)
   at Npgsql.NpgsqlDataReader.NextResult()
   at Npgsql.NpgsqlCommand.ExecuteReader(Boolean async, CommandBehavior behavior, CancellationToken cancellationToken)
   at Npgsql.NpgsqlCommand.ExecuteReader(Boolean async, CommandBehavior behavior, CancellationToken cancellationToken)
   at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior behavior)
   at Npgsql.NpgsqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReader(RelationalCommandParameterObject parameterObject)
   at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.Execute(IRelationalConnection connection)
  Exception data:
    Severity: ERROR
    SqlState: 23503
    MessageText: update or delete on table "GameUsers" violates foreign key constraint "FK_GameAssets_GameUsers_OriginalUploaderUserId" on table "GameAssets"
    Detail: Detail redacted as it may contain sensitive data. Specify 'Include Error Detail' in the connection string to include this information.
    SchemaName: public
    TableName: GameAssets
    ConstraintName: FK_GameAssets_GameUsers_OriginalUploaderUserId
    File: ri_triggers.c
    Line: 2621
    Routine: ri_ReportViolation
   --- End of inner exception stack trace ---
   at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.Execute(IRelationalConnection connection)
   at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.Execute(IEnumerable`1 commandBatches, IRelationalConnection connection)
   at Microsoft.EntityFrameworkCore.Storage.RelationalDatabase.SaveChanges(IList`1 entries)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChanges(IList`1 entriesToSave)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChanges(StateManager stateManager, Boolean acceptAllChangesOnSuccess)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.<>c.<SaveChanges>b__112_0(DbContext _, ValueTuple`2 t)
   at Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucc                     eeded)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChanges(Boolean acceptAllChangesOnSuccess)
   at Microsoft.EntityFrameworkCore.DbContext.SaveChanges(Boolean acceptAllChangesOnSuccess)
   at Microsoft.EntityFrameworkCore.DbContext.SaveChanges()
   at Refresh.Database.GameDatabaseContext.FullyDeleteUser(GameUser user) in /home/runner/work/Refresh/Refresh/Refresh.Database/GameDatabaseContext.Users.cs:l                     ine 365
   at Refresh.GameServer.RefreshGameServer.FullyDeleteUser(GameUser user) in /home/runner/work/Refresh/Refresh/Refresh.GameServer/RefreshGameServer.cs:line 30                     3
   at Refresh.GameServer.CommandLineManager.StartWithOptions(Options options) in /home/runner/work/Refresh/Refresh/Refresh.GameServer/CommandLineManager.cs:li                     ne 207
   at CommandLine.ParserResultExtensions.WithParsed[T](ParserResult`1 result, Action`1 action)
   at Refresh.GameServer.CommandLineManager.StartWithArgs(String[] args) in /home/runner/work/Refresh/Refresh/Refresh.GameServer/CommandLineManager.cs:line 83
The operation failed with exit code 139
[01/24/26 18:28:01] [Error] [Database/CoreEventId.SaveChangesFailed] An exception occurred in the database while saving changes for context type 'Refresh.Data                     base.GameDatabaseContext'.
Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while saving the entity changes. See the inner exception for details.
 ---> Npgsql.PostgresException (0x80004005): 23503: update or delete on table "GameUsers" violates foreign key constraint "FK_GameAssets_GameUsers_OriginalUpl                     oaderUserId" on table "GameAssets"

DETAIL: Detail redacted as it may contain sensitive data. Specify 'Include Error Detail' in the connection string to include this information.
   at Npgsql.Internal.NpgsqlConnector.ReadMessageLong(Boolean async, DataRowLoadingMode dataRowLoadingMode, Boolean readingNotifications, Boolean isReadingPre                     pendedMessage)
   at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResul                     t(Int16 token)
   at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming, CancellationToken cancellationToken)
   at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming, CancellationToken cancellationToken)
   at Npgsql.NpgsqlDataReader.NextResult()
   at Npgsql.NpgsqlCommand.ExecuteReader(Boolean async, CommandBehavior behavior, CancellationToken cancellationToken)
   at Npgsql.NpgsqlCommand.ExecuteReader(Boolean async, CommandBehavior behavior, CancellationToken cancellationToken)
   at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior behavior)
   at Npgsql.NpgsqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReader(RelationalCommandParameterObject parameterObject)
   at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.Execute(IRelationalConnection connection)
  Exception data:
    Severity: ERROR
    SqlState: 23503
    MessageText: update or delete on table "GameUsers" violates foreign key constraint "FK_GameAssets_GameUsers_OriginalUploaderUserId" on table "GameAssets"
    Detail: Detail redacted as it may contain sensitive data. Specify 'Include Error Detail' in the connection string to include this information.
    SchemaName: public
    TableName: GameAssets
    ConstraintName: FK_GameAssets_GameUsers_OriginalUploaderUserId
    File: ri_triggers.c
    Line: 2621
    Routine: ri_ReportViolation
   --- End of inner exception stack trace ---
   at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.Execute(IRelationalConnection connection)
   at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.Execute(IEnumerable`1 commandBatches, IRelationalConnection connection)
   at Microsoft.EntityFrameworkCore.Storage.RelationalDatabase.SaveChanges(IList`1 entries)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChanges(IList`1 entriesToSave)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChanges(StateManager stateManager, Boolean acceptAllChangesOnSuccess)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.<>c.<SaveChanges>b__112_0(DbContext _, ValueTuple`2 t)
   at Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucc                     eeded)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChanges(Boolean acceptAllChangesOnSuccess)
   at Microsoft.EntityFrameworkCore.DbContext.SaveChanges(Boolean acceptAllChangesOnSuccess)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions