Open jaredatron opened 1 year ago
Did you find an answer to this?
Yes but I don’t remember how I got around this problem :(
Would you mind sharing your docker-compose.yml?
@deadlyicon I'm also facing this issue, would you mind sharing your docker-compose please?
I was beating my head with this issue today. Using podman as well, and for god knows whatever reason mariadb / mysql did not like my folder (/home/podman/containers/mysql:/var/lib/mysql:Z). It could create files and permissions were good. My problem went away when I just let mysql use a volume. I kept getting other errors such as unathenticated user dropped connection and the logs/admin.log had errors of unable to connect to db and looping "migrating database".
I'm also seeing this behaviour on 2024.1.0-beta on an ARM64 platform.
Running supervisorctl tail admin
inside the bitwarden container returns:
fail: Microsoft.EntityFrameworkCore.Database.Command[20102]
Failed executing DbCommand (6ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
CALL POMELO_BEFORE_DROP_PRIMARY_KEY(NULL, 'Grant');
ALTER TABLE `Grant` DROP PRIMARY KEY;
Unhandled exception. MySqlConnector.MySqlException (0x80004005): Can't DROP 'PRIMARY'; check that column/key 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, IReadOnlyDictionary`2 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
After inspecting the database, there is indeed no Primary key on the "Grant" table.
mysql> show create table `Grant`;
CREATE TABLE `Grant` (
`Key` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
`Type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
`SubjectId` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
`SessionId` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
`ClientId` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
`Description` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
`CreationDate` datetime(6) NOT NULL,
`ExpirationDate` datetime(6) DEFAULT NULL,
`ConsumedDate` datetime(6) DEFAULT NULL,
`Data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
`Id` int NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
This is my docker-compose.yaml file:
version: "3.8"
services:
bitwarden:
image: bitwarden/self-host:beta
restart: always
depends_on:
- db
env_file:
- settings.env
ports:
- "8000:8080"
volumes:
- bitwarden:/etc/bitwarden
db:
image: mysql:8.0
restart: always
environment:
MYSQL_DATABASE: "bitwarden_vault"
MYSQL_RANDOM_ROOT_PASSWORD: "true"
volumes:
- data:/var/lib/mysql
volumes:
bitwarden:
data:
Not sure if it's related, but I also noticed that the admin still says "2023.12.0" on the 2024.1.0-beta
tagged image. Which is the version I'm trying to upgrade from.
I am trying to run a self hosted docker container. When my docker-compose boots
bitwarden/self-host:beta
using podman:I get this output
and the container stays open, supervisord doesn't exit but all the sub processes (icons, api etc) are not running.
I discovered this because I could visit the login page and enter an email address but upon submitting the form the /api request 502s becuase the internal nginx proxy cannot speak to the its upstream
Can anyone recommend a next step to debugging this?
Thank you!