Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

ADPREP /FORESTPREP Fails with Error 0x80070002 or 0x80070020 on Windows Server 2008 and Windows Server 2008 R2 If Locks Exist on ADPREP Log Files


Symptoms

The Windows Server 2008 and Windows Server 2008 R2 ADPREP /FORESTPREP command may fail with the error "the call back function failed" with status 0x80070002 or 0x80070020 if 3rd-party applications establish a lock on files used by ADPREP. Execute the steps in the resolution section of this article if the symptoms match a similar failure in your environment.

This article does not pertain to cases where ADPREP fails with the error "the call back function failed" but with status codes different than 0x80070002 or 0x80070020.

ADPREP /FORESTPREP reports that "Adprep was unable to complete because the call back function failed" and one of two error strings above the "[User Action]" section of the error text:

  • The system cannot find the file specified. (0x80070002).

    OR

  • The process cannot access the file because it is being used by another process. (0x80070020).

The full error text is listed below: 

Example 1: ADPREP cannot move LDIF file

Adprep was unable to complete because the call back function failed.
[Status/Consequence]
Error message: Error(110) while running ""C:\WINDOWS\system32\LDIFde.exe" -o ObjectGuid -d "CN=msCOM-PartitionSet-Display,CN=401,CN=DisplaySpecifiers,CN=Configuration,DC=contoso,DC=com" -u -f "C:\DOCUME~1\<username>\LOCALS~1\Temp\<file name>.tmp" -j "C:\WINDOWS\debug\adprep\logs\<YYYMMDD######>" -s <dc name>.<FQDN>". Could not
move file C:\WINDOWS\debug\adprep\logs\<YYYMMDD######>\LDIF.err to C:\WINDOWS\debug\adprep\logs\<YYYMMDD######>\DisplaySpecifierUpgradeLdifError.001.txt. The system cannot find the file specified. (0x80070002).
[User Action]
Check the log file ADPrep.log, in the C:\WINDOWS\debug\adprep\logs\<YYYMMDD######> directory for more information.

Adprep was unable to update forest information.
[Status/Consequence]
Adprep requires access to existing forest-wide information from the schema master in order to complete this operation.
[User Action]
Check the log file, ADPrep.log, in the C:\WINDOWS\debug\adprep\logs\<YYYMMDD######> directory for more information.
 

Error 110 maps to ERROR_OPEN_FAILED “The system cannot open the device or file specified.” Error 0x80070002 maps to ERROR_FILE_NOT_FOUND "The system cannot file the file specified."

Note The attribute cited in the LDIFDE attribute may vary. If the 110 and 0x80070002 strings match in an ADPREP /FORESTPREP failure, you have a probable match.

Example 2: ADPREP cannot delete LDIF file

Adprep was unable to complete because the call back function failed.
[Status/Consequence]
Error message: C:\WINDOWS\debug\adprep\logs\<YYYMMDD######>\LDIF.log The process
cannot access the file because it is being used by another process.
(0x80070020).
[User Action]
Check the log file ADPrep.log, in the C:\WINDOWS\debug\adprep\logs\<YYYMMDD######> directory for more information.

Adprep was unable to update forest information.
[Status/Consequence]
Adprep requires access to existing forest-wide information from the schema master in order to complete this operation.
[User Action]
Check the log file, ADPrep.log, in the C:\WINDOWS\debug\adprep\logs\<YYYMMDD######> directory for more information.

Error 0x80070020 maps to ERROR_SHARING_VIOLATION "The process cannot access the file because it is being used by another process."

↑ Back to the top


Cause

ADPREP /FORESTPREP and ADPREP /DOMAINPREP /GPPREP contain several call back function to prepare Active Directory forests and domains for the addition of domain controllers running new operating system versions.  

In the case of the errors above, ADPREP /FORESTPREP is delegating control to a call back function to add some 1000+ display specifiers to the Active Directory schema partition. As part of its normal operation, this call back function uses LDIFDE.EXE to move or delete a LDIF log file cited in the error strings.  

  • The 0x80070020 error indicates that an external process is preventing LDIFDE from deleting the specified LDIF log file.

  • The 0x80070002 error indicates that the specified LDIF file cannot be deleted because an external process has a lock or handle on the file.

↑ Back to the top


Resolution

A software application, commonly antivirus software, has created a file lock that is interfering with files used by ADPREP /FORESTPREP or ADPREP /DOMAINPREP.

Fast Track Method

  1. Retry running ADPREP /FORESTPREP or ADPREP /DOMAINPREP on the schema operations master to determine if the problem is transient.

  2. Run Windows Server 2008 R2 ADPREP.

    The Windows Server 2008 R2 ADPREP has been modified to prevent antivirus software from interfering with /FORESTPREP. Run the Windows Server 2008 R2 ADPREP if you have the Windows Server 2008 R2 installation media available.

  3. Retry running ADPREP with 3rd-party services disabled.

    Method 1: Stop services that create locks on files in the file system and focusing specifically on antivirus software. Retry ADPREP.

    Method 2: Press F8 during OS boot and chose "Safe Mode with Networking". Retry ADPREP. Reboot into normal mode on completion.

    Method 3: Disable non-boot related 3rd party services. Reboot. Retry ADPREP. Enable 3rd-party services and startup post ADPREP.

Windows key + R -> MSCONFIG -> Services tab - > Hide all Microsoft Services -> Disable checkbox for 3rd-party services
Windows key + R -> MSCONFIG -> Startup tab - > Hide all Microsoft Services -> click "Disable all" 

Root Cause Method 

  1. Download the Handle.exe tool to the schema FSMO and extract the HANDLE.EXE file. Handle.exe can be downloaded from:

    http://technet.microsoft.com/en-us/sysinternals/bb896655.aspx

  2. Run ADPREP to reproduce the "the call back function failed" with status 0x80070002 or 0x80070020 error.

    The ADPREP log files under the %systemroot%\debug\adprep\logs folder offer little guidance for the root cause described by this article and can be ignored.

    The text "Adprep requires access to existing forest-wide information from the schema master in order to complete this operation" can also be ignored if ADPREP /FORESTPREP is failing with the exact errors listed in the symptom section of this article.

  3. Run the Handle.exe tool to determine which process name and process ID has a lock on the LDIF file cited in the ADPREP /FORESTPREP error. For example, if the ADPREP /FORESTPREP error indicates that file C:\Windows\System32\Debug\Adprep\Logs\20090301234567\LDIF.log cannot be accessed, run the following HANDLE.EXE command:

    Handle.exe C:\Windows\System32\Debug\Adprep\Logs\20090301234567\LDIF.log

  4. Break the lock on the file that is blocking ADPREP.

    Reconfigure the offending application as required. This may include configuring exclusion settings for the ADPREP file and or directory in the application software, stopping relevant services or, as a last resort, removing the offending application.

↑ Back to the top


More Information

McAfee antivirus software was installed in the majority of customer cases reviewed with this error. Case notes rarely cite version numbers. One case noted that McAfee VirusScan Enterprise 8.5i caused the problem.

The ADPREP development team was able to reproduce errors in the symptom section in approximately 70% of ADPREP /FORESTPREP executions after installing McAfee 8.5i. These results match case notes which indicate that ADPREP /FORESTPREP sometimes executed successfully after multiple failures even though no configuration changes had been made.

↑ Back to the top


Keywords: vkball, kb

↑ Back to the top

Article Info
Article ID : 2021058
Revision : 1
Created on : 1/8/2017
Published on : 4/27/2010
Exists online : False
Views : 131