Note If you are receiving this error, you will need administrator access to your PC to resolve, which may require your IT Team assistance:

Database not attached - Sector size, error: 50 - Local Database Runtime error occured
Issue related to this is error: 50 - Local Database Runtime error occured
When studying the log file you can find the "error 50...."

What is the Sector size?
We have seen in some occasions a strange problem caused by the combination of a certain Samsung drive and Windows 11, the combination leads to problems with the Microsoft local database (which Safran Risk uses). The cause of the problem is out of our control, but we have found a workaround that works, if this is the problem.
How to perform the test:
Search for cmd in the lower left hand corner and right-click on the Command Prompt (1), then select Run as administrator (2). If you don't have admin rights on your PC, you will need assistance from your local IT department to do this.

Run this command in the shell:
fsutil fsinfo sectorinfo C:
The result should look like this:
If the sector size is 16384, this indicates the root cause of the problem.
For example like this:
This is a Windows problem outside Safran's control. The problem is described in this Microsoft article, and a solution is also provided: https://learn.microsoft.com/en-us/troubleshoot/sql/database-engine/database-file-operations/troubleshoot-os-4kb-disk-sector-size?tabs=registry-editor
As you will need assistance from your local IT department, they might want to understand the background of what we need to do.
The resolution is found in the above article under the section "Resolution steps for disk sector size errors in SQL Server". The resolution can be implemented in three different ways, we recommend the Command Prompt alternative:

The steps are:
1. Follow the steps (also listed below) in Troubleshoot operating system disk sector size larger than 4 KB - SQL Server | Microsoft Learn:
a. Open CMD as Administrator
b. Run the following to add a new Registry Key: REG ADD "HKLM\SYSTEM\CurrentControlSet\Services\stornvme\Parameters\Device" /v "ForcedPhysicalSectorSizeInBytes" /t REG_MULTI_SZ /d "* 4095" /f
c. Check if the key has been successfully added: REG QUERY "HKLM\SYSTEM\CurrentControlSet\Services\stornvme\Parameters\Device" /v "ForcedPhysicalSectorSizeInBytes"
2. Open CMD as local user (not as an Administrator)
3. Run the command: sqllocaldb delete which should then output “LocalDB instance “MSSQLLocalDB” deleted”
4. Run the command: sqllocaldb delete safran which should then output “LocalDB instance “Safran” deleted”
This should resolve the issue, if it's still occurring:
For the following steps, please execute step 1 and, if necessary, step 2 in the article linked below:
https://support.safran.com/a/solutions/articles/21000003231
STEP 1 from the article:
If you run the command sqllocaldb info in a command prompt window, you should get the result as shown below:
(PS! navigate to the 160 folder, not the 150 as it is written in the article)

If you don't get this result, run the command sqllocaldb start Safran
If this is not working, jump to STEP 2 in the article:
Open a command prompt and go to:
C:\Program Files\Microsoft SQL Server\160\Tools\Binn
Stop the instance (if running):
sqllocaldb stop Safran
Delete the instance:
sqllocaldb delete Safran
Restart the PC afterward, Otherwise, the changes will not take effect.
- After the reboot, run the “fsutil fsinfo sectorinfo C:" to see if the sector size is in fact changed.
-Then, stop, delete, and create the instances again.
-Start Safran Risk and check if they are in.
Comments
0 comments
Please sign in to leave a comment.