Connecting to SQL from Bamboo still throws error Login failed for user - sql-server

I am attempting to connect my Bamboo instance to SQL Server, but I am unable to do so because of the error Login failed for user 'Bamboo'. Investigation into the log files shown in the location
C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\Log\ERRORLOG
throws an error that I should not be getting at this stage of my attempted login. Server is configured for Windows authentication only. Currently able to login using same SQL Server credentials to access the database, just not via Bamboo.
The reason why this should not happen is because my server is already set up to do so, and I will list all of the steps that I have taken to prevent this error. In my localhost SQLEXPRESS server I have checked SQL Server and Windows Authentication mode. Once I restarted SQL Server, this worked as I was able to log in with the credentials that I added to a user called Bamboo.
The user I added is mapped to the database called BambooDatabase as a db_owner. The number of concurrent users is unlimited and I have tried disconnecting from SQL Server just to check if that was a problem, but still no difference. I added 2 more users with connect access and mapped to BambooDatabase.
I have went to the SQL Sever Configuration Manager and enabled TCP/IP and made sure that the IP addresses was pointing to 1433. And then configured my firewall to all access to 1433 as well. The fact that my error logs for SQL Server are appearing makes this seem that everything should be fine here. So with tested 3 users on SQL credentials everyone logged in successfully and all have the relevant permissions needed. All three gave the same error when trying to connect from Bamboo.
I am trying to connect to Bamboo like this:
Direct JDBC connection.
Driver class name: net.source.jtds.jdbc.Driver
Database URL: jdbc:jtds:sqlserver://localhost:1433;DatabaseName=BambooDatabase
User name: Bamboo
Password: SQL Server password
Checked overwrite existing data
Then once I click continue the log in error throws. Have I missed something here, I cannot see what I could do differently, I have tried to connect to SQL Server from Bamboo several different ways but have had no success. I am using SQL Server Express and the Bamboo version 5.11.3, I am testing upgrading from 5.11.3 to 5.15 with larges amounts of data which is why I am using that version.
Error from Bamboo is:
Error accessing database: java.sql.SQLException: Login failed for user 'Bamboo'.
Error from SQL logs is:
Login failed for user 'Bamboo' Reason: An attempt to login using SQL authentication failed. Server is configured for Windows authentication only. [CLIENT: 127.0.0.1]

Are you running Bamboo en SQLExpress on the same machine? If not, you should look into the remote access configuration.
In the SQL Sever Configuration Manager, make sure that you entered 1433 for the IPAll entry as well. And start the SQL Browser service for good measure, this is especially important when using a names instance, but going after the errorlog folder you copy/pasted, that's not the case.
For testing purposes, you might want to disable the firewall all together and reactivate is after you get the connection up.
Another thing to try if you're connecting on the same machine, is use the loopback address 127.0.0.1 instead of the localhost alias.

Related

Named Pipes Provider error 40 connecting to localhost SQL Server (not a common resolution)

I am attempting to create the reporting services database for usage in SCCM. The reporting services installed fine (install only), but once I get to the Database tab and try to connect to the database server to create the database, it fails by timing out when trying to connect (see dialog). I am using Authentication Type: Current User - Integrated Security (domain user account loaded with permissions on that server - used by several other SQL apps).
Full text of error message:
Could not connect to server: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes provider, error: 50 - Could not open a connection to the SQL Server)
We are using two named instances, so the ports are dynamic. I have made sure all ports are active (netstat).
I also made sure of the following:
All SQL services are running and have been restarted several times
Firewall is disabled (all profiles) - shouldn't matter, because we are running setup locally
Remote connections are enabled in SSMS (again, shouldn't matter)
Named pipes is enabled (as are TCP/IP and Shared Memory); also re-ordered protocols while testing
Tried service accounts using virtual service account, local system, network service and known-good domain SQL service account
Varied Server Name by using machine name, FQDN, local IP, loopback (127.0.0.1) and LOCALHOST
I can ping the server and access IPC$ (as you would expect on the localhost)
I am inside of the SQL Server 2016 Reporting Services Configuration Manager and logged into the SQL Server on the correct instance and the Report Server is showing as Started. I can also user the Web Service URL (although it obviously gives me a DB error).
I have checked the Application Event log and SQL/Reporting Server logs without any hints of the problem.
What could be causing this issue? I have spent hours troubleshooting something that should be so easy.
I didn't realize that the Server name field when creating the database still requires the instance name even though the installation already had that embedded. It was just a matter of clicking that field and accepting the server\instance dropdown. I had the biggest face palm in a very long time.

SQL Server Domain Authentication over VPN

I have a user with SSMS installed locally who wants to be able to access the SQL Db on a remote server over SonicWall SSL VPN.
He can connect to the VPN just fine, RDP to SQL server (as a test) just fine, but cannot connect with SSMS to the server.
So far I've tried:
Enabling Trust for the connection as it was at first presenting an SSL error. Now we just get "login failed for user" errors.
Tested his user with Windows Authentication on the server directly, it works fine.
Enabling names pipes and TCP/IP in server configuration manager.
Testing logging in with a SQL authentication user over VPN - This also works fine.
I am sure the domain\username and password are correct and verified them in several other ways.
Checked the SQL server properties and Allow remote connections is enabled with no timeout.
Opened up everything in the sonicwall from the SSLVPN to the SQL server as a test, changed nothing.
Attempted disabling the local and SQL windows firewall, changed nothing.
Probably some other stuff, but I don't remember right now.
This is SQL Server 2014. He is using SSMS 2017, but I've tried it on the SQL Server with 2017 and it works fine and as mentioned he can log in over VPN with a direct SQL Server user. All other users just RDP to SQL server and connect that way so this has never come up again, but they don't want the new employee having RDP access to the SQL Server.
The exact settings on his SSMS I'm using are Active Directory - Password and under connection properties encrypt connect and trust server certificate are checked.
No special or changed ports on SQL Server, everything is basic installation defaults.
In this example, I'm editing the NT Service\MSSQLSERVER user.
However, when you edit the user/s in question and navigate to User Mapping as can be seen below:
Is the Database they are allowed to access selected?
Also, while the Database is selected, did you tick the permissions to the Database, as stipulated above?
If not, please try this and advise if it worked?

Login Failed on SQL Server 2014

I'm having issues connecting to a SQL Server 2014 database using Management Studio with SQL Authentication. This server was just created by my IT department. I restored a database, I added the login with a password, I made sure the server properties had both SQL Authentication and Windows Authentication checked. I made sure the user at the database level is mapped to the login. But when I try to connect using Management Studio I get the following error. However, it works if I use my Windows Authentication account.
Actually, I kept getting the normal 'Login Failed' message. But this morning I got the above error which is probably more helpful. When I kept trying again, I kept getting the normal Login Failed message.
Have you seen this Microsoft TechNet post about the message you received? It looks like your admin may need to adjust the SQL Server configuration.
Specifically, it looks like you might need to try one of:
Connect using TCP/IP, or use the SQL Server Configuration Manager to
enable remote connections using named pipes.
or...
Using SQL Server Configuration Manager on the client computer, move
TCP before named pipes in the protocol order list.

Cannot log in using SQL authentication ONLY from a remote server

I am trying to connect to SQL Server 2008 from a remote server using 'sa' username and its password (I can log in normally with this username and password from my own computer - so "SQL Server and Windows authentication mode" is chosen).
In the SQL Server log file on my computer I see this error:
Login failed for user 'sa'. Reason: An attempt to login using SQL
authentication failed. Server is configured for Windows authentication
only.
I thought it might be a remote connection problem, so I checked that the remote connection in the properties is enabled, in the configuration manager I enabled TCP/IP and Shared Pipes and restarted the service afterwards and I created a firewall rule for port 1433. I also tried to turn off the firewall in case that it is being blocked somehow, but I got the same error.
How this error appears only when accessing SQL Server from a remote server?
How can I fix it?
From the SQL Server management studio, right click on your server (after connect) in the Object Explorer window and choose Properties.
On Security item, make sure that SQL Server And Windows Authentication mode is selected.
The most obvious solution for me seems to allow SQL Server authentication on the server if it's really necessary to use sa for access (what it should not normally).
To answer the "why" we need more information. Which program do you use to access the server. Is the connection string really identical for both accesses?
Just guessing: From your local machine you use integrated security=true somehow (which causes user and password to be ignored), and your local windows user is allowed to access the server. From remote you use integrated security=false so that you can't logon using user/password, as the server is configured to only accept Windows authentication.
I had the exact same problem today. I was not able to connect to SQL server remotely using username/password, but it worked with windows authentication, and logging in locally also worked.
The reason it didn't work here was that I was using a password that was too short on the sa user. Apparently it does enforce password policy if logging on locally, but remote connections are blocked.
You can either change the password to a longer/more complex one, or disable the password policy enforcement for the sa user.
Short how-to:
In SQL Server Management Studio, open Security -> Logins, find "sa" -> Properties -> Change password or uncheck this box:
In my situation, I have SQL Server 2008 and SQL Server 2012 installed. So, in server name field, I need a concrete name (for example: 10.141.133.125\SQLServer2012). That's it!
Hope this useful for you!

Connect to SQL Server database

I'm trying to connect to a SQL Server database at Discount asp.net hosting with SQL Server Management Studio. Here`s the connection string that is working fine. What parts of it should I use in Management Studio to connect to remote Db?
Data Source=tcp:sql2k803.discountasp.net;Initial Catalog=SQL2008_709539;
User ID=SQL2008_709539_user;Password=password;
I'm filling the fields in the following way:
Server name: tcp:sql2k803.discountasp.net
login: SQL2008_709539_user
password: password
authentication type is SQL Server.
If it returns "Login failed" then you are getting to SQL Server but SQL Server is rejecting you (so it won't involve firewall, DNS, etc). Did you try explicitly setting the database information in the Connection dialog in SSMS? You may have to follow up with the host and ask them what state was found in the SQL Server log to go along with your failed attempt to log in. This is often because the database wasn't specified or the wrong database was specified.
Here is a list of all the states I've observed and what they probably mean, if your host won't directly tell you what to fix but they do tell you what state was found in SQL Server's log:
Troubleshooting Error 18456
Database: SQL2008_709539
Login: SQL2008_709539_user
Password: password
Host: sql2k803.discountasp.net
Please note also:
Some hosting companies denies access by default so you may have to request access from your IP address
Sometime I was unable to connect using host name, I used IP address to connect via Management Studio (such problem appear due firewall, proxy, etc)
ADDED:
Also see whether you've enabled remote tcp/ip connections
If it's working fine, use tcp:sql2k803.discountasp.net as server address, and user / pass as login data

Resources