Share via


Error : Invalid URI: The hostname could not be parsed while Creating or Extending Web Application using CA

Question

Tuesday, April 22, 2014 7:17 AM | 1 vote

Hi All,

When i am going to create new web application or extending the existing web application using Central Administration.

It throw error:

ULS Log Error shows:



Unexpected System.UriFormatException: Invalid URI: The hostname could not be parsed.    at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)     at Microsoft.SharePoint.Administration.SPVirtualServer.InitializeIisComponents(SPIisWebSite iisInstance)     at Microsoft.SharePoint.Administration.SPVirtualServerCollection.Undirty()     at Microsoft.SharePoint.Administration.SPVirtualServerCollection..ctor()     at Microsoft.SharePoint.WebControls.IisWebSiteSection.PopulateIisWebSiteDropDownList()     at Microsoft.SharePoint.WebControls.IisWebSiteSection.OnLoad(EventArgs e)     at System.Web.UI.Control.LoadRecursive()     at System.Web.UI.Control.LoadRecursive()     at System.Web.UI.Control.LoadRecursive()     at System.Web.UI.Control.LoadRecursive()     at System.Web.UI.Control.LoadRe... f1a5899c-4b18-50d4-9421-ecd319658fa8
Unexpected  ...cursive()     at System.Web.UI.Control.LoadRecursive()     at System.Web.UI.Control.LoadRecursive()     at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)    f1a5899c-4b18-50d4-9421-ecd319658fa8



Existing web application is working fine, Even i am able to create new site collection with existing one.

Can any one suggest the resolution for this issue.

Thanks in advance

Manoj Mittal

All replies (6)

Wednesday, April 23, 2014 6:07 AM ✅Answered | 1 vote

Hi Manoj,

This issue may be about permissions of the user that you used. Please use a farm account to log in CA, and test again, compare the result.

Thanks,

Wendy

Wendy Li
TechNet Community Support


Wednesday, April 23, 2014 5:18 AM | 1 vote

Hi Manoj,

According to your description, my understanding is that you got an error when you created or extended a web application in SharePoint 2013 Central Administration.

Please try to create or extend a web application using PowerShell command, compare the result.

Creating a new web application using PowerShell command:

$ap = New-SPAuthenticationProvider

New-SPWebApplication -Name <Name> -ApplicationPool <ApplicationPool> -ApplicationPoolAccount <ApplicationPoolAccount> -URL <URL> -Port <Port> -AuthenticationProvider $ap

Extending a existing web application:

Get-SPWebApplication -Identity http://sitename | New-SPWebApplicationExtension -Name <Name> -HostHeader <HostHeader> -Zone <Zone> -URL <URL> -Port <Port> -AuthenticationProvider $ap

More information, please refer to the link:

http://technet.microsoft.com/en-us/library/ee806885(v=office.15).aspx

http://technet.microsoft.com/en-us/library/gg276325(v=office.15).aspx

I hope this helps.

Thanks,

Wendy

Wendy Li
TechNet Community Support


Wednesday, April 23, 2014 5:57 AM

Thanks Wendy, your understanding is correct !!

I tried that power shell script, Its working

Add-PSSnapin "Microsoft.SharePoint.PowerShell" 
$ap = New-SPAuthenticationProvider
New-SPWebApplication -Name "Contoso Internet Site" -Port 2002 -URL "http://a2ms06873" -ApplicationPool "NetworkService" -ApplicationPoolAccount (Get-SPManagedAccount "DomainName\Administrator") -AuthenticationProvider $ap 

what can be the reason, i am not able to create or extent the web application using Central Administrator.

Thanks 

Manoj Mittal


Friday, August 1, 2014 1:19 PM | 11 votes

I ran into the same error.   It was because I had an asterisk instead of a full host name in the bindings in IIS for  another web application.  Once I edited the bindings and added the hostname, I was able to create a web application using Central Admin.


Thursday, October 23, 2014 2:15 AM | 2 votes

I ran into the same error.   It was because I had an asterisk instead of a full host name in the bindings in IIS for  another web application.  Once I edited the bindings and added the hostname, I was able to create a web application using Central Admin.

+1 for the asteric in the bindings of the website.  mistakenly did that when I added the cert and edited the bindings when we went SSL.

Technology Administrator Erie County (Career and) Technical School.


Saturday, September 28, 2019 11:21 AM

Exactly this is what happened to me when setting ssl in sp2019, and replacing that asterisk with address solved the problem.