none
Error while creating webapplication New-SPWebApplication : An error occurred while parsing EntityName. Line 1 + SharePoint 2010

    Question

  • I am using SQL authentication, while creating New-SPWebApplication script, it was working fine some time before, please assist me to dig out the issue.

    Issue: A corrupted web application got created on WFE server, where I have executed the New-SPWebApplication script, but couldn’t able access it and even I cannot see new application in IIS or virtual directory of other WFE servers

    Farm configuration: 4 WFE (load balancer), Fast search server, 1 database server ( SQL authentication )

    Error: New-SPWebApplication : An error occurred while parsing EntityName. Line 1, posi
    tion 12322.
    At E:\......\SiteSetupwithSQLAuthentication.ps1:21 ch
    ar:21
    + new-spwebapplication <<<<  -name $sp_webapp_name -Port $sp_webapp_port -Authe
    nticationProvider $as -hostheader $sp_webapp_hostheader -URL $sp_webapp_url -Ap
    plicationPool $sp_webapp_apppool -ApplicationPoolAccount $sp_webapp_apppoolacco
    unt -AllowAnonymousAccess:$allowAnonymous   -DatabaseName $sp_webapp_databasena
    me -DatabaseServer $sp_webapp_databaseserver -DatabaseCredentials $dbcredential
        + CategoryInfo          : InvalidData: (Microsoft.Share...PWebApplication:
       SPCmdletNewSPWebApplication) [New-SPWebApplication], XmlException
        + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletNewSPWeb
       Application

    web application is configured
    --------------------

    Extracted Log file Errors:

    S-1-5-21-2105438894-2453371012-1234567890-6985 will not be granted access to the StateService_GUID database because the database is configured to use sql authentication.

    App 'Word Automation Services': Farm service account has changed, new identity = 'S-1-5-21-2105438894-2453371012-1234567890-6985', updating database to grant access

    S-1-5-21-2105438894-2453371012-1234567890-6985 will not be granted access to the WordAutomationServices_GUID database because the database is configured to use sql authentication.

    S-1-5-21-2105438894-2453371012-1234567890-8373 will not be granted access to the SessionStateService_GUID database because the database is configured to use sql authentication.

    Videntityinfo::isFreshToken reported failure.

    Granting server state permission for S-1-5-21-2105438894-2453371012-1234567890-6985.
    System.Data.SqlClient.SqlException: Login failed. The login is from an untrusted domain and cannot be used with Windows authentication.   
     at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)   
     at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)   
     at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)   
     at System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK)   
     at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject)   
     at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart)   
     at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)   
     at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)   
     at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)   
     at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)   
     at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)   
     at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)   
     at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)   
     at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)   
     at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)   
     at System.Data.SqlClient.SqlConnection.Open()   
     at Microsoft.SharePoint.Utilities.SqlSession.OpenConnection()

     System.Xml.XmlException: An error occurred while parsing EntityName. Line 1, position 10819.  
     at System.Xml.XmlTextReaderImpl.Throw(Exception e)   
     at System.Xml.XmlTextReaderImpl.HandleEntityReference(Boolean isInAttributeValue, EntityExpandType expandType, Int32& charRefEndPos)   
     at System.Xml.XmlTextReaderImpl.ParseAttributeValueSlow(Int32 curPos, Char quoteChar, NodeData attr)   
     at System.Xml.XmlTextReaderImpl.ParseAttributes()   
     at System.Xml.XmlTextReaderImpl.ParseElement() 

     

    How to validate if there users correct and where they are stored?, is there configuration file used?

    Please help me.




    Thursday, December 29, 2011 10:04 AM

Answers

  • Issue:
    ---------------------------------
    Customer is getting an error while creating a new web application.

    System.Xml.XmlException: An error occurred while parsing EntityName. Line 1, position 10819.  
     at System.Xml.XmlTextReaderImpl.Throw(Exception e)   
     at System.Xml.XmlTextReaderImpl.HandleEntityReference(Boolean isInAttributeValue, EntityExpandType expandType, Int32& charRefEndPos)   
     at System.Xml.XmlTextReaderImpl.ParseAttributeValueSlow(Int32 curPos, Char quoteChar, NodeData attr)   
     at System.Xml.XmlTextReaderImpl.ParseAttributes()   
     at System.Xml.XmlTextReaderImpl.ParseElement()   

    Unable to create web application using powershell or UI.

    Cause:
    ---------------------------------
    The issue is happening as the SQL Service account used to configured Session State for SharePoint has ‘&’ character in its password.

    While creating Web application it has made following session state entry in Web application web.config and try to iterate through all the other WFE which cause to fail the functionality while it try to read "&" character in password.

    WebConfigModification: Adding web config node - Path - configuration/system.web Node name - sessionState Node value - <sessionState mode="SQLServer" timeout="60" allowCustomSqlDatabase="true" sqlConnectionString="Data Source=Database_ServerName;Initial Catalog=SessionStateService_SDERTGWE-75E1-4012-B7B1-68576SWEVFRY;Integrated Security=False;User ID=SA;Password=45246dgjeer@&222; Enlist=False;Connect Timeout=15" /> in web.config file C:\inetpub\wwwroot\wss\VirtualDirectories\Test77\web.config 

     

    Resolution:

    Following are the workarounds that we have. You have decided to go with the first workaround:

     

    1. Start the Session State service using a sql account which does not have ampersand ('&') in its password.

    OR

    2. Stop Session State Service and create the web application. Later start it again.


    Thanks, ShankarSingh

    Monday, January 23, 2012 11:03 AM

All replies

  • I have ran Product configuration wizard in all WFE server as per following blog:

    http://social.technet.microsoft.com/Forums/en-HK/sharepoint2010setup/thread/53ccaae2-4420-4c27-8555-112f117c9fa1

     

    Still issue has not resolved

    Thursday, December 29, 2011 10:10 AM
  • Hi,

    Go to registry -> Local_HKLocalusers and check for the IDs like S-1-5-21-2105438894-2453371012-1234567890-6985 and S-1-5-21-2105438894-2453371012-1234567890-8373 . find out the User ID associated to these GUIDs and check for the permission on the server as well as SQL. it seems that the permission for the account you are using had been changed. Also it seems that the farm admin account (system account) had been changed. Firstly verify details for these accounts.

    Thursday, December 29, 2011 12:12 PM
  • Hi Sumit,

    Thanks for your input, SID id seems to pointing correct service account, i have verified the configuration.

    Finally we have gone to get help from Microsoft sharepoint support team

     


    Thanks, ShankarSingh
    Monday, January 02, 2012 12:14 PM
  • Hi,

    If you can find the accounts mentioned in the errors, you can go to sql server > open sql server instance > expand root node > expand security node > open logins node to check if these accounts have been granted proper permissions.

    Regards,

    Seven

    • Marked as answer by Seven M Friday, January 06, 2012 1:12 AM
    • Unmarked as answer by Nikhil S Singh Thursday, June 26, 2014 4:15 PM
    Wednesday, January 04, 2012 8:04 AM
  • Issue:
    ---------------------------------
    Customer is getting an error while creating a new web application.

    System.Xml.XmlException: An error occurred while parsing EntityName. Line 1, position 10819.  
     at System.Xml.XmlTextReaderImpl.Throw(Exception e)   
     at System.Xml.XmlTextReaderImpl.HandleEntityReference(Boolean isInAttributeValue, EntityExpandType expandType, Int32& charRefEndPos)   
     at System.Xml.XmlTextReaderImpl.ParseAttributeValueSlow(Int32 curPos, Char quoteChar, NodeData attr)   
     at System.Xml.XmlTextReaderImpl.ParseAttributes()   
     at System.Xml.XmlTextReaderImpl.ParseElement()   

    Unable to create web application using powershell or UI.

    Cause:
    ---------------------------------
    The issue is happening as the SQL Service account used to configured Session State for SharePoint has ‘&’ character in its password.

    While creating Web application it has made following session state entry in Web application web.config and try to iterate through all the other WFE which cause to fail the functionality while it try to read "&" character in password.

    WebConfigModification: Adding web config node - Path - configuration/system.web Node name - sessionState Node value - <sessionState mode="SQLServer" timeout="60" allowCustomSqlDatabase="true" sqlConnectionString="Data Source=Database_ServerName;Initial Catalog=SessionStateService_SDERTGWE-75E1-4012-B7B1-68576SWEVFRY;Integrated Security=False;User ID=SA;Password=45246dgjeer@&222; Enlist=False;Connect Timeout=15" /> in web.config file C:\inetpub\wwwroot\wss\VirtualDirectories\Test77\web.config 

     

    Resolution:

    Following are the workarounds that we have. You have decided to go with the first workaround:

     

    1. Start the Session State service using a sql account which does not have ampersand ('&') in its password.

    OR

    2. Stop Session State Service and create the web application. Later start it again.


    Thanks, ShankarSingh

    Monday, January 23, 2012 11:03 AM