Распознавание голоса и речи на C#
UnmanagedCoder 05.05.2025
Интеграция голосового управления в приложения на C# стала намного доступнее благодаря развитию специализированных библиотек и API. При этом многие разработчики до сих пор считают голосовое управление. . .
Реализация своих итераторов в C++
NullReferenced 05.05.2025
Итераторы в C++ — это абстракция, которая связывает весь экосистему Стандартной Библиотеки Шаблонов (STL) в единое целое, позволяя алгоритмам работать с разнородными структурами данных без знания их. . .
Разработка собственного фреймворка для тестирования в C#
UnmanagedCoder 04.05.2025
C# довольно богат готовыми решениями – NUnit, xUnit, MSTest уже давно стали своеобразными динозаврами индустрии. Однако, как и любой динозавр, они не всегда могут протиснуться в узкие коридоры. . .
Распределенная трассировка в Java с помощью OpenTelemetry
Javaican 04.05.2025
Микросервисная архитектура стала краеугольным камнем современной разработки, но вместе с ней пришла и головная боль, знакомая многим — отслеживание прохождения запросов через лабиринт взаимосвязанных. . .
Шаблоны обнаружения сервисов в Kubernetes
Mr. Docker 04.05.2025
Современные Kubernetes-инфраструктуры сталкиваются с серьёзными вызовами. Развертывание в нескольких регионах и облаках одновременно, необходимость обеспечения низкой задержки для глобально. . .
Создаем SPA на C# и Blazor
stackOverflow 04.05.2025
Мир веб-разработки за последние десять лет претерпел коллосальные изменения. Переход от традиционных многостраничных сайтов к одностраничным приложениям (Single Page Applications, SPA) — это. . .
Реализация шаблонов проектирования GoF на C++
NullReferenced 04.05.2025
«Банда четырёх» (Gang of Four или GoF) — Эрих Гамма, Ричард Хелм, Ральф Джонсон и Джон Влиссидес — в 1994 году сформировали канон шаблонов, который выдержал проверку временем. И хотя C++ претерпел. . .
C# и сети: Сокеты, gRPC и SignalR
UnmanagedCoder 04.05.2025
Сетевые технологии не стоят на месте, а вместе с ними эволюционируют и инструменты разработки. В . NET появилось множество решений — от низкоуровневых сокетов, позволяющих управлять каждым байтом. . .
Создание микросервисов с Domain-Driven Design
ArchitectMsa 04.05.2025
Архитектура микросервисов за последние годы превратилась в мощный архитектурный подход, который позволяет разрабатывать гибкие, масштабируемые и устойчивые системы. А если добавить сюда ещё и. . .
Многопоточность в C++: Современные техники C++26
bytestream 04.05.2025
C++ долго жил по принципу «один поток — одна задача» — как старательный солдатик, выполняющий команды одну за другой. В то время, когда процессоры уже обзавелись несколькими ядрами, этот подход стал. . .
Table of Contents
- Problem Symptom
- Causes
- Solution
Problem Symptom
I have been getting messages from admins whose Azure AD Connect installations stopped working after installing the latest Windows Server cumulative update. I find that the Azure AD Connect-managed LocalDB solution couldn’t start anymore after any reboot; Azure AD Connect didn’t break because of the monthly cumulative update; the update was merely the cause for the reboot.
Hybrid Identity, the relationship between Active Directory and Azure AD, has benefitted from many improvements in Azure AD Connect. For the vast majority of organizations with Hybrid Identity, Azure AD Connect provides the synchronization part of the Hybrid Identity story and can also play a vital role in the authentication part of it.
With the Azure AD Connect v2 release in July 2022, Microsoft took its free synchronization solution to the next level, at least in terms of software compatibility. Azure AD Connect v2’s SQL Server 2019-based LocalDB solution replaced Azure AD Connect v1’s SQL Server 2012 SP4-based LocalDB solution and is more stable, better performing and also makes Azure AD Connect ready for the next couple of years.
However, the LocalDB solution also made Azure AD Connect installations go belly up the last couple of months. Follow the below solution steps to resolve Azure AD Connect installation that stopped working after reboot issue.
Causes
There are many common causes why Azure AD Connect stops working and/or is no longer supported:
- The LocalDB instance has grown larger than 10 GB
- There’s insufficient RAM to start the local DB instance
- A Group Policy setting is preventing Azure AD Connect or its core components from starting
- The Windows Server installation running Azure AD Connect was upgraded in-place
- The service account’s permissions or account changed or the service account’s password expires or is changed (as these credentials are used to connect to the database)
All these causes were ruled out as the cause of why the particular instances of Azure AD Connect I investigated stopped working.
Azure AD Connect staging mode servers suffered the same fate. Restoring Azure AD Connect from a previous backup also didn’t help, as Azure AD Connect would stop working at the next reboot. Microsoft’s solution to uninstall and then reinstall Azure AD Connect merely alleviated the problem as a couple of months down the road the LocalDB instance would just refuse to start again . . . ”
In demo environments, a couple of people started investigating Azure AD Connect. This led to the understanding that the cause of the non-starting LocalDB is corruption of the LocalDB instance’s model database.
In all cases in which the issue was reproduceable, the same two artifacts can be witnessed:
1. In the error.log file, typically located at C:\Windows\ServiceProfiles\ADSync\AppData\Local\Microsoft\Microsoft SQL Server Local DB\Instances\ADSync2019, the following log lines can be read:
Error: 9903, Severity: 20, State: 1. The log scan number (x) passed to log scan in database 'model' is not valid. This error may indicate data corruption or that the log file (.ldf) does not match the data file (.mdf). If this error occurred during replication, re-create the publication. Otherwise, restore from backup if the problem results in a failure during startup.
2. An event is logged in the Application log with Event ID 528:
Event 528 with source SQLLocalDB 15.0:
Windows API call WaitForMultipleObjects returned error code: 575. Windows system error message is: {Application Error} The application was unable to start correctly (0x%lx). Click OK to close the application. Reported at line: 3714.
Microsoft also investigated the issue. With 30 million organizations using Azure AD Connect, this issue was also raised with them by admins at the end of their ropes.
The SQL team at Microsoft have identified the root cause of the issue. The issue is caused by a software error in the backup logic that creates an inconsistent state in the SQL Server model database start page.
After a backup occurs, the model database is set to FULL recovery mode (dbi_status == 0x40010000), and the dbi_dbbackupLSN (the log sequence number for the database backup) is set to a value that points to a log file.
The actual recovery mode that is governed by the master database is SIMPLE. In SIMPLE recovery mode, database logs are truncated automatically. In contrast, in FULL recovery mode, logs are truncated only after a backup.
When the LocalDB instance is restarted after the log file is truncated, it detects a backup log sequence number that’s earlier than the earliest log file. Therefore, it won’t start the service.
Solution
If you experience this issue, you can have your Azure AD Connect installation working again with these steps, using an elevated Windows PowerShell:
Step 1: Stop the Microsoft Azure AD Sync service:
Set-Service ADSync -StartupType Disabled
Stop-Service ADSync -force
Step 2: Copy over the known-good model database template:
Copy-Item "C:\Program Files\Microsoft SQL
Server\150\LocalDB\Binn\Templates\model.mdf"
"C:\Windows\ServiceProfiles\ADSync\AppData\Local\Microsoft\Microsoft SQL Server Local DB\Instances\ADSync2019"
Copy-Item "C:\Program Files\Microsoft SQL
Server\150\LocalDB\Binn\Templates\modellog.ldf"
"C:\Windows\ServiceProfiles\ADSync\AppData\Local\Microsoft\Microsoft SQL Server Local DB\Instances\ADSync2019"
Step 3: Start the Microsoft Azure AD Sync service:
Set-Service ADSync -StartupType Automatic
Start-Service ADSync
The location of Azure AD Connect’s service profile (“C:\Windows\ServiceProfiles\ADSync\AppData\Local\Microsoft\Microsoft SQL Server Local DB\Instances\ADSync2019”) could be different in your situation. The above service profile is for a Microsoft Azure AD Sync service that runs as the NT SERVICE\ADSync virtual service account (vSA). This is the default account to run the service. If you run the service as another account or as a group Managed Service Account, change the account name in the service profile location above.
To no longer experience this issue, upgrade Azure AD Connect to version 2.1.1.0, as the Azure AD Connect team have added logic to this version of Azure AD Connect to prevent the issue from occurring.
Symptoms
You are trying to manually install SQL Server on Windows 11 or using an application that uses LocalDB that fails during the setup of LocalDB.
Possible errors are:
SQL Server Database Engine Services Instance Features 0x851A001A
There have been 256 misaligned log IOs which required falling back to synchronous IO.
Faulting application name: sqlservr.exe, version: 2019.150.2000.5, time stamp: 0x5d8a9215
Faulting module name: ntdll.dll, version: 10.0.22000.120, time stamp: 0x50702a8c
Exception code: 0xc0000005
Fault offset: 0x00000000000357ae
Cannot use file 'C:\Users\<user>\AppData\Local\Microsoft\Microsoft SQL Server Local DB\Instances\TestInstance\master.mdf' because it was originally formatted with sector size 4096 and is now on a volume with sector size 16384. Move the file to a volume with a sector size that is the same as or smaller than the original sector size.
Message : Windows API call WaitForMultipleObjects returned error code: 575. Windows system error message is: {Application Error}
The application was unable to start correctly (0x%lx). Click OK to close the application.
Reported at line: 3621.
Source : SQLLocalDB 11.0
Cause
SQL Server checks the unerlaying filesystem and checks the disk sector size. New storage systems on Windows 11 might expose a disk sector size greater than 4 KB. SQL Server currently only supports file systems with sector storage size between 512 bytes and 4 KB.
Resolution
First check if you are affected:
Start an elevated PowerShell:
fsutil fsinfo ntfsinfo c:
Look in the result for:
Bytes Per Physical Sector : 4096
A value greater than 4096 means you might be experience this issue.
An alternative PowerShell command:
Get-Disk | select PhysicalSectorSize, friendlyname
Please see the Microsoft documtention for possible resolution:
- 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
See Also
- 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
- Hard disk drive sector-size support boundaries in SQL Server https://support.microsoft.com/en-us/topic/hard-disk-drive-sector-size-support-boundaries-in-sql-server-4d5b73fa-7dc4-1d8a-2735-556e6b60d046
I recently ran into an issue where an install of Azure AD Connect failed to start. It seems like the root cause was due to the SQLLocalDB Model database becoming corrupt, which caused it to fail at upgrading itself. This is a known issue in versions older than 2.1.1.0 of Azure AD Connect.
While looking at the event logs it looks like the chain of events was that it tried to do the auto upgrade as auto upgrade is enabled but then failed to restart the SQLLocalDB due to the corruption which then caused Azure AD Connect to break.
The application event log is filled with errors with SQLLocalDB failing to start.
The exact error I was getting was Event ID 528 with the following Windows API call WaitForMultipleObjects returned error code: 575. Windows system error message is: {Application Error}
The application was unable to start correctly (0x%lx). Click OK to close the application.
Reported at line: 3714.
Fortunately this setup of Azure AD Connect was only used for syncing users and password hash sync so the impact was minimal and there was a second Azure AD Connect agent that could’ve been failed over to if needed.
In order to fix this you can’t just install a new version of Azure AD Connect on top of it. You have to actually fix the corruption.
Thankfully Microsoft has an article on how to fix it. You can find that here https://docs.microsoft.com/en-us/troubleshoot/azure/active-directory/resolve-model-database-corruption-sqllocaldb#mitigation
Following those steps I was able to fix the issue and get Azure AD Connect started and running again.
I then waited for the Azure AD Connect alerts to clear and it auto upgraded itself without issue this time.
I was getting a similar error, but when running
sqllocaldb start
The local db started successfully. Also when checking the event log I saw an error along the lines of
Windows API call WaitForMultipleObjects returned error code: 575
What fixed it for me:
- In IIS, configure the app pool to run under an account with permissions to the DB on the server (advanced options of the app pool)
- In the advanced option of the app pool, set Load User Profile to true
Reference: http://blogs.msdn.com/b/sqlexpress/archive/2011/12/09/using-localdb-with-full-iis-part-1-user-profile.aspx
When all else fails and you don’t care about data loss, delete and recreate your LocalDB\v11.0 database! At the command prompt
sqllocaldb delete v11.0
sqllocaldb create v11.0
(Sqllocaldb is in your PATH right? It was for me.)
My solution:
Go to: %LocalAppData%\Microsoft\Microsoft SQL Server Local DB\ and allow total control of the folder «Instances» to everyone group.
I know this is not OK but it solved my problem and i don’t really care about the data of that folder as this is a developing and testing computer.
It worths looking at LocalDB log files too, it is more detailed than event log:
%LocalAppData%\Microsoft\Microsoft SQL Server Local DB\Instances\ProjectsV12\error.log
Besides recreating the instance I had to delete the content of this folder:
%LocalAppData%\Microsoft\VisualStudio\SSDT\
This is where I have the mdf and ldf files.
