Thursday, August 20, 2015

SharePoint 2013: The process cannot access the file... because it is being used by another process

Problem

You are performing a migration of a content database from SharePoint 2007 to SharePoint 2013. You've mounted the database to the 2013 farm and then migrate users:
$wa = Get-SPWebApplication https://URL
$wa.MigrateUsers($true)
$wa.ProvisionGlobally()
You then see the following error appear once the ProvisionGlobally method is executed:
Exception calling "ProvisionGlobally" with "0" argument(s): "The process cannot 
access the file 'C:\inetpub\wwwroot\wss\VirtualDirectories\[domainnamePort]\_app_bin\
Microsoft.SharePoint.WorkflowServices.ApplicationPages.dll' because it is being used 
by another process."
Browsing to the site, you experience an HTTP 404 error.  You begin troubleshooting.

Troubleshooting

  1. Check status of Windows Server services: all SharePoint and SharePoint-related services are running.
  2. Check status of application pools in IIS: all SharePoint application pools are started.
  3. Check status of sites in IIS: all SharePoint sites are started.
  4. Check status of services on server in Central Administration: Microsoft SharePoint Foundation Web Application is started.
  5. Check critical service account permissions to content database: spFarm, spService, spApp, spAdmin all have appropriate permissions.
  6. Check critical service account local permissions: all are members of local Administrators group.
  7. Check Alternate Access Mappings:  all mappings correct.
  8. Check file checkout: default file is not checked out.
  9. Unmount and remount content database: still have issue.
  10. Perform IISRESET: still have issue.
  11. Restart server: still have issue.
  12. Stop and restart Microsoft SharePoint Foundation Web Application service on server: service stopped without issue; however, when attempting to start it, observed this error:
    The process cannot access the file 'C:\inetpub\wwwroot\wss\VirtualDirectories\
    [DomainnamePort]\_app_bin\Microsoft.SharePoint.WorkflowServices.ApplicationPages.dll' because it is being used by another process. 
  13. Perform Internet search: some postings indicate that perhaps something is locking the port; do port check.
  14. Run netstat -ano: identified single process listening at port 80, and this was the NT Kernel & System.
  15. Perform Internet search: a posting suggested disabling anti-virus.
  16. Disable McAfee On-Access Scan on the web server: successfully browsed to site.

Solution

  • When observing an IIS file being locked by a process, in combination with an HTTP 4040 error, try disabling anti-virus.

References

  • Subsequently restarted McAfee anti-virus without observing any adverse affect on web application operation.

No comments: