Cannot add duplicate collection entry of type with unique key attribute set to ...

Created:

2016-11-16 12:42:35 UTC

Modified:

2017-08-16 15:53:25 UTC

2

Was this article helpful?


Have more questions?

Submit a request

Cannot add duplicate collection entry of type with unique key attribute set to ...

Applicable to:

  • Plesk for Windows

Symptoms

Changing the handler (ASP status, PHP version, etc.) in the domain settings of Plesk fails with the following error message:

`Error: Cannot add duplicate collection entry of type 'add' with unique key attribute 'name' set to 'ASPClassic'`

OR

Unable to access IIS settings for domain in Plesk, it's getting failed with the error message below:

Internal error: Filename: \\?\C:\Windows\system32\inetsrv\config\applicationHost.config Line number: 182673 Error: Cannot add duplicate collection entry of type 'mimeMap' with unique key attribute 'fileExtension' set to '.woff' In module Exception type:System.Runtime.InteropServices.COMException at Microsoft.Web.Administration.Interop.AppHostWritableAdminManager.GetAdminSection(String bstrSectionName, String bstrSectionPath) at Microsoft.Web.Administration.Configuration.GetSectionInternal(ConfigurationSection section, String sectionPath, String locationPath) at ServerManagerFactory.getSectionInternal(String sectionPath, Type sectionType, String location) at ServerManagerFactory.getStaticContentSection(String location) at IISVirtualDir.getMimeMap(IISVirtualDir* , map<std::basic_string<wchar_t\,std::char_traits<wchar_t>\,std::allocator<wchar_t> >\,std::basic_string<wchar_t\,std::char_traits<wchar_t>\,std::allocator<wchar_t> >\,std::less<st
d::basic_string<wchar_t\,std::char_traits<wchar_t>\,std::allocator<wchar_t> > >\,std::allocator<std::pair<std::basic_string<wchar_t\,std::char_traits<wchar_t>\,std::allocator<wchar_t> > const \,std::basic_string<wchar_t\,std::char_traits<wchar_t>\,std::allocator<wchar_t> > > > >* mimeTypes) at getMimeTypes(example.com, )(WebServerAdapter::getMimeTypes line 1491) at execute console command --get-mime-types(vconsoleapp::start line 100) at execute "C:\Program Files (x86)\Parallels\Plesk\admin\bin64\websrvmng.exe" --get-mime-types "--vhost-name=example.com" "--vdir-name=/"(vconsoleapp::run line 117) (Error code 1)

Cause

As the error message indicates, a mentioned parameter has duplicate collection entries ( ASPClassic , for example). The website inherits these settings from a global level. Most likely, this collection entry already was defined in the global configuration.

Resolution

  1. Back up the current IIS configuration using the following command in cmd.exe :

    %windir%\system32\inetsrv\appcmd.exe add backup "My Backup Name"
  2. Open the file %windir%\system32\inetsrv\config\applicationHost.config in a text editor and find the section containing the website configuration:

    <location path="example.com">
  3. Under this section, find <handlers> and remove the string starting with the collection entry name shown in the error ( ASPClassic ):

    <add name="ASPClassic" path="*.asp" verb="GET,HEAD,POST,TRACE" modules="IsapiModule" scriptProcessor="C:\Windows\System32\inetsrv\asp.dll" resourceType="Either" />
  4. Save the changes made in the %windir%\system32\inetsrv\config\applicationHost.config file and try to perform the failed action again.

    NOTE: If the error occurs again with another attribute 'name' , delete it from the <handlers> section using the steps described above.

Another way to fix this issue:

  • Open IIS Manager and remove the domain

  • Run the following command in cmd.exe:

    %plesk_dir%\bin\repair.exe --reconfigure-web-site -web-site-name example.com
Have more questions? Submit a request
Please sign in to leave a comment.