6

I can't install SQL Server 2019 on my Windows 11 machine, because it fails to start Database Engine Services and I do not understand why. This is my personal computer and I have full access and all permissions to it.

I know this error is posted all over the internet and I've seen a few on StackOverflow already, however no solution what so ever I could find anywhere helped me solve this issue.

Installation failure screenshot

I've spent quite a few hours trying multiple tutorials online but I feel like I've reached a dead end. In my desperation I've even tried to reinstall windows to no avail.

I hope my explanation was clear enough even though I'm almost falling asleep because I stayed up so late trying to fix this. Thank you very much for your help and I can provide more logs or information on what I've tried or not.

Edit : as suggested in the comments, I've checked sector sizes with the command prompt, and this is the output, it is not the expected value indeed :

    C:\WINDOWS\system32>fsutil fsinfo sectorinfo C:
LogicalBytesPerSector :                                 512
PhysicalBytesPerSectorForAtomicity :                    32768
PhysicalBytesPerSectorForPerformance :                  32768
FileSystemEffectivePhysicalBytesPerSectorForAtomicity : 4096
Device Alignment :                                      Aligned (0x000)
Partition alignment on device :                         Aligned (0x000)
No Seek Penalty
Trim Supported
Not DAX capable
Not Thinly-Provisioned

Summary log :

Overall summary:
  Final result:                  Failed: see details below
  Exit code (Decimal):           -2061893606
  Start time:                    2022-02-02 02:21:47
  End time:                      2022-02-02 02:25:37
  Requested action:              Install

Setup completed with required actions for features.
Troubleshooting information for those features:
  Next step for SQLEngine:       Use the following information to resolve the error, uninstall this feature, and then run the setup process again.


Machine Properties:
  Machine name:                  CISMAILPC
  Machine processor count:       16
  OS version:                    Microsoft Windows 11 Pro (10.0.22000)
  OS service pack:               
  OS region:                     United States
  OS language:                   English (United States)
  OS architecture:               x64
  Process architecture:          64 Bit
  OS clustered:                  No

Product features discovered:
  Product              Instance             Instance ID                    Feature                                  Language             Edition              Version         Clustered  Configured

Package properties:
  Description:                   Microsoft SQL Server 2019 
  ProductName:                   SQL Server 2019
  Type:                          RTM
  Version:                       15
  SPLevel:                       0
  Installation location:         C:\SQL2019\Developer_ENU\x64\setup\
  Installation edition:          Developer

Product Update Status:
  None discovered.

User Input Settings:
  ACTION:                        Install
  ADDCURRENTUSERASSQLADMIN:      false
  AGTSVCACCOUNT:                 NT AUTHORITY\NETWORK SERVICE
  AGTSVCPASSWORD:                *****
  AGTSVCSTARTUPTYPE:             Manual
  ASBACKUPDIR:                   Backup
  ASCOLLATION:                   Latin1_General_CI_AS
  ASCONFIGDIR:                   Config
  ASDATADIR:                     Data
  ASLOGDIR:                      Log
  ASPROVIDERMSOLAP:              1
  ASSERVERMODE:                  TABULAR
  ASSVCACCOUNT:                  <empty>
  ASSVCPASSWORD:                 <empty>
  ASSVCSTARTUPTYPE:              Automatic
  ASSYSADMINACCOUNTS:            <empty>
  ASTELSVCACCT:                  <empty>
  ASTELSVCPASSWORD:              <empty>
  ASTELSVCSTARTUPTYPE:           0
  ASTEMPDIR:                     Temp
  BROWSERSVCSTARTUPTYPE:         Disabled
  CLTCTLRNAME:                   <empty>
  CLTRESULTDIR:                  <empty>
  CLTSTARTUPTYPE:                0
  CLTSVCACCOUNT:                 <empty>
  CLTSVCPASSWORD:                <empty>
  CLTWORKINGDIR:                 <empty>
  COMMFABRICENCRYPTION:          0
  COMMFABRICNETWORKLEVEL:        0
  COMMFABRICPORT:                0
  CONFIGURATIONFILE:             C:\Program Files\Microsoft SQL Server\150\Setup Bootstrap\Log\20220202_021140\ConfigurationFile.ini
  CTLRSTARTUPTYPE:               0
  CTLRSVCACCOUNT:                <empty>
  CTLRSVCPASSWORD:               <empty>
  CTLRUSERS:                     <empty>
  ENABLERANU:                    false
  ENU:                           true
  EXTSVCACCOUNT:                 <empty>
  EXTSVCPASSWORD:                <empty>
  FEATURES:                      SQLENGINE, SNAC_SDK
  FILESTREAMLEVEL:               0
  FILESTREAMSHARENAME:           <empty>
  FTSVCACCOUNT:                  <empty>
  FTSVCPASSWORD:                 <empty>
  HELP:                          false
  IACCEPTPYTHONLICENSETERMS:     false
  IACCEPTROPENLICENSETERMS:      false
  IACKNOWLEDGEENTCALLIMITS:      false
  INDICATEPROGRESS:              false
  INSTALLSHAREDDIR:              C:\Program Files\Microsoft SQL Server\
  INSTALLSHAREDWOWDIR:           C:\Program Files (x86)\Microsoft SQL Server\
  INSTALLSQLDATADIR:             <empty>
  INSTANCEDIR:                   C:\Program Files\Microsoft SQL Server\
  INSTANCEID:                    MSSQLSERVER
  INSTANCENAME:                  MSSQLSERVER
  ISMASTERSVCACCOUNT:            NT AUTHORITY\Network Service
  ISMASTERSVCPASSWORD:           <empty>
  ISMASTERSVCPORT:               8391
  ISMASTERSVCSSLCERTCN:          <empty>
  ISMASTERSVCSTARTUPTYPE:        Automatic
  ISMASTERSVCTHUMBPRINT:         <empty>
  ISSVCACCOUNT:                  NT AUTHORITY\Network Service
  ISSVCPASSWORD:                 <empty>
  ISSVCSTARTUPTYPE:              Automatic
  ISTELSVCACCT:                  <empty>
  ISTELSVCPASSWORD:              <empty>
  ISTELSVCSTARTUPTYPE:           0
  ISWORKERSVCACCOUNT:            NT AUTHORITY\Network Service
  ISWORKERSVCCERT:               <empty>
  ISWORKERSVCMASTER:             <empty>
  ISWORKERSVCPASSWORD:           <empty>
  ISWORKERSVCSTARTUPTYPE:        Automatic
  MATRIXCMBRICKCOMMPORT:         0
  MATRIXCMSERVERNAME:            <empty>
  MATRIXNAME:                    <empty>
  MRCACHEDIRECTORY:              
  NPENABLED:                     0
  PBDMSSVCACCOUNT:               <empty>
  PBDMSSVCPASSWORD:              <empty>
  PBDMSSVCSTARTUPTYPE:           0
  PBENGSVCACCOUNT:               <empty>
  PBENGSVCPASSWORD:              <empty>
  PBENGSVCSTARTUPTYPE:           0
  PBPORTRANGE:                   <empty>
  PBSCALEOUT:                    false
  PID:                           *****
  QUIET:                         false
  QUIETSIMPLE:                   false
  ROLE:                          
  RSINSTALLMODE:                 DefaultNativeMode
  RSSVCACCOUNT:                  <empty>
  RSSVCPASSWORD:                 <empty>
  RSSVCSTARTUPTYPE:              Automatic
  SAPWD:                         *****
  SECURITYMODE:                  SQL
  SQLBACKUPDIR:                  <empty>
  SQLCOLLATION:                  SQL_Latin1_General_CP1_CI_AS
  SQLJAVADIR:                    <empty>
  SQLMAXDOP:                     8
  SQLMAXMEMORY:                  2147483647
  SQLMINMEMORY:                  0
  SQLSVCACCOUNT:                 NT AUTHORITY\SYSTEM
  SQLSVCINSTANTFILEINIT:         false
  SQLSVCPASSWORD:                *****
  SQLSVCSTARTUPTYPE:             Automatic
  SQLSYSADMINACCOUNTS:           CISMAILPC\ismai
  SQLTELSVCACCT:                 NT Service\SQLTELEMETRY
  SQLTELSVCPASSWORD:             <empty>
  SQLTELSVCSTARTUPTYPE:          Automatic
  SQLTEMPDBDIR:                  <empty>
  SQLTEMPDBFILECOUNT:            8
  SQLTEMPDBFILEGROWTH:           64
  SQLTEMPDBFILESIZE:             8
  SQLTEMPDBLOGDIR:               <empty>
  SQLTEMPDBLOGFILEGROWTH:        64
  SQLTEMPDBLOGFILESIZE:          8
  SQLUSERDBDIR:                  <empty>
  SQLUSERDBLOGDIR:               <empty>
  SUPPRESSPAIDEDITIONNOTICE:     false
  SUPPRESSPRIVACYSTATEMENTNOTICE: false
  TCPENABLED:                    0
  UIMODE:                        Normal
  UpdateEnabled:                 true
  UpdateSource:                  MU
  USEMICROSOFTUPDATE:            false
  USESQLRECOMMENDEDMEMORYLIMITS: false
  X86:                           false

  Configuration file:            C:\Program Files\Microsoft SQL Server\150\Setup Bootstrap\Log\20220202_021140\ConfigurationFile.ini

Detailed results:
  Feature:                       Database Engine Services
  Status:                        Failed
  Reason for failure:            An error occurred during the setup process of the feature.
  Next Step:                     Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
  Component name:                SQL Server Database Engine Services Instance Features
  Component error code:          0x851A001A
  Error description:             Wait on the Database Engine recovery handle failed. Check the SQL Server error log for potential causes.
  Error help link:               https://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=15.0.4013.40&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026

  Feature:                       SQL Browser
  Status:                        Passed

  Feature:                       SQL Writer
  Status:                        Passed

  Feature:                       SQL Client Connectivity SDK
  Status:                        Passed

  Feature:                       SQL Client Connectivity
  Status:                        Passed

Rules with failures or warnings:

Rules report file:               C:\Program Files\Microsoft SQL Server\150\Setup Bootstrap\Log\20220202_021140\SystemConfigurationCheck_Report.htm
Dharman
  • 30,962
  • 25
  • 85
  • 135
Ismaïl Chammami
  • 111
  • 1
  • 1
  • 5
  • 1
    Have you checked the sector size reported by your C: drive yet? SQL Server doesn't (yet?) support sector sizes larger than 4 KiB. (This is not the same thing as the cluster size of a partition.) e.g.: from a Command Prompt invoke `fsutil fsinfo sectorinfo C:` and paste the output into your question. REF: [Troubleshoot errors related to system disk sector size greater than 4 KB](https://learn.microsoft.com/en-us/troubleshoot/sql/admin/troubleshoot-os-4kb-disk-sector-size#cause) – AlwaysLearning Feb 02 '22 at 03:08
  • Are you on the latest build of SQL Server 2019? It seems you are only on CU2, the latest is CU15 – Charlieface Feb 02 '22 at 03:23
  • @Charlieface How do i know if I'm on the latest build ? The SQL installer doesn't download the latest build by default ? – Ismaïl Chammami Feb 02 '22 at 07:37
  • 2
    As per the link in my first comment, _Look for the value `PhysicalBytesPerSectorForAtomicity`, returned in bytes. A value of 4096 indicates a sector storage size of 4 KB._ Yours is 32768 bytes, somewhat larger. Try installing SQL Server, or at least the database and log files, onto a different physical disk that support 512 or 4096 byte sectors. – AlwaysLearning Feb 02 '22 at 08:20
  • True ! My bad I just woke up sorry, I tought about Installing it somewhere else but didn't try yet for some reason, I'll try thank you for your suggestion. – Ismaïl Chammami Feb 02 '22 at 08:22
  • 1
    The fact that I've had this issue for 2 months+ and the article is from 1 week ago kinda makes me mad haha, but it finally works ! Thank you ! – Ismaïl Chammami Feb 02 '22 at 09:22
  • @AlwaysLearning this helped me (Windows 11 Pro 21H2 22000.469, SQL Server 2019). My system NVMe disk had an invalid `PhysicalBytesPerSectorForAtomicity` value, too. Installing onto a secondary SSD (after checking its sector size and ensuring to specify the SSD as the target directory at the bottom of the features page) allowed the installation. Might you consider making this an answer? – Marcos Foster Feb 02 '22 at 23:07
  • Worked for me as well. After numerous sleepless nights and blaming windows home edition. Was about to install a new better windows 11 (professional etc) for this and stumbled upon this wonderful answer. – Moons Jul 08 '22 at 07:56

4 Answers4

5

The issue is with Windows 11 and NVMe drives having bigger partitions than SQL can support. You can check that by doing "fsutil fsinfo sectorinfo C:" in an admin Command Prompt (C: here being the NVMe drive that we are trying to install SQL onto) and looking at the PhysicalBytesPerSectorForAtomicity" value. It should be 512 or 4096.

Different solutions in this article (be careful, a few solutions require modifying the registry, make sure to back it up before doing so): https://learn.microsoft.com/en-us/troubleshoot/sql/admin/troubleshoot-os-4kb-disk-sector-size#cause

The article lists a few solutions. You can also install SQL on another drive that has the correct partition sizes supported by SQL (512 or 4096).

Ismaïl Chammami
  • 111
  • 1
  • 1
  • 5
0

This problem is because Windows 11 is not compatible with SQL Server 2019. You will have to enable Windows 10 compatability:

  1. The value of PhysicalBytesPerSectorForAtomicity is your problem. You should run this command:

    fsutil fsinfo sectorinfo <your drive name>
    E.g. fsutil fsinfo sectorinfo E:
    
  2. Should it be other than 512 or 4096, you should run this command:

    REG ADD "HKLM\SYSTEM\CurrentControlSet\Services\stornvme\Parameters\Device" /v "ForcedPhysicalSectorSizeInBytes" /t   REG_MULTI_SZ /d "* 4095" /f
    
  3. Restart your computer and reinstall SQL server.

James Risner
  • 5,451
  • 11
  • 25
  • 47
0

Had the above-mentioned problems installing SQL2019 on Windows 11 even with PhysicalBytesPerSectorForAtomicity=4096. The only way I managed to overcome it is by installing(the latest SQL Server2022 Express but it should work also for 2019 as suggested by others) on a newly created VHD drive. Here are the detailed steps to create one(same for Windows 11 too): https://www.windowscentral.com/how-create-and-set-vhdx-or-vhd-windows-10

Played a bit with the connection configurations and managed to run it successfully. Good luck!✌️

Angel Dinev
  • 399
  • 4
  • 13
-1

Follow this steps exactly https://learn.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms?redirectedfrom=MSDN&view=sql-server-ver16

If you had already tried installing Microsoft SQL Server, make sure its deleted correctly from all locations.

  1. Control Panel > Uninstall apps > All "Microsoft SQL"
  2. Registry Editor > HKEY LOCAL MACHINE > SOFTWARE > MICROSOFT > MICROSOFT SQL (Delete file)
  3. C:\Program Files\Microsoft SQL Server - delete file
  4. C:\Program Files (X86)\Microsoft SQL Server - delete file

Clear trash and restart pc and run setup, should work

Slayer
  • 1