We are excited to announce that the IIS.NET Forums are moving to the new Microsoft Q&A experience. Learn more >

Cannot write configuration file [Answered]RSS

7 replies

Last post Oct 10, 2012 10:42 AM by AWOMS

  • Cannot write configuration file

    Sep 10, 2012 08:09 AM|AWOMS|LINK

    We have a shared configuration setup running fine for 2 years, suddenly we started getting these errors:

    Message: Error: Filename: \\?\UNC\fsc-name\iis$\applicationHost.config Error: Cannot write configuration file

    We recently added additional web servers to the shared configuration and there are about 1000 sites in the configuration file which is 2,783 KB.
    What would be causing this sporadic error?

    remote iis7 powershell snap-in arr powershelll

  • Re: Cannot write configuration file

    Sep 10, 2012 09:34 AM|JamieFurr|LINK

    Hi,

    Can you confirm that the IIS shared configuration account has the proper Share and NTFS permissions on the shared folder?

     

    Jamie Furr
    MCSA, Network +, A+

    Please 'Mark as Answer' if this post helps you.

    OrcsWeb: Managed Windows Hosting Solutions
    "Remarkable Service. Remarkable Support."
  • Re: Cannot write configuration file

    Sep 10, 2012 09:36 AM|AWOMS|LINK

    Yes. This is not a permissions problem 100%. This has been working fine for 2 years.

    I'm beginning to think the error occurs only when the script is trying to be executed by multiple people simultaneously.

    Does IIS support multiple New-Website commands being executed simultaneously?
  • Re: Cannot write configuration file

    Sep 10, 2012 11:00 AM|AWOMS|LINK

    Update: When I execute the same script simultaneously it triggers the following:

    Filename: \\?\UNC\fsc-name\iis$\applicationHost.config Error: Cannot commit configuration changes because the file has changed on disk

    How does IIS handle simultaneous writes? Is it different through the GUI and PowerShell?
  • Re: Cannot write configuration file

    Sep 10, 2012 11:07 AM|JamieFurr|LINK

    Hi,

    The following thread may be helpful to you.

    http://forums.iis.net/p/1173334/1962710.aspx#1962710

    Jamie Furr
    MCSA, Network +, A+

    Please 'Mark as Answer' if this post helps you.

    OrcsWeb: Managed Windows Hosting Solutions
    "Remarkable Service. Remarkable Support."
  • Re: Cannot write configuration file

    Sep 24, 2012 05:53 PM|AWOMS|LINK

    We serialized any scripts that would be running simultaneously, but we are still getting intermittent errors / issues with this large-scale shared configuration.

    -Does IIS have issues with applicationHost.config files above a certain size? (Ours is 2,791 KB)
    -Does IIS have limits as to how often the configuration can be read or written to?
    -Is there any way to split the configuration file up or move sections into a new file?
    -Does IIS have any other limits to be made aware of such as max sites?
  • Re: Cannot write configuration file

    Sep 30, 2012 12:49 PM|JamieFurr|LINK

    Hi,

     

    I have not seen these errors using shared config.  You may want to consider keeping the configuration local to each server and syncing it with DFS-R.  Here's a good walkthrough:  http://learn.iis.net/page.aspx/212/offline-files-for-shared-configuration/

    I'm not certain that is what is causing the issue you're seeing, but using DFS works well for us. And you would not be dependent on the UNC shares availability for Shared Config to function.

     

     

     In regards to the other questions.


    -Does IIS have issues with applicationHost.config files above a certain size? (Ours is 2,791 KB) 

      I do not know of such limitations, but there may very well be some.
    -Does IIS have limits as to how often the configuration can be read or written to?

      I do not know of such limitations, but there may very well be some.
    -Is there any way to split the configuration file up or move sections into a new file?

      Yes, the ChildSource attribute, but it only works for the Sites section in applicationHost.config.
    -Does IIS have any other limits to be made aware of such as max sites?

      I do not know of such limitations, but there may very well be some.

     

    Jamie Furr
    MCSA, Network +, A+

    Please 'Mark as Answer' if this post helps you.

    OrcsWeb: Managed Windows Hosting Solutions
    "Remarkable Service. Remarkable Support."
  • Re: Cannot write configuration file

    Oct 10, 2012 10:42 AM|AWOMS|LINK

    The issue was a single script having consecutive IIS cmdlets which apparently are completing and moving onto the next cmdlet before the actual applicationhost.config can fully commit the changes to disk. Adding a start-sleep -s 1 for example in between the cmdlets in the script resolved the issue.