SyncAll exited with fatal Win32 error: 8440 (0x20f8), ошибка репликации в AD

Обновлено 15.11.2020

Active Directory

Добрый день! Уважаемые читатели и гости одного из крупнейших IT блогов рунета Pyatilistnik.org. В прошлый раз мы с вами разобрали методы оплаты телефона Билайн, я привел вам варианты использования самых известных банков, мы сэкономили время, самый ценный ресурс в мире. Двигаемся дальше и сегодня разберем серьезную ошибку, которая может вам доставить уйму проблем при ее диагностике и в работе пользователей. Речь пойдет, о проблемах репликации между контроллерами домена, где на сбойном контроллере вы будите получать тьму ошибок, одной из которых будет "The target principal name is incorrect. SyncAll exited with fatal Win32 error: 8440 (0x20f8)". Давайте восстанавливать правильную работу нашего AD.

Описание проблемы репликации между контроллерами

И так стали поступать заявки в систему технической поддержки, о том, что пользователь при попытке доступа по RDP получает ошибку:

Неверное имя пользователя или пароль. Попробуйте снова (The user name or password is incorrect. Try again)

Неверное имя пользователя или пароль. Попробуйте снова

Неверное имя пользователя или пароль. Попробуйте снова

Хотя пользователь уверял, что все верно вводил. Давайте разбираться в чем дело.

Диагностика Active Directory

Первым делом, я конечно же проверил не заблокирован ли пользователь, с ним было все прекрасно и он спокойно мог авторизовываться на других серверах компании. Параллельно другие сотрудники, из соседнего сайта Active Directory, получали такую же ошибку, поэтому я стал проверять репликации между контроллерами, таких ошибок я уже видел уйму:

Напоминаю, что существует два инструмента, которые вам помогут произвести проверку репликации в лесу Active Directory, это repadmin и dcdiag, я не беру графические Active Directory Replication Status Tool. Моя AD состоит из 4 доменов, один корневой и три дочерних. Проблема была в одном из дочерних. Он состоял из четырех контроллеров домена, 3 из которых были в одном сайте, а оставшийся в другом.  Первым делом я выполнил команду на контроллере из первого сайта:

repadmin /replsummary

Ошибок он мне не показал, но меня привлекло, то что среди списка входящей и исходящей репликации, отсутствовал контроллер домена из другого сайта, тут я понял что проблема кроется явно уже в связи с ним. Контроллера DC6, просто не было

Отсутствует контроллер домена в списке репликации

Естественно я начал подключаться к нему, прикол в том, что при попытке войти из под учетной записи пользователя корневого домена, я получил ту же ошибку "Неверное имя пользователя или пароль. Попробуйте снова (The user name or password is incorrect. Try again)", а вот под админом дочернего домена, все же пустило.  Там я так же запустил в командной строке проверку репликации.

repadmin /replsummary

Тут уже сразу начались новые ошибки, с которыми я ранее не встречался:

Ошибка 1326: experienced the following operational errors trying to retrieve replication information

Получается так, что с частью контроллеров домена, данный DC6 общался, а вот часть не видел.

Ошибка 1326: experienced the following operational errors trying to retrieve replication information

Посмотрев как происходит реплика между сайтами, я понял, что входящая реплика идет от одного нового контроллера, а исходящая идет уже на другой. Открыв оснастку ADUC на DC6 я увидел, что нового контроллера домена DC2 просто нет в списке контейнера D0main Controllers, но зато присутствовал старый умерший контроллер.

Отсутствует контроллер домена в списке

Далее я естественно заглянул и в оснастку DNS, где мне нужно было удостовериться, в наличии или отсутствии сервисных записей нового контроллера и старого. Я оказался прав, присутствовали записи старого контроллера. Записи SOA, так же сильно отличались.

Ошибка 1326: experienced the following operational errors trying to retrieve replication information

Не удаленный старый DNS в зоне Active Directory

В логах Windows, через просмотр событий или Windows Admin Center, можно было наблюдать такие ошибки:

Ошибка ID 4: The Kerberos client received a KRB_AP_ERR_MODIFIED error from the server dc4main$. The target name used was E3514235-00000-0000-AB04-00C04FC4534D2/f0e3a106-7b73-4ce0-a6f2-09c673454356/домен. This indicates that the target server failed to decrypt the ticket provided by the client. This can occur when the target server principal name (SPN) is registered on an account other than the account the target service is using. Ensure that the target SPN is only registered on the account used by the server. This error can also happen if the target service account password is different than what is configured on the Kerberos Key Distribution Center for that target service. Ensure that the service on the server and the KDC are both configured to use the same password. If the server name is not fully qualified, and the target domain (root.pyatilistnik.org) is different from the client domain (root.pyatilistnik.org), check if there are identically named server accounts in these two domains, or use the fully-qualified name to identify the server.

ID 4: The Kerberos client received a KRB_AP_ERR_MODIFIED error from the server dc4main$

Или ошибка ID 1645: Active Directory Domain Services did not perform an authenticated remote procedure call (RPC) to another directory server because the desired service principal name (SPN) for the destination directory server is not registered on the Key Distribution Center (KDC) domain controller that resolves the SPN.

Destination directory server:
d06896a3-be4b-4b8a-b75f-e3453457526a0f._msdcs.pyatilistnik.org
SPN:
E3514235-4B06-11D1-AB04-00C04FC2DCD2/d06896a3-be4b-4b8a-b3453453526a0f/pyatilistnik.org

User Action
Verify that the names of the destination directory server and domain are correct. Also, verify that the SPN is registered on the KDC domain controller. If the destination directory server has been recently promoted, it will be necessary for the local directory server’s account data to replicate to the KDC before this directory server can be authenticated.

ID 1645: Active Directory Domain Services did not perform an authenticated remote procedure call (RPC) to another directory server because the desired service principal name (SPN) for the destination directory server is not registered on the Key Distribution Center (KDC) domain controller that resolves the SPN

Устранение проблем

Первое на , что я наткнулся в качестве решений, это простая перезагрузка и правда, зачастую с Windows системами это один из действенных методов.

Семь бед, один ресет

После перезагрузки я первым делом попытался выполнить принудительную синхронизацию, через команду:

repadmin /syncall

В результате у меня она не прошла и я получил ошибку:

CALLBACK MESSAGE: Error contacting server CN=NTDS Settings,CN=DC6,CN=Servers,CN=root, CN=Sites,CN=Configuration,DC=pyatilistnik,DC=org (network error): -2146893022 (0x80090322):
The target principal name is incorrect.

SyncAll exited with fatal Win32 error: 8440 (0x20f8):
The naming context specified for this replication operation is invalid.

(0x80090322): The target principal name is incorrect. SyncAll exited with fatal Win32 error: 8440 (0x20f8): The naming context specified for this replication operation is invalid

Так же показывались старые ошибки. Еще я попробовал команду, которая должна показать все ошибки при диагностике Active Directory:

dcdiag /a /q

В результате ошибок было еще больше 🙂

Active Directory Domain Services did not perform an authenticated remote procedure call (RPC) to another directory server because the desired service principal name (SPN) for the destination directory server is not registered on the Key Distribution Center (KDC) domain controller that resolves the SPN.
A warning event occurred. EventID: 0x80000785
Time Generated: 11/13/2020 12:19:37
Event String: The attempt to establish a replication link for the following writable directory partition failed.
An error event occurred. EventID: 0xC000066D
Time Generated: 11/13/2020 12:19:37
Event String:
Active Directory Domain Services did not perform an authenticated remote procedure call (RPC) to another directory server because the desired service principal name (SPN) for the destination directory server is not registered on the Key Distribution Center (KDC) domain controller that resolves the SPN.
A warning event occurred. EventID: 0x80000785
Time Generated: 11/13/2020 12:19:37
Event String: The attempt to establish a replication link for the following writable directory partition failed.
An error event occurred. EventID: 0xC000066D
Time Generated: 11/13/2020 12:19:37
Event String:
Active Directory Domain Services did not perform an authenticated remote procedure call (RPC) to another directory server because the desired service principal name (SPN) for the destination directory server is not registered on the Key Distribution Center (KDC) domain controller that resolves the SPN.
A warning event occurred. EventID: 0x80000785
Time Generated: 11/13/2020 12:19:37
Event String: The attempt to establish a replication link for the following writable directory partition failed.
An error event occurred. EventID: 0xC000066D
Time Generated: 11/13/2020 12:19:37
Event String:
Active Directory Domain Services did not perform an authenticated remote procedure call (RPC) to another directory server because the desired service principal name (SPN) for the destination directory server is not registered on the Key Distribution Center (KDC) domain controller that resolves the SPN.
A warning event occurred. EventID: 0x80000786
Time Generated: 11/13/2020 12:19:37
Event String: The attempt to establish a replication link to a read-only directory partition with the following parameters failed.
An error event occurred. EventID: 0xC000066D
Time Generated: 11/13/2020 12:19:37
Event String:
Active Directory Domain Services did not perform an authenticated remote procedure call (RPC) to another directory server because the desired service principal name (SPN) for the destination directory server is not registered on the Key Distribution Center (KDC) domain controller that resolves the SPN.
A warning event occurred. EventID: 0x80000786
Time Generated: 11/13/2020 12:19:37
Event String: The attempt to establish a replication link to a read-only directory partition with the following parameters failed.
An error event occurred. EventID: 0xC000066D
Time Generated: 11/13/2020 12:19:37
Event String:
Active Directory Domain Services did not perform an authenticated remote procedure call (RPC) to another directory server because the desired service principal name (SPN) for the destination directory server is not registered on the Key Distribution Center (KDC) domain controller that resolves the SPN.
A warning event occurred. EventID: 0x80000786
Time Generated: 11/13/2020 12:19:37
Event String: The attempt to establish a replication link to a read-only directory partition with the following parameters failed.
An error event occurred. EventID: 0xC000066D
Time Generated: 11/13/2020 12:19:37
Event String:
Active Directory Domain Services did not perform an authenticated remote procedure call (RPC) to another directory server because the desired service principal name (SPN) for the destination directory server is not registered on the Key Distribution Center (KDC) domain controller that resolves the SPN.
A warning event occurred. EventID: 0x80000785
Time Generated: 11/13/2020 12:19:37
Event String: The attempt to establish a replication link for the following writable directory partition failed.
An error event occurred. EventID: 0xC000066D
Time Generated: 11/13/2020 12:19:37
Event String:
Active Directory Domain Services did not perform an authenticated remote procedure call (RPC) to another directory server because the desired service principal name (SPN) for the destination directory server is not registered on the Key Distribution Center (KDC) domain controller that resolves the SPN.
A warning event occurred. EventID: 0x80000785

Я попытался вручную запустить входящую реплику через оснастку Active Directory Сайты и службы, но так же получил порцию новых ошибок.

The following error occurred during the attempt to synchronize naming context pyatilictnik.org from Domain Controller DC2 to Domain Controller DC6. The naming context is in the progress of being removed or is not replicated from the specified server.

The following error occurred during the attempt to synchronize naming context pyatilictnik.org from Domain Controller DC2 to Domain Controller DC6. The naming context is in the progress of being removed or is not replicated from the specified server

Новые ошибки уже начали выводить меня на приблизительное решение данной проблемы. Ошибка "-2146893022 (0x80090322):The target principal name is incorrect. SyncAll exited with fatal Win32 error: 8440 (0x20f8)", говорит на, о том, что между мастером PDC и текущим контроллером домена не работает безопасный канал. Там мы производили его сброс через утилиту Netdom. Самое интересное, что команда проверяющая безопасный канал показывала, что с ним все в порядке.

Test-ComputerSecureChannel –verbose

Безопасный канал между локальным компьютером и доменом находится в хорошем состоянии, но ошибкам репликации на это безразницы.

Test-ComputerSecureChannel –verbose Безопасный канал между локальным компьютером и доменом находится в хорошем состоянии

На сбойном контроллере домена нужно выполнить:

  • В командной строке или оболочке PowerShell вам необходимо остановить службу Key Distribution Center (Центр распространения ключей Kerberos) (KDC) на СБОЙНОМ контроллере домена.

net stop KDC

остановка Key Distribution Center (Центр распространения ключей Kerberos) (KDC)

Далее вам необходимо выставить у нее тип запуска "Отключено", для этого выполните команду:

sc config KDC start= disabled

После чего перезагрузите контроллер домена

sc config KDC start= disabled

  • На сбойном контроллере выполните команду, для того чтобы очистить билеты (Purge Tickets)

klist purge

очистка билетов Purge Tickets

Далее на любом из контроллеров домена, который не является держателем роли FSMO DPC, вам нужно произвести сброс безопасного канала, я делаю эту команду на сбойном контроллере домена. Так же об этом советует Microsoft:

После перезагрузки компьютера используйте служебную программу Netdom для сброса безопасных каналов между этими контроллерами домена и держателем роли хозяина операций эмулятора PDC. Для этого выполните следующую команду с контроллеров домена, отличных от владельца роли хозяина операций эмулятора PDC:

Netdom RESETPWD / сервер: server_name / userd: domain_name \ администратор / PasswordD: administrator_password

Где server_name - это имя сервера, который является владельцем роли хозяина операций эмулятора PDC.

У меня это получилось вот так:

netdom /resetpwd /server:dc01 /userd:root.pyatilistnik.org\sem /passwordd:Мой пароль

В результате вы должны получить "Пароль учетной записи локального компьютера успешно сброшен".

Пароль учетной записи локального компьютера успешно сброшен

После сброса безопасного канала перезапустите контроллеры домена, я перезапустил сбойный и сервер с PDC ролью. Даже если вы попытаетесь сбросить безопасный канал с помощью утилиты Netdom, и команда не завершится успешно, продолжите процесс перезапуска. Если работает только владелец роли хозяина операций эмулятора PDC, KDC заставляет другие контроллеры домена повторно синхронизироваться с этим компьютером, вместо того, чтобы выдавать себе новый билет Kerberos.

После перезагрузки на сбойном контроллере и на PDC выполните команду:

repadmin /syncall

После чего можно запускать службу Key Distribution Center (Центр распространения ключей Kerberos) (KDC). Для этого выполните:

sc config KDC start= auto

net start KDC

Запуск службы Key Distribution Center (Центр распространения ключей Kerberos) (KDC)

Дополнительные методы диагностики

  • Если у вас контроллеры домена располагаются по разным сайтам, то обязательно проверьте все ли порты Active Directory вы открыли на своем оборудовании, самый главный порт 135, его можно проверить с обоих сторон, через утилиту Telnet.
  • Если ничего не помогает, то я вам советую выключить сбойный контроллер и удалить его, почистить метаданные в AD и создать новый контроллер домена, для ускорения реплики при создании, сделайте файл IFM.

Дополнительные ссылки

  • https://console.kim.sg/how-to-revive-dead-dns-server-on-the-last-standing-domain-controller-after-seizing-all-other-dcs/
  • https://support.microsoft.com/en-sg/help/288167/error-message-target-principal-name-is-incorrect-when-manually-replica
  • https://docs.microsoft.com/ru-ru/troubleshoot/windows-server/identity/replication-error-2146893022

На этом у меня все, мы с вами восстановили работу контроллеров домена и репликации, и больше не будет проблем с паролями. С вами был Иван Семин, автор и создатель IT портала Pyatilistnik.org.

 

Автор - Сёмин Иван

6 Responses to SyncAll exited with fatal Win32 error: 8440 (0x20f8), ошибка репликации в AD

  1. Алибек:

    Добрый день! При попытке смены пароля (netdom /resetpwd) пишет:
    Не удалось сбросить пароль учетной записи локального компьютера.

    Неверное имя пользователя или пароль.

    Не удалось выполнить команду.
    Логин и пароль верные. Синхронизация не проходит, а сменить домен не могу так как проблема на контроллере домена.

  2. Иван Семин:

    Можете подробнее описать, что со сбойным контроллером?

  3. Алибек:

    Проблема такая же как и в посте не проходит репликация между доменами, проблема в главном домене.
    Source DSA largest delta fails/total %% error
    DC02 >60 days 5 / 5 100 (5) Access is denied.
    DC03 >60 days 5 / 5 100 (8457) The destination server is currently rejecting replication requests.

    dcgiag
    Directory Server Diagnosis

    Performing initial setup:
    * Identified AD Forest.
    Done gathering initial info.

    Doing initial required tests

    Testing server: base\DC02
    Starting test: Connectivity
    ……………………. DC02 passed test Connectivity

    Doing primary tests

    Testing server: base\DC02
    Starting test: Advertising
    Warning: DsGetDcName returned information for \\dc03.tarlan-auto.local, when we were trying to reach DC02.
    SERVER IS NOT RESPONDING or IS NOT CONSIDERED SUITABLE.
    ……………………. DC02 failed test Advertising
    Starting test: FrsEvent
    ……………………. DC02 passed test FrsEvent
    Starting test: DFSREvent
    There are warning or error events within the last 24 hours after the SYSVOL has been shared. Failing SYSVOL
    replication problems may cause Group Policy problems.
    ……………………. DC02 failed test DFSREvent
    Starting test: SysVolCheck
    ……………………. DC02 passed test SysVolCheck
    Starting test: KccEvent
    A warning event occurred. EventID: 0x8000061E
    Time Generated: 08/04/2022 11:17:35
    Event String:
    All directory servers in the following site that can replicate the directory partition over this transport are currently unavailable.
    An error event occurred. EventID: 0xC000051F
    Time Generated: 08/04/2022 11:17:35
    Event String:
    The Knowledge Consistency Checker (KCC) has detected problems with the following directory partition.
    A warning event occurred. EventID: 0x80000749
    Time Generated: 08/04/2022 11:17:35
    Event String:
    The Knowledge Consistency Checker (KCC) was unable to form a complete spanning tree network topology. As a result, the following list of sites cannot be reached from the local site.
    A warning event occurred. EventID: 0x8000061E
    Time Generated: 08/04/2022 11:17:35
    Event String:
    All directory servers in the following site that can replicate the directory partition over this transport are currently unavailable.
    An error event occurred. EventID: 0xC000051F
    Time Generated: 08/04/2022 11:17:35
    Event String:
    The Knowledge Consistency Checker (KCC) has detected problems with the following directory partition.
    A warning event occurred. EventID: 0x80000749
    Time Generated: 08/04/2022 11:17:35
    Event String:
    The Knowledge Consistency Checker (KCC) was unable to form a complete spanning tree network topology. As a result, the following list of sites cannot be reached from the local site.
    A warning event occurred. EventID: 0x8000061E
    Time Generated: 08/04/2022 11:17:35
    Event String:
    All directory servers in the following site that can replicate the directory partition over this transport are currently unavailable.
    An error event occurred. EventID: 0xC000051F
    Time Generated: 08/04/2022 11:17:35
    Event String:
    The Knowledge Consistency Checker (KCC) has detected problems with the following directory partition.
    A warning event occurred. EventID: 0x80000749
    Time Generated: 08/04/2022 11:17:35
    Event String:
    The Knowledge Consistency Checker (KCC) was unable to form a complete spanning tree network topology. As a result, the following list of sites cannot be reached from the local site.
    A warning event occurred. EventID: 0x8000061E
    Time Generated: 08/04/2022 11:17:35
    Event String:
    All directory servers in the following site that can replicate the directory partition over this transport are currently unavailable.
    An error event occurred. EventID: 0xC000051F
    Time Generated: 08/04/2022 11:17:35
    Event String:
    The Knowledge Consistency Checker (KCC) has detected problems with the following directory partition.
    A warning event occurred. EventID: 0x80000749
    Time Generated: 08/04/2022 11:17:35
    Event String:
    The Knowledge Consistency Checker (KCC) was unable to form a complete spanning tree network topology. As a result, the following list of sites cannot be reached from the local site.
    A warning event occurred. EventID: 0x8000082C
    Time Generated: 08/04/2022 11:18:05
    Event String:
    A warning event occurred. EventID: 0x8000082C
    Time Generated: 08/04/2022 11:29:06
    Event String:
    A warning event occurred. EventID: 0x8000082C
    Time Generated: 08/04/2022 11:30:06
    Event String:
    A warning event occurred. EventID: 0x8000082C
    Time Generated: 08/04/2022 11:30:36
    Event String:
    ……………………. DC02 failed test KccEvent
    Starting test: KnowsOfRoleHolders
    ……………………. DC02 passed test KnowsOfRoleHolders
    Starting test: MachineAccount
    ……………………. DC02 passed test MachineAccount
    Starting test: NCSecDesc
    ……………………. DC02 passed test NCSecDesc
    Starting test: NetLogons
    ……………………. DC02 passed test NetLogons
    Starting test: ObjectsReplicated
    ……………………. DC02 passed test ObjectsReplicated
    Starting test: Replications
    [Replications Check,Replications Check] Inbound replication is disabled.
    To correct, run «repadmin /options DC02 -DISABLE_INBOUND_REPL»
    [Replications Check,DC02] Outbound replication is disabled.
    To correct, run «repadmin /options DC02 -DISABLE_OUTBOUND_REPL»
    ……………………. DC02 failed test Replications
    Starting test: RidManager
    The DS has corrupt data: rIDPreviousAllocationPool value is not valid
    No rids allocated — please check eventlog.
    ……………………. DC02 failed test RidManager
    Starting test: Services
    NETLOGON Service is paused on [DC02]
    ……………………. DC02 failed test Services
    Starting test: SystemLog
    An error event occurred. EventID: 0x0000410B
    Time Generated: 08/04/2022 11:14:05
    Event String:
    The request for a new account-identifier pool failed. The operation will be retried until the request succeeds. The error is
    ……………………. DC02 failed test SystemLog
    Starting test: VerifyReferences
    ……………………. DC02 passed test VerifyReferences

    Running partition tests on : ForestDnsZones
    Starting test: CheckSDRefDom
    ……………………. ForestDnsZones passed test CheckSDRefDom
    Starting test: CrossRefValidation
    ……………………. ForestDnsZones passed test CrossRefValidation

    Running partition tests on : DomainDnsZones
    Starting test: CheckSDRefDom
    ……………………. DomainDnsZones passed test CheckSDRefDom
    Starting test: CrossRefValidation
    ……………………. DomainDnsZones passed test CrossRefValidation

    Running partition tests on : Schema
    Starting test: CheckSDRefDom
    ……………………. Schema passed test CheckSDRefDom
    Starting test: CrossRefValidation
    ……………………. Schema passed test CrossRefValidation

    Running partition tests on : Configuration
    Starting test: CheckSDRefDom
    ……………………. Configuration passed test CheckSDRefDom
    Starting test: CrossRefValidation
    ……………………. Configuration passed test CrossRefValidation

    Running partition tests on : tarlan-auto
    Starting test: CheckSDRefDom
    ……………………. tarlan-auto passed test CheckSDRefDom
    Starting test: CrossRefValidation
    ……………………. tarlan-auto passed test CrossRefValidation

    Running enterprise tests on : tarlan-auto.local
    Starting test: LocatorCheck
    ……………………. tarlan-auto.local passed test LocatorCheck
    Starting test: Intersite
    ……………………. tarlan-auto.local passed test Intersite
    Пытался сбросить безопасный канал, пишет неверный логин\пароль.

  4. Алибек:

    Спасибо за статьи, очень помогли решить проблему. У старого домена принудительно забрал fsmo роли, установил новый домен и настроил репликацию. Предыдущий коммент можно удалить)

  5. Вячеслав:

    при попытке остановить KDC выходит сообщение:
    PS C:\Windows\system32> net stop KDC
    Служба не реагирует на управляющие функции.
    Для вызова дополнительной справки наберите NET HELPMSG 2186.
    PS C:\Windows\system32> NET HELPMSG 2186
    Служба не реагирует на управляющие функции.

  6. Иван Семин:

    А вы запускаете в cmd в режиме администратора?

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *