abpframework/abp · error · CliUsageException
The option you provided for Database Management System is in
Error message
The option you provided for Database Management System is invalid!
What it means
Thrown by ProjectCreationCommandBase.GetDatabaseManagementSystem when the database management system option value does not match any of the switch cases: sqlserver, mysql, postgresql, oracle-devart, sqlite, oracle. The default case throws CliUsageException via ExceptionMessageHelper. This option controls the specific database engine, distinct from the provider type.
Source
Thrown at framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProjectCreationCommandBase.cs:634
return DatabaseManagementSystem.NotSpecified;
}
switch (optionValue.ToLowerInvariant())
{
case "sqlserver":
return DatabaseManagementSystem.SQLServer;
case "mysql":
return DatabaseManagementSystem.MySQL;
case "postgresql":
return DatabaseManagementSystem.PostgreSQL;
case "oracle-devart":
return DatabaseManagementSystem.OracleDevart;
case "sqlite":
return DatabaseManagementSystem.SQLite;
case "oracle":
return DatabaseManagementSystem.Oracle;
default:
throw new CliUsageException(ExceptionMessageHelper.GetInvalidOptionExceptionMessage("Database Management System"));
}
}
protected virtual MobileApp GetMobilePreference(CommandLineArgs commandLineArgs, string template)
{
var optionValue = commandLineArgs.Options.GetOrNull(Options.Mobile.Short, Options.Mobile.Long);
switch (optionValue)
{
case null:
case "none":
return MobileApp.None;
case "react-native" when template is AppProTemplate.TemplateName or MicroserviceProTemplate.TemplateName:
return MobileApp.ReactNative;
case "maui" when template is AppProTemplate.TemplateName or MicroserviceProTemplate.TemplateName:
return MobileApp.Maui;
default:
throw new CliUsageException(ExceptionMessageHelper.GetInvalidOptionExceptionMessage("Mobile App"));View on GitHub (pinned to 7ed43b1931)
Solutions
- Use one of the supported values: sqlserver, mysql, postgresql, oracle, oracle-devart, or sqlite
- Check spelling and casing — the switch uses lowercase exact matches (e.g., 'postgresql' not 'PostgreSQL')
- Verify the option flag name matches what this ABP CLI version expects
Example fix
// before abp new MyProject --database-management-system postgres // after abp new MyProject --database-management-system postgresql
Defensive patterns
Strategy: validation
Validate before calling
// Validate database management system before project creation
var validDbms = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
{ "sqlserver", "mysql", "postgresql", "oracle-devart", "sqlite", "oracle" };
if (!validDbms.Contains(dbmsValue))
{
Console.Error.WriteLine($"Error: DBMS must be one of: {string.Join(", ", validDbms)}");
return;
} Type guard
// Type guard for valid DBMS values
static bool IsValidDbms(string value) =>
value.ToLowerInvariant() is "sqlserver" or "mysql" or "postgresql"
or "oracle-devart" or "sqlite" or "oracle"; Try / catch
try
{
await projectCreationCommand.ExecuteAsync(commandLineArgs);
}
catch (CliUsageException ex) when (ex.Message.Contains("Database Management System is invalid"))
{
logger.LogError("Supported: sqlserver, mysql, postgresql, oracle, oracle-devart, sqlite");
} Prevention
- Use lowercase exact values: sqlserver, mysql, postgresql, oracle-devart, sqlite, oracle
- Note 'postgresql' not 'postgres'; 'oracle-devart' for the Devart provider
- This is distinct from the database provider (ef vs mongodb)
When it happens
Trigger: Passing a --database-management-system (or equivalent) value not in the supported set. For example `-dms firebird` or `-dbms cassandra`. The switch falls to default.
Common situations: Developer passes an unsupported database engine, uses the wrong option name, or misspells a supported value. Confusion between abbreviated and full names (the switch expects lowercase exact strings like 'postgresql', not 'postgres').
Related errors
- The option you provided for Database Provider is invalid!
- The option you provided for Mobile App is invalid!
- The option you provided for UI Framework is invalid!
- Project name is missing!
- You can only create a new preview solution with preview CLI
AI-assisted analysis of abpframework/abp@7ed43b1931 (2026-08-13).
Data as JSON: /api/errors/3bb91f0ee2ee9b0f.
Report an issue: GitHub.