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

Article translations Article translations
Article ID: 2021058 - View products that this article applies to.
Expand all | Collapse all

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."

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.

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.
Note This is a "FAST PUBLISH" article created directly from within the Microsoft support organization. The information contained herein is provided as-is in response to emerging issues. As a result of the speed in making it available, the materials may include typographical errors and may be revised at any time without notice. See Terms of Use for other considerations.

Properties

Article ID: 2021058 - Last Review: April 27, 2010 - Revision: 6.0
APPLIES TO
  • Windows Server 2008 R2 Standard
  • Windows Server 2008 Standard
Keywords: 
KB2021058

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com