Troubleshooting Guide: SQL Server Error 2309 – “The value of ‘%ls’ is not a valid number”
Why This Error Happens
This error typically occurs when SQL Server Setup or a configuration script encounters a parameter value that is expected to be numeric (such as a port number, instance ID, or memory allocation value) but instead receives a blank, corrupted, or non-numeric string. This is commonly caused by malformed command-line arguments passed during an unattended installation, corrupted entries in the ConfigurationFile.ini, or locale/regional settings on Windows Server 2025 / Windows 11 that use a different decimal or thousands separator than SQL Server expects. In rare cases, it can also stem from a corrupted registry key under the SQL Server instance hive that stores a numeric configuration value.
Step-by-Step Resolution Guide
Step 1: Validate the Configuration File or Command-Line Parameters
- Open the
ConfigurationFile.initypically located atC:\Program Files\Microsoft SQL Server\160\Setup Bootstrap\Log\<timestamp>\ConfigurationFile.ini. - Check numeric fields such as
SQLSVCINSTANTFILEINIT,TCPPORT,NPENABLED,ASCOLLATION, andSQLBACKUPDIRsizing values for stray spaces, quotation marks, or non-numeric characters. - If running from PowerShell or CMD, re-verify any
/PORT=,/INSTANCEID=, or/SQLBACKUPDIR=switches do not contain accidental text or environment variable expansion errors. - Example:
setup.exe /ACTION=Install /TCPPORT=1433instead of/TCPPORT="1433 ".
Step 2: Check Regional and Language Settings
- Go to Control Panel > Region > Formats and confirm the decimal symbol is set to a period (
.) if SQL Server Setup expects US-style numeric formatting. - Navigate to Administrative > Change system locale and ensure it matches the supported locale for your SQL Server 2025 build.
- Restart the server after changing locale settings to ensure the change propagates to the SQL Server Setup process.
Step 3: Inspect and Repair Registry Numeric Keys
- Open
regeditand navigate toHKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\<InstanceID>\MSSQLServer\Parameters. - Look for any parameter value (such as
SQLArg0,SQLArg1) that should be numeric but shows blank, text, or unexpected characters. - Correct the value manually or restore it from a known-good backup of the registry hive, then restart the SQL Server (MSSQLSERVER) service.
Step 4: Re-run Setup with Logging Enabled
- Launch Setup with verbose logging:
setup.exe /ACTION=Install /INDICATEPROGRESS /QUIET /FEATURES=SQL /SkipRules=RebootRequiredCheck /ENU. - Review the detailed log at
Summary.txtandDetail.txtin the Setup Bootstrap Log folder to pinpoint exactly which numeric parameter triggered Error 2309. - Correct the identified parameter and re-run the installation.
Alternative or Verification Steps
- After applying fixes, re-run
setup.exe /ACTION=Installand confirm no Error 2309 appears in the Setup Summary log; successful completion should show “Setup completed successfully” status. - As an alternative, use SQL Server Configuration Manager to manually set affected numeric properties (e.g., TCP port under SQL Server Network Configuration > Protocols) instead of relying on the installer-provided values.