On an Exchange Server 2013 server that is installed with the Mailbox server role, when you attempt to delete the files and folders for a database or database copy that has been removed, you may receive an error.

exchange-2010-removing-database-files-01

exchange-2010-removing-database-files-02

The action can’t be completed because the file is open in noderunner.exe

Inside the folders that previously contained the database you will see various subfolders and index files relating to search services.

exchange-2010-removing-database-files-03

The issue is that even though the database has been removed the search/index files are still locked by the noderunner.exe process and can’t be deleted.

Using Process Explorer we can see that noderunner.exe is a child process of the Microsoft Exchange Search Host Controller (HostControllerService) service.

exchange-2010-removing-database-files-04

exchange-2010-removing-database-files-05

To clear the file lock you can restart the HostControllerService service using PowerShell.

PS C:\> Restart-Service HostControllerService

You should now be able to delete the files and folders successfully.

In my own scenario the HostControllerService began consuming a large amount of CPU for a short period of time after the restart, but then calmed down to normal levels again after a few moments.

About the Author

Paul Cunningham

Paul is a former Microsoft MVP for Office Apps and Services. He works as a consultant, writer, and trainer specializing in Office 365 and Exchange Server. Paul no longer writes for Practical365.com.

Comments

  1. Doug

    This happens to a random database in our environment about once a month and requires a full removal of the copy, dismount, remount, deletion of the old .edb and log folder, then add the copy back and reseed. We have redundancy across 2 data centers for each database but this is getting ridiculous. It happens at random to different databases and is quite cumbersome to repeat on a monthly basis. I have the server health script running and it appears that one database will just gradually get more and more out of sync with the active copy until it can’t keep up and goes into a failed state. Other databases that sync between the same two servers but don’t have the same issue. Once that one database is fixed, about a month later one of the other databases that was working fine during the last database issue will then do the same thing. So we know it’s not a specific database issue, it appears to be an Exchange 2013 issue. So far, I have not been impressed with Exchange 2013 at all and it’s extremely frustrating for a company with over 130k mailboxes amounting to 110TB of mail data.

    1. Avatar photo
      Paul Cunningham

      Have you opened a support case with Microsoft? What you’re experiencing isn’t normal, and there could be a solution they can help you find.

  2. Adam

    I’m seeing this issue on some 2013 CU8 installs. I’m trying to delete the initially created database folders and some servers have deleted them correctly, but some won’t. FastSearchIndex is locking the folder. I can stop the service, delete the folder, start the service, and the folder comes right back with the index files.

    Anyone see a solution for this?

    1. Adam

      I found the issue on my servers. The only way to get the search host to release the database folder completely is to create a new database on that specific server. Once I created another database and mounted it, the initial mailbox database folder could be deleted normally.

      Hope this helps someone.

      1. Maxim

        THX. This is help to me.

  3. Shawn

    Looks like this is still an issue with SP1. I’ve stopped FastSearch, Host Controller and Store and once they’re started again, the files and file structure reappear.

    Any news on this?

    1. Mark Dickson

      Sorry to post on an old article, but I’m using a new install of Exchange 2013 SP1 CU6 and I’m having this same issue with removed database files that keep coming back even after successfully deleting with the Search Host Controller service disabled.

        1. Bob

          Just the index files. They still come back after rebooting.

        2. Erik

          Any word on this? I’m having the same issue. I am trying to delete two folders that once contained databases. Those databases were deleted out of Exchange. Every time I delete them and restart the search service, the folders get recreated and new index files appear. How do I get rid of this?!

  4. Tom

    Paul, I’ve run into a similar issue, but I can’t perform a database reseed because it’s showing that a process has locked the edb file. The process that seems to have it locked is microsoft.exchange.store.worker.exe. I can’t seem to find a way to remove that lock. Tried restarting the service mentioned above, tried to restart the information store (after failing all DBs over), but it’s still showing it’s locked by the same process. I tried to rename the EDB file since it’s only 4GB, but it said the microsoft.exchange.store.worker.exe process had it locked. Any thoughts on removing that lock?

    1. Avatar photo
      Paul Cunningham

      You tried restarting the info store but did you try stopping it instead?

      1. Tom

        I just tried your suggestion and it still wouldn’t reseed – the file remained locked by the store.worker.exe process. Bizarre! I finally got a reseed going by failing over all DBs and rebooting the server. Not much of a long term fix, but at least it’s something for now.

        1. Jake Black

          Hi Tom,
          if you are still issued with the opening file then you can try the LongPath tool program. it is best for eliminating the long path file errors, java file errors, etc.
          I hope it will be helpful to try it.
          Kind Regards

  5. JeanLuc

    It appears with Exchange 2013 SP1..
    I deleted when the service was stopped. I’m afraid to look for process monitor.. may be it search these files again….

  6. Vant Seto

    The problem exists with the final release of Exchange 2013 Enterprise. Stop the service, delete the entire folder, start the service and the folder is recreated. You can’t get rid of these files.

  7. Aakash

    Thanks Simon.
    Just verified. This problem is fixed in CU1.

    1. HL

      I have CU1 and it keeps recreating the files on 2 of my 4 servers.

  8. Tim

    But you know what, the files will be generated later again!

    Pretty scary…I believe the FAST cache should be cleared somewhere but MS just didn’t release any information about it…

    1. Avatar photo
      Paul Cunningham

      Yes they will be generated again if you create a database or database copy in that path again.

      1. Simon

        Hi Paul,
        I’m afraid those files will be generated again even if you do NOT create a database in that path again… It seems to me the Search Service creates those files again even if the db is deleted.

        This looks like a Microsoft bug to me.

        1. Avatar photo
          Paul Cunningham

          I’ve created a test DB then gone through the removal steps above, and the files are gone and haven’t come back.

          What exact steps are you using to reproduce the issue?

        2. Simon

          Someone said this problem is fixed in CU1. I will try it. Thanks!

  9. Aakash

    Thanks. This was useful.
    So what is the right way to delete the Exchange files after we remove the MB Database? Do you suggest restarting the host controller service all the time.

    1. Avatar photo
      Paul Cunningham

      I only recommend doing it if you encounter this problem when trying to delete the files.

      1. Aakash

        Apparently it always complains about the files being in use.
        I am not too sure what MS recommends to clean up those physical files.

        1. Avatar photo
          Paul Cunningham

          Then I imagine this solution will get a lot of use in coming years 🙂

Leave a Reply