locked
Red X Authentication Error not accessing the database RRS feed

  • Question

  • I am getting an authentication error, and a red x is appearing where my data should be in my web applicatoin. It has worked fine in the past but I just upgraded to sql 2012 and now it is not working.  When I look at the log file is say is can't authenticate the user [Domain]\[Servername]$, when I look at the SQL log file for logon attempts it says it cannot find the user [Servername]$ It appears as if Lightswitch is not passing the correct user name.

    I have tried updating the user, and I can log in to SSMS using the user name. 

    Trace file 

    [Microsoft.LightSwitch.DataService][Application:Error][LightSwitchServiceApplication.Table] An exception has occurred: Microsoft.LightSwitch.DataServiceOperationException: The underlying provider failed on Open. ---> System.Data.EntityException: The underlying provider failed on Open. ---> System.Data.SqlClient.SqlException: Login failed for user 'Domain\Server$'.

    Saturday, March 2, 2013 12:51 AM

Answers

  • I ended up fixing it.

    Instead of using any windows authentication for my SQL login I changed everything to SQL logins including the publish data schema connection that allows me to create a SQL login. I have published at least 10 LightSwitch apps before this without the need to input the SQL login in all my connections so it was a little strange. But it works so I am not going to argue with it right now.

    • Marked as answer by Ave_ Tuesday, March 5, 2013 10:37 PM
    Tuesday, March 5, 2013 10:37 PM

All replies

  • Hi

    Follow the below tutorial. This will help you to solve the issue.

    Diagnosing Problems in a Deployed 3-Tier LightSwitch Application

    Regards


    Rashmi Ranjan Panigrahi
    www.lightswitchspecial.com

    If you found this post helpful, please “Vote as Helpful”. If it answered your question, please “Mark as Answer”.
    This will help other users to find their answer quickly.

    Saturday, March 2, 2013 7:26 AM
  • Have you republished the application, entering the new server's information in the Publish Wizard?

    Yann - LightSwitch Central - Click here for FREE Themes, Controls, Types and Commands
     
    Please click "Mark as Answer" if a reply answers your question. Please click "Vote as Helpful" , if you find a reply helpful.
     
    By doing this you'll help others to find answers faster.

    Monday, March 4, 2013 2:43 PM
    Moderator
  • Thanks,

    I have tried to republish, I even created another app to test that. It seems as if it is not passing the user name to sql. It works fine in debug mode.

    When I look at the intrinsic data string the user name and password are there.

    Monday, March 4, 2013 8:06 PM
  • Did you create the account you're trying to use on the new server?

    Yann - LightSwitch Central - Click here for FREE Themes, Controls, Types and Commands
     
    Please click "Mark as Answer" if a reply answers your question. Please click "Vote as Helpful" , if you find a reply helpful.
     
    By doing this you'll help others to find answers faster.

    Tuesday, March 5, 2013 3:48 AM
    Moderator
  • I did, I am trying to reinstall the lightswitch server configuration but it is telling me it is already installed.
    Tuesday, March 5, 2013 3:57 PM
  • Take a look at the web.config file and search for "connectionStrings" and make sure that these look correct.  If they don't look right, you can fix them up directly in the web.config file (to get your published app up and running at least).  Please try that first and if the wrong settings are getting written to that file, we can troubleshoot further.


    David Kidder | Senior SDET | Microsoft | LightSwitch

    Tuesday, March 5, 2013 7:39 PM
    Moderator
  • They look correct, I can even see the user name and password for the database.

    I have tested each of the connections strings and the all work.

    I am using windows authentication, and I can see and add users to the application but I cannot view any of the data for the application.

    I have created a test application and tried to run it as well and I am getting the same error.

    Tuesday, March 5, 2013 9:09 PM
  • I ended up fixing it.

    Instead of using any windows authentication for my SQL login I changed everything to SQL logins including the publish data schema connection that allows me to create a SQL login. I have published at least 10 LightSwitch apps before this without the need to input the SQL login in all my connections so it was a little strange. But it works so I am not going to argue with it right now.

    • Marked as answer by Ave_ Tuesday, March 5, 2013 10:37 PM
    Tuesday, March 5, 2013 10:37 PM
  • 1)  Are the SQL Credentials that you are supplying SQL Auth or are you using Windows Auth?

    2)  Is your app deployed to IIS or did you do a 2 tier deployment?  If it is an IIS deployment, have you created a custom Application Pool that is running with an Identity other than "ApplicationPoolIdenity"?  If that is the SQL Server on the same box and is the Identity set to "LocalSystem"?

    I have a SQL 2008 machine that has a DOMAIN\SERVERNAME$ login, although I don't know how it got there.  I have a cleaner, SQL 2012 installation that doesn't have such a login.  If you check your 2012 installation in SSMS, I am guessing you won't have the DOMAIN\SERVERNAME$ login and it was present on your previous SQL install.

    Can you try creating this machine account login on the new server "Add a computer account as a sql server login"

    If you create that login and give it the appropriate permission levels, that will hopefully get passed this particular problem, but we should also figure out how this situation arose in the first place.

    If none of what I said applies, can you please describe how your LS app is supposed to be configured to connect to the DB :-)


    David Kidder | Senior SDET | Microsoft | LightSwitch

    Tuesday, March 5, 2013 10:50 PM
    Moderator