When saving a ServerProfile with a large but valid JSON configuration, the application crashes with a DbUpdateException. The error indicates that the database column used to store the server configuration (ServerConfig) is too small and truncates the JSON payload.
This makes it impossible to use legitimate configurations that contain large IP range lists (e.g. CIDR allow/deny lists).
{
"TypeName": "DbUpdateException",
"TypeFullName": "Microsoft.EntityFrameworkCore.DbUpdateException",
"Message": "An error occurred while saving the entity changes. See the inner exception for details.",
"InnerMessage": "String or binary data would be truncated in table 'Vh.dbo.ServerProfiles', column 'ServerConfig'."
}
Expected Behavior
The application should successfully store valid JSON server configurations, even when they are large.
ServerConfig should support realistic configuration sizes (IP range lists, routing rules, etc.).
Actual Behavior
Saving the configuration fails.
SQL Server throws a truncation error.
Entity Framework surfaces this as a DbUpdateException.
Root Cause
The database column Vh.dbo.ServerProfiles.ServerConfig appears to be defined with a limited length (e.g. nvarchar(4000) or similar).
This is insufficient for:
JSON configs
CIDR allow/deny lists
Advanced network filtering setups
Suggested Fix
Update the database schema to allow large JSON payloads:
ALTER TABLE Vh.dbo.ServerProfiles
ALTER COLUMN ServerConfig NVARCHAR(MAX) NULL;
When saving a ServerProfile with a large but valid JSON configuration, the application crashes with a DbUpdateException. The error indicates that the database column used to store the server configuration (ServerConfig) is too small and truncates the JSON payload.
This makes it impossible to use legitimate configurations that contain large IP range lists (e.g. CIDR allow/deny lists).
{
"TypeName": "DbUpdateException",
"TypeFullName": "Microsoft.EntityFrameworkCore.DbUpdateException",
"Message": "An error occurred while saving the entity changes. See the inner exception for details.",
"InnerMessage": "String or binary data would be truncated in table 'Vh.dbo.ServerProfiles', column 'ServerConfig'."
}
Expected Behavior
The application should successfully store valid JSON server configurations, even when they are large.
ServerConfig should support realistic configuration sizes (IP range lists, routing rules, etc.).
Actual Behavior
Saving the configuration fails.
SQL Server throws a truncation error.
Entity Framework surfaces this as a DbUpdateException.
Root Cause
The database column Vh.dbo.ServerProfiles.ServerConfig appears to be defined with a limited length (e.g. nvarchar(4000) or similar).
This is insufficient for:
JSON configs
CIDR allow/deny lists
Advanced network filtering setups
Suggested Fix
Update the database schema to allow large JSON payloads:
ALTER TABLE Vh.dbo.ServerProfiles
ALTER COLUMN ServerConfig NVARCHAR(MAX) NULL;