MVC local dev The underlying provider failed on open - Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON' in Firefox only - sql-server

I've noticed a number of similar topics but none of them either solved the issue or had quite the same circumstances so I figured I'd post the issue and then answer it to help anybody else.
IE/Chrome had no issue but in Firefox when accessing pages of my mvc intranet project running locally to dev test those pages that access my sql database, I would get the error 'The underlying provider failed on Open' which with debugging it told me 'Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.
In most cases this seems to not be browser specific and was generally an issue with the connection string to the db, I had found a perfect question which listed most of the likely issues but can't find it now so if I do I'll link that.
As far as I could see my issue was to do with double hopping from my machine to iis then to the database and it lost my credentials in firefox at some point.

While most solutions to this indicated that you needed to set or add Integrated Security=True; to the connection string among other possible solutions.
I first found that if I set impersonate to true and passed in my own domain username and password that it fixed it but this was a bad solution as it required me to store my details.
The actual solution which solved this particular problem with least possible issues was to set impersonate to false and bam no further issues.

This is a database connection problem, not a browser problem, check that the sql service is opened, check also if your connection string is valid, you can post your code.

Related

Azure SQL Server Connection Error Despite Correct Credentials - Error Number:18456,State:1,Class:14

I have created a new SQL Database on Azure, and have copied the connection string directly from the Azure Portal.
On my .NET application, when I am trying to run 'Update-Database' command in Package Manager Console to commit the migration, I receive the following error:
Error Number:18456,State:1,Class:14 Login failed for user
'benhayward'.
Extra Information:
- I have changed my database admin password.
- I have confirmed that the log-in credentials are correct.
- I am on the Azure free trial.
Any advice or assistance on this would be greatly appreciated.
Ok a slightly embarrassing solution, but the reason this wasn't working is because of the curly brackets surrounding the password, as LeonYue suggested.
I had the same issue. The problem was that I had two entirelly different connection strings with the same name in different config files. The right one in app settings was being overwritten by another connection string in my user secrets. As soon as I deleted connection string from my secrets, everything went fine without any errors. Hope my solution will help the others

SqlException (0x80131904): Login failed for user 'DOMAIN\username'

I have created an intranet site that is running fine locally but when running with IIS I am getting a SqlException (0x80131904): Login failed for user 'DOMAIN\username' message. Not sure if it matters or not but I am remotely connecting the server from a different location.
I was hesitant to post as I am quite new to programming and feared looking silly but I have searched for days and days looking for a way to fix this. I have checked Windows authentication over and over as well as windows authorization.
Note: When logging in for windows authentication, If I enter the incorrect user details, the window appears again, if user details correct I can access the site. I can then navigate my way around the site until a point required to access the database. Looking forward to a resolution. Currently pulling my hair out.
Can supply code if requried

Wordpress website db connection error

I came over this serious problem.
My WordPress website was running all right. suddenly It showed the page of WordPress installation. so, I quickly registered a user and so on. Then it showed "db connection error". I went to my server and tried to log into my phpmyadmin but the password didn't work. This kept happening for 5 mins. then thing worked normal again.
1- is this a hacker attack?
2- how do I prevent the page of WP installation from showing up if the db connection goes down again? because this is a desaster
how do I prevent wp-admin from showing the name of my db in the db connection error ? Better preventing any error report from my website when anything is down?
thanks
Nobody can tell you whether it was hacker related without a lot more information. There should be logs on the machine hosting your site--I would check them first to see if you can tell if the database went down and why. If you don't admin your own site you can ask your hosting provider what the problem was--they may have been rebooting a database machine, for example.
I would also do a full backup of your site and database in case there is any hardware trouble you don't know about.
In the meantime, if you administer the site yourself, take a look at advice for hardening Wordpress: http://codex.wordpress.org/Hardening_WordPress

Login failed for user 'sa' while trying to create datasource with Railo

So I'm trying to setup Railo and I want to add a datasource.
For the database I'm using Microsoft SQL server Management Studio.
But now I've run into the classical problem: "Login failed for user 'sa'. ClientConnectionId:afd80ac2-0744-4a7d-a9f7-083d93adee0d"
What I've done so far:
With the SQL Server Configuration Manager in the TCP/IP settings I enabled the IPs I had to.
I set the password for the user 'sa' in MSSQL and I added a user mapping for the table I want to use.
I made the user 'sa' the owner of the DB i want to connect to
Restarted the SQL service, my computer and Railo multiple times.
I'm pretty much out of ideas.
After Leigh mentioned in the comments to look at my logs it had the following message: "Login failed for user 'max'. Reason: Failed to open the explicitly specified database 'test'. [CLIENT: 127.0.0.1]"
I then tried to make a connection without mentioning a database and that worked.
I would also point to Leigh's answer here which explains how to turn Mixed-Mode authentication on, as this can also cause this error. Since the cause of this isn't on Railo/Lucee's end, this issue still arises in 2018.
I just don't want a useful answer to get lost to history, nor plagiarize an answer I barely found.

SSRS scheduled reports not working

My scheduled reports in SQL server won't run. I checked the logs and found the job that was failing. The error message in the log was:
'EXECUTE AS LOGIN' failed for the requested login 'NT AUTHORITY\NETWORK
SERVICE'. The step failed.
I'm using SQL authentication for the report so it shouldn't be issues with the permissions to the data. No sheduled reports on the server will run.
I found the answer here:
http://www.themssforum.com/SVCS/Unable-execute/
Apperently there was something wrong with the login for 'NT AUTHORITY\NETWORK SERVICE' and it wouldn't run the jobs it owned properly. Anyone understand why this might have happened?
Can you check the permissions for your Network Service account? Specifically make sure they have the "Act as part of the OS" permission. If I'm reading the error message correctly, it looks like the NT AUTHORITY\NETWORK SERVICE account failed to execute as a logged on user. It doesn't look like it ever got to the query, looks like it's failing in the Windows authentication portion, so never gets to the SQL authentication piece.
You might also check the Security Event Log in Windows. If it is an authentication problem, there might be additional information logged by the OS.
Can you hit the Web Service page (ReportService2005.asmx) for SRS with a web browser? If not, it might point to the SRS service, if you can, it might point to the scheduler service.
I seem to remeber having a similar problem a long time ago, the problem was related to accessing the smtp server to despatch the reports and was resolved by applying a patch to the server.
I'd guess you are running a non-english operating system.
Somehow, for whatever reasons, the login name for the network service is sometimes localized when the OS is translated into other languages.
Now a lot of programs expect the login name to be hard coded to "NT AUTHORITY\NETWORK SERVICE" - in a German version of Windows for example the name of the account is "NT-AUTORITÄT\NETZWERKDIENST". So your program is looking for the english name, can't find it, and shows an error.
Even some Microsoft programs run into this trap and show errors like this when installed!
Just to troubleshoot, can you use a domain account rather than the builtin NetworkService account to run your service?
I also found this post that describes the same error you reported:
Maybe that solution will work for you.

Resources