Closed karolszklarski closed 10 months ago
gitHash cf4d8a4 is working, ea162d5 is not
That commit modifies GrantRepository, and logs say something about 'grant' table
@karolszklarski would you be able to upgrade your MariaDB instance to the latest and try again? We aren't testing with Maria and also can't replicate this on MySQL 8. The Pomelo library that's used to perform these migrations reported such an issue but it was resolved ~3 years ago and we are suspecting that this has something to do with Maria installations.
I upgraded to the latest available release in debian "testing" repository
Ver 15.1 Distrib 10.11.6-MariaDB
but still get the same error.
Isn't it the same issue as #3635 ?
Yes, same issue most likely even though the error messages for the migration aren't included.
I see you're still on Maria 10.x -- would you be willing to try using 11.x, even though it's not LTS? Or MySQL 8?
I have upgraded to Maria 11.0, same issue persists.
@karolszklarski can you pull the latest from main
and give this a try? We made a modification to the database migration.
I'm running a MariaDB backend also. Seeing this exact issue with the latest Docker image bitwarden/self-host:beta
.
Same exact issue using 10.11.2-MariaDB backend. Had to revert to 2024.1.0-beta.
2024.1.0
had this issue present so you'd be experiencing it on that version, but the latest images have resolved this.
That's not what I'm seeing. If I run bitwarden/self-host:beta or specifically 2024.1.1-beta I get the error.
2024/01/22 09:10:44 | stdout | 2024-01-22 09:10:44,894 INFO exited: admin (terminated by SIGABRT (core dumped); not expected)
I can run 2024.1.0-beta without any issues.
That error may be due to something else? There are admin logs that would reveal more.
Here is the entry from the admin log when running 2024.1.1-beta
fail: Microsoft.EntityFrameworkCore.Database.Command[20102] Failed executing DbCommand (9ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] CALL POMELO_BEFORE_DROP_PRIMARY_KEY(NULL, 'Grant'); ALTER TABLE
GrantDROP PRIMARY KEY; Unhandled exception. MySqlConnector.MySqlException (0x80004005): Can't DROP INDEX
PRIMARY; check that it exists at MySqlConnector.Core.ResultSet.ReadResultSetHeaderAsync(IOBehavior ioBehavior) in /_/src/MySqlConnector/Core/ResultSet.cs:line 43 at MySqlConnector.MySqlDataReader.ActivateResultSet(CancellationToken cancellationToken) in /_/src/MySqlConnector/MySqlDataReader.cs:line 130 at MySqlConnector.MySqlDataReader.CreateAsync(CommandListPosition commandListPosition, ICommandPayloadCreator payloadCreator, IDictionary
2 cachedProcedures, IMySqlCommand command, CommandBehavior behavior, Activity activity, IOBehavior ioBehavior, CancellationToken cancellationToken) in //src/MySqlConnector/MySqlDataReader.cs:line 468
at MySqlConnector.Core.CommandExecutor.ExecuteReaderAsync(IReadOnlyList`1 commands, ICommandPayloadCreator payloadCreator, CommandBehavior behavior, Activity activity, IOBehavior ioBehavior, CancellationToken cancellationToken) in //src/MySqlConnector/Core/CommandExecutor.cs:line 56
at MySqlConnector.MySqlCommand.ExecuteNonQueryAsync(IOBehavior ioBehavior, CancellationToken cancellationToken) in //src/MySqlConnector/MySqlCommand.cs:line 296
at MySqlConnector.MySqlCommand.ExecuteNonQuery() in //src/MySqlConnector/MySqlCommand.cs:line 107
at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQuery(RelationalCommandParameterObject parameterObject)
at Microsoft.EntityFrameworkCore.Migrations.MigrationCommand.ExecuteNonQuery(IRelationalConnection connection, IReadOnlyDictionary2 parameterValues) at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.ExecuteNonQuery(IEnumerable
1 migrationCommands, IRelationalConnection connection)
at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration)
at Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.Migrate(DatabaseFacade databaseFacade)
at Bit.MySqlMigrations.MySqlDbMigrator.MigrateDatabase(Boolean enableLogging, CancellationToken cancellationToken) in /source/util/MySqlMigrations/MySqlDbMigrator.cs:line 30
at Bit.Admin.HostedServices.DatabaseMigrationHostedService.StartAsync(CancellationToken cancellationToken) in /source/src/Admin/HostedServices/DatabaseMigrationHostedService.cs:line 29
at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host)
at Bit.Admin.Program.Main(String[] args) in /source/src/Admin/Program.cs:line 9`
My docker file..
`version: "3.8"
services: bitwarden: container_name: bitwarden hostname: bitwarden env_file:
https://github.com/bitwarden/server/issues/3651#issuecomment-1901004782 may be what you need.
Ok thanks @withinfocus! that worked.
I confirm, it works :)
Grant
DROP COLUMN Id
;Grant
ADD PRIMARY KEYPK_Grant
(Key
);
Steps To Reproduce
Install bitwarden image and standalone mariadb database (a service, not a docker image).
bitwarden/self-host b11825cadef4 (old dev) works fine
bitwarden/self-host 74ccd545df9c (current dev) and e1a1833fcc06 (current beta) - admin module enters a crash loop.
gitHash cf4d8a4f is working, ea162d53 is not
Expected Result
Bitwarden should start normally.
Actual Result
Admin enters a crash loop
Admin logs
Screenshots or Videos
No response
Additional Context
docker image tag bitwarden/self-host:beta bitwarden/self-host:prod
docker-compose.yml
settings.env
Githash Version
919d759f-dirty
Environment Details
Database Image
mysql Ver 15.1 Distrib 10.5.21-MariaDB, for debian-linux-gnueabihf (armv7l) using EditLine wrapper
Issue-Link
https://github.com/bitwarden/server/issues/2480
Issue Tracking Info