locked
Dynamic Data Entities Web Application Login Failure on List.aspx page RRS feed

  • Question

  • User-1246852455 posted

    I have created a Dynamic Data Entities Web Application.

    Visual Studio 2008, Web Server 2008 Web Edition, SQL Server 2008 Web edition

    Locally everything runs and tests fine.

    Remotely, it hits the first page fine, listing all of the tables.

    But when I click on a table to see its grid, I get this error:

    Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.

    I then downloaded the existing website Entities zip example. Created a script from the .MDF and built a new database on my MS SQL Server 2008 database (which is connecting to my existing .net apps just fine).

    I deleted the existing Mode.edmx and created a new one that pionts to this new remote database.

    I uploaded everything to the web server, and although it also works fine locally, remotely it produces the same error.

    I am using the same anonymous user on this website in IIS7 as I am on my other .net websites.

    Is there some special thing I need on my web server or database server to get these entity connection strings to work?

     thanks!

     

    Thursday, November 6, 2008 3:17 PM

Answers

  • User-1246852455 posted

    I just created a Dynamic Data Entities Web Site, instead of a Project/Dynamic Data Entites Web Application.

     I do not get the same error and I can use the pages fine.

    So it appears to be a problem in only the Web Application version.

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, November 6, 2008 5:07 PM

All replies

  • User-1246852455 posted

    I just created a Dynamic Data Entities Web Site, instead of a Project/Dynamic Data Entites Web Application.

     I do not get the same error and I can use the pages fine.

    So it appears to be a problem in only the Web Application version.

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, November 6, 2008 5:07 PM
  • User-1005219520 posted

    Hi Nannette,

    I've seen this problem before. I think it's best to use file based web sites rather than web applications unless you have a compelling reason to use an application. What does the call stack show (where is this error coming from)? Is the error from trying to make a remote SQL connection? Do you have IIS7 and SQL08 on the same machine?

    Thursday, November 6, 2008 5:51 PM
  • User-1246852455 posted

    when reading about the differences, someone said that it was hard to use controls in the website version, but I don't know what they specifically meant, so I thought I'd use that version.

    I have a box with IIS7 and Widows 2008 Web Server edition, and a separate database server with Windows SQL 2008 Web Server Edition, so no, they are not on the same machine.

    Here is my call stack:

    [SqlException (0x80131904): Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.]
       System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4844759
       System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194
       System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2392
       System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +35
       System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +144
       System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +342
       System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +221
       System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +189
       System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +185
       System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +31
       System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +433
       System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66
       System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +499
       System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +65
       System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +117
       System.Data.SqlClient.SqlConnection.Open() +122
       System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure) +47

    [EntityException: The underlying provider failed on Open.]
       System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure) +168
       System.Data.EntityClient.EntityConnection.Open() +96
       System.Data.Objects.ObjectContext.EnsureConnection() +81
       System.Data.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption) +46
       System.Data.Objects.ObjectQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator() +39
       System.Linq.Enumerable.Single(IEnumerable`1 source) +107
       System.Data.Objects.ELinq.ObjectQueryProvider.<GetElementFunction>b__2(IEnumerable`1 sequence) +5
       System.Data.Objects.ELinq.ObjectQueryProvider.ExecuteSingle(IEnumerable`1 query, Expression queryRoot) +25
       System.Data.Objects.ELinq.ObjectQueryProvider.System.Linq.IQueryProvider.Execute(Expression expression) +43
       System.Linq.Queryable.Count(IQueryable`1 source) +240
       System.Web.UI.WebControls.EntityDataSourceQueryBuilder`1.Build(ObjectContext context, Boolean computeCount) +154
       System.Web.UI.WebControls.EntityDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments, Creator qbConstructor) +889
       System.Web.UI.WebControls.EntityDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +154
       System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +19
       System.Web.UI.WebControls.DataBoundControl.PerformSelect() +142
       System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +73
       System.Web.UI.WebControls.GridView.DataBind() +4
       System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82
       System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +72
       System.Web.UI.Control.EnsureChildControls() +87
       System.Web.UI.Control.PreRenderRecursiveInternal() +44
       System.Web.UI.Control.PreRenderRecursiveInternal() +171
       System.Web.UI.Control.PreRenderRecursiveInternal() +171
       System.Web.UI.Control.PreRenderRecursiveInternal() +171
       System.Web.UI.Control.PreRenderRecursiveInternal() +171
       System.Web.UI.Control.PreRenderRecursiveInternal() +171
       System.Web.UI.Control.PreRenderRecursiveInternal() +171
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842

     

    Thursday, November 6, 2008 5:56 PM
  • User357812854 posted
    Nanette, as a starting point, experiment with the "Secure Dynamic Data Site" sample. See the post at:  http://forums.asp.net/t/1343958.aspx<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>

    Also, could you please give us some details on the scenario you are trying to address?

    Michael

     

    Thursday, November 6, 2008 8:40 PM
  • User-1005219520 posted

    Hi Nannette,

    The error message is stating that  the anon users doesn't have an account on the SQL Server.  Are your connection strings identical (web app & web site). Are you using integrated security or SQL security to connect?

    When you run your site under visual studio with the ASP.Net development server (AKA cassani), you're running under the credentials of the same account VS is using (that would be you, probably an admin). When you run on IIS, you run under the application pool account. That's why it works from Visual Studio. Good for you for testing early and finding this out.

    The web site is generally the preferred route to go. You get bonus points for using a remote SQL Server (that's not SQL Express).

    Thursday, November 6, 2008 9:17 PM
  • User-1246852455 posted

    The connection strings are different. They were generated in the webconfig as:

    Web site: 

       <add name="XXEntities" connectionString="metadata=res://*;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=xx.xx.xx.xxx;Initial Catalog=XX;Integrated Security=True;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />

       Project:

     <add name="XXEntities" connectionString="metadata=res://*/Model.XX.csdl|res://*/Model.XX.ssdl|res://*/Model.XX.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=xx.xx.xx.xxx;Initial Catalog=XX;Integrated Security=True;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient"/>

    I use windows authentication on the database, not sql server authentication, and the anonymous user is setup in both.

    My IIS7 Anonymous user is setup and identical in both projects and hitting the same database.

    Everything's the same except that I created a web site on one and a web app on the other.

     

     

    Friday, November 7, 2008 1:15 AM
  • User-1246852455 posted

    I copied the website connection string to the project web config and republished the site and now it works.

    So the auto-generated connection string is bogus evidentally.

    What do you make of that?

    Nannette

     

    Friday, November 7, 2008 1:17 AM
  • User-1005219520 posted

    Not sure about the bogus auto-generated connection string - unless you regenerated it. Glad you got it works.

    Friday, November 7, 2008 2:58 AM
  • User-1246852455 posted

    Well, "getting it to work" isn't exactly true.

    Although I got my own personal project to work, the "Existing Web Site Entities" project still fails with the same error. I compared the connection strings and they are the same style as the one I used in my own project. I also double checked the anonymous user and settings on both the web site and the database.

        <add name="AddressBookEntities" connectionString="metadata=res://*;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=xx.xx.x.xxx;Initial Catalog=AddressBook;Integrated Security=True;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />

    Sigh.

     

    Friday, November 7, 2008 11:16 AM