{"record":{"id":"6291b7ecebf26a65","repo":"coollabsio/coolify","slug":"unsupported-database-type-databasetype","errorCode":null,"errorMessage":"Unsupported database type: $databaseType","messagePattern":"Unsupported database type: \\$databaseType","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"app/Actions/Database/StartDatabaseProxy.php","lineNumber":49,"sourceCode":"        $network = data_get($database, 'destination.network');\n        $server = data_get($database, 'destination.server');\n        $containerName = data_get($database, 'uuid');\n        $proxyContainerName = \"{$database->uuid}-proxy\";\n        $isSSLEnabled = $database->enable_ssl ?? false;\n\n        if ($database->getMorphClass() === ServiceDatabase::class) {\n            $databaseType = $database->databaseType();\n            $network = $database->service->uuid;\n            $server = data_get($database, 'service.destination.server');\n            $containerName = \"{$database->name}-{$database->service->uuid}\";\n        }\n        $internalPort = match ($databaseType) {\n            'standalone-mariadb', 'standalone-mysql' => 3306,\n            'standalone-postgresql', 'standalone-supabase/postgres' => 5432,\n            'standalone-redis', 'standalone-keydb', 'standalone-dragonfly' => 6379,\n            'standalone-clickhouse' => 9000,\n            'standalone-mongodb' => 27017,\n            default => throw new \\Exception(\"Unsupported database type: $databaseType\"),\n        };\n        if ($isSSLEnabled) {\n            $internalPort = match ($databaseType) {\n                'standalone-redis', 'standalone-keydb', 'standalone-dragonfly' => 6380,\n                default => $internalPort,\n            };\n        }\n\n        $configuration_dir = database_proxy_dir($database->uuid);\n        $host_configuration_dir = $configuration_dir;\n        if (isDev()) {\n            $host_configuration_dir = '/var/lib/docker/volumes/coolify_dev_coolify_data/_data/databases/'.$database->uuid.'/proxy';\n        }\n        $timeoutConfig = $this->buildProxyTimeoutConfig($database->public_port_timeout);\n        $nginxconf = <<<EOF\n    user  nginx;\n    worker_processes  auto;\n","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/coollabsio/coolify/blob/70b9acc42467278373e00de77abb40684e25b395/app/Actions/Database/StartDatabaseProxy.php#L31-L67","documentation":"Plain \\Exception thrown from StartDatabaseProxy when the match on $databaseType hits its default arm - the database's type string is not one of the supported standalone-*/service proxy types. The type comes from $database->databaseType(); for ServiceDatabase it derives from the service template image, so any template or morph class outside the known list fails here when starting the database proxy.","triggerScenarios":"Starting a database proxy for a ServiceDatabase whose template declares an image/type not in the map (e.g. a custom or newly added database service); a standalone database model whose databaseType() returns an unexpected/null value; a new database kind added to Coolify without updating StartDatabaseProxy's port map.","commonSituations":"Custom service templates introducing exotic databases (e.g. a different port than 3306/5432/6379/9000/27017); upgrades where a new database type exists but this action was not extended; corrupted type field on the database row.","solutions":["Check $database->databaseType() output for the failing database (tinker) and compare against the match arms.","If the type is legitimate, add it with its internal port to the match in StartDatabaseProxy (and the SSL override map when relevant).","If the type string is corrupted/mismatched, fix the database row or service template so databaseType() returns a supported value before retrying the proxy start."],"exampleFix":"// before\n$internalPort = match ($databaseType) {\n    'standalone-mariadb', 'standalone-mysql' => 3306,\n    ...\n    default => throw new \\Exception(\"Unsupported database type: $databaseType\"),\n};\n\n// after (explicitly supported type)\n$internalPort = match ($databaseType) {\n    'standalone-mariadb', 'standalone-mysql' => 3306,\n    'standalone-postgresql', 'standalone-supabase/postgres' => 5432,\n    'standalone-redis', 'standalone-keydb', 'standalone-dragonfly' => 6379,\n    'standalone-clickhouse' => 9000,\n    'standalone-mongodb' => 27017,\n    'standalone-mydb' => 1234, // newly registered type\n    default => throw new \\Exception(\"Unsupported database type: $databaseType\"),\n};","handlingStrategy":"type-guard","validationCode":"$allowed = ['standalone-mariadb','standalone-mysql','standalone-postgresql','standalone-supabase/postgres','standalone-redis','standalone-keydb','standalone-dragonfly','standalone-clickhouse','standalone-mongodb'];\nif (! in_array($database->databaseType(), $allowed, true)) {\n    // do not start the proxy for unsupported types\n    return;\n}","typeGuard":"function proxySupportedDatabaseType(string $type): bool\n{\n    return in_array($type, [\n        'standalone-mariadb', 'standalone-mysql',\n        'standalone-postgresql', 'standalone-supabase/postgres',\n        'standalone-redis', 'standalone-keydb', 'standalone-dragonfly',\n        'standalone-clickhouse', 'standalone-mongodb',\n    ], true);\n}","tryCatchPattern":"try {\n    StartDatabaseProxy::run($database, ...);\n} catch (\\Exception $e) {\n    if (str_starts_with($e->getMessage(), 'Unsupported database type')) {\n        // surface a friendly message; skip proxy start for this type\n    } else {\n        throw $e;\n    }\n}","preventionTips":["When adding a new database type, update every match map (StartDatabaseProxy and friends) in the same change.","Validate service templates' declared database types against the supported list before install.","Log databaseType() when onboarding custom templates to catch mismatches early."],"tags":["database-proxy","match-expression","unsupported-type","docker"],"backgroundTag":"unsupported-type-mismatch","analyzedSha":"70b9acc42467278373e00de77abb40684e25b395","analyzedAt":"2026-08-17T01:41:01.313Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}