Overview
When installing CTPlus, you may encounter the error:
Failed to create DB, error code 1
This error can have a number of causes, and most commonly occurs due to permission issues, but it can also be related to disk formatting and sector size compatibility, specifically with how the software interacts with non-standard sector sizes. This article covers how to check this, and if the sector size is incorrect, how to correct it.
NOTE: If the sector size is already correct, you do not need to make this fix, and if you already have local Administrative permissions on your computer, and are still seeing this, you should contact your Distributor for further support.
Root Cause
CTPlus is not compatible with disks formatted using a 16,384 bytes per physical sector size (PhysicalBytesPerSectorForPerformance
).
Most software expects standard sector sizes such as:
- 512 bytes (Legacy)
- 4,096 bytes (Advanced Format / 4K)
If the drive is using a non-standard 16K sector size, CTPlus may fail to initialize the local SQL database during installation.
Resolution Steps
1. Check the Sector Size
You can confirm your sector size by running the following command in cmd:
fsutil fsinfo sectorinfo C:
]
2. Force the Sector Size to 4,096 Bytes
Use the following command to override the physical sector size to 4,096 bytes for the relevant NVMe storage driver:
reg add "HKLM\SYSTEM\CurrentControlSet\Services\stornvme\Parameters\Device" /v "ForcedPhysicalSectorSizeInBytes" /t reg_multi_sz /d "* 4095"
Note: 4095 is used instead of 4096 due to registry key format expectations. The system will interpret this correctly.
Restart the computer after applying this change.
3. Manually Install SQL Server Express 2022
Download and install SQL Server Express 2022 separately if CTPlus still fails to initialize the database.
4. Reinitialize MSSQLLocalDB
Use the following commands to reset the LocalDB instance:
sqllocaldb delete MSSQLLocalDB
sqllocaldb create MSSQLLocalDB
sqllocaldb start MSSQLLocalDB
5. Retry CTPlus Installation
After performing these steps, re-run the CTPlus installer. It should now successfully create the database and complete the setup process.