I have two SQL Servers : one in Dijon, France; one in Arvada, Colorado, US. A data replication has been set up between them.
Everything works fine when users try to connect to SQL Server 2008 R2 Dijon database.
BUT an error occurs when one of my users is trying to connect to SQL Server 2012 US database from a VB.Net application.
The error is :
"A connection was successfully established with the server, but then an error occurred during the login process (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.)"
This error shows up only for one user. The others can connect without any issue. I have maybe a clue about this. We already encountered connection issues for him, because he belonged to many AD security groups.
Here is the connection string :
Data Source=server\instance;Initial Catalog=db;Integrated Security=SSPI;Connection Timeout=0;
We have the same issue for a US user trying to connect to the same server. But not when he tries to connect to Dijon. Do you have any clue that could help me resolving this issue please ?
I checked StackOverflow threads and other solutions from the web, but nothing helped me...
Refer following URLs
Troubleshooting: Connection Forcibly Closed
TCP Provider, error:
connection was forcibly closed
Follow these steps
First goto services and check whether 'SQL Server Browser' service is started, if not start the service.
Open SQL Server Configuration Manager
Goto Protocols for MSSQLSERVER
Enable all protocols
Goto SQL Native Client
Select Client Protocols and and Enable All
Restart the SQL Server services.
Use .. (.NET Framework Data Provider for SQL Server) as provider
Connectionstring
Data Source=server\instance;Initial Catalog=;Persist Security Info=True;User ID=;Password=;Network Library=dbmssocn
It was, as I expected, a problem of Kerberos authentication because my user has too many AD security groups...
The solution is explained here : Problems with Kerberos authentication when a user belongs to many groups and here MaxTokenSize and Windows 8 and Windows Server 2012
If the authorization data for a user attempting to authenticate is larger than the MaxTokenSize, then the authentication fails for that connection using that protocol.
On Windows 7 and Windows Server 2008R2 , the MaxTokenSize (the default buffer size for Kerberos) is 12k. Its size has been increased in Windows 8 and Windows Server 2012 to 48k. It wasn't enough for my case.
I had to add a key in the registry HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\Kerberos\Parameters\MaxTokenSize (REG_DWORD type to the decimal value 65535).
Then I rebooted the server.
My user can now access data without error.
Related
I have an app service with hybrid connection enabled(on a VM in the same network with the SQL Sever) for me to access on prem SQL Server, which I don't own. However, the connectivity has been pretty unstable.
I am able to access to the SQL Server probably for maybe 5% of the tries and mostly I just get error
One or more errors occurred. (A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.
I'm able to log in thru SSMS on the VM. Connection string should be alright since I can access locally(local network is the same network as the SQL Server).
Named instances use dynamic ports and UDP, which are not supported by Hybrid Connections. Suggest you using static port as Nick mentioned. Please refer to this document Connect to on-premises SQL Server from a web app in Azure App Service using Hybrid Connections to get more information.
provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.
What is your Windows version? When Windows versions that don't contain the leading zero fixes for TLS_DHE will display this error message. You can try to update windows version or disable the TLS_DHE ciphers to solve this issue. Please refer to this document.
I have a SQL Server database which I connect to from my VB.net client application.
Everything works fine in most of the systems. But in a few new VMs the client application is unable to connect to SQL Server and it throws the error mentioned below. The strange thing is that I can use the same credentials (SQL Server authentication) to connect through SQL Server Management Studio in the same system.
A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: Named Pipes Provider, error: 0 - No process is on the other end of the pipe.)
The sample connection string used is as below
Data Source=[server name];Initial Catalog=[db name];Persist Security Info=True;User ID=[username];Password=[pass]
I have checked similar answers and have already tried the following
Made sure SQL Server is accepting remote connections
Made sure TCP and Named Pipes are enabled in SQL Server
Started SQL Server Browser service
Tried specifying IP address instead of server name
By reading related articles, some of them point eventually to SSH, TLS1.1 and TLS1.2 issues. I also suspect firewall, but because I do not have admin rights to the system, I am not able to check the inbound and outbound rules.
Any suggestions would help.
At my 'wits end' here and looking for some help.
I have a Sever (Win Server 2016) running SQL Server 2016.
I have configure one client machine on the network to successfully access SQL Server using Ole DB Provider with connection string as:
Provider=SQLOLEDB.1;Password=secret;Persist Security Info=True;User ID=frustrated;Initial Catalog=companydb;Data Source=MySERVER\SQLEXPRESS
Everything is running 'swimmingly' on this client (Windows 7 Ultimate).
The problem is, when I install same code on the 2nd machine and attempt with same connection protocol, I get the following message back from SQL Server:
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.
What I have done/determined as far as troubleshooting...to no avail:
Computers one and two are both running Windows 7 Ultimate O/S
I lowered UAC to 'Never'.
Enable access to port 1433 specifically to the Server Firewall.
I disabled the Firewall completely on the Server to see if that was the issue.
Established an alternate SQL Server user and attached them to the target database
This is driving me crazy. Any help would be greatly appreciated.
Thanks,
Scott
I am upgrading my CRM from 2013 to 2015. I have an SQL instance on a separate server which I connect to from my CRM App server. I am getting the following error hen trying to connect to CRM app serer 'The report server cannot open a connection to the report server database. A connection to the database is required for all requests and processing. (rsReportServerDatabaseUnavailable) Get Online Help
A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: SSL Provider, error: 0 - The certificate chain was issued by an authority that is not trusted.)
I have tried fixes recommended when I search the web, this is what I tried.
I tried enabling TCP/IP and Named Pipes protocols.
I assigned permissions to the current logon user and server account(Network Service) running the Report Server Service
I assigned 'NT AUTHORITY\NETWORK SERVICE' as a user in Security --> Login and assigned RsExecRole.
I also tried restarting the SQL server with reporting serves installed on it, still no luck.
Please assist. My SQL Server version is 2014, Windows Server 2012r2, CRM Dynamics 2013, moving to 2015.
From error mentioned, it seems certificate is not from trusted authority. Below is the nearly same question asked previously
The certificate chain was issued by an authority that is not trusted
I have a SQL Server 2014 hosted on Windows server 2012.
I also have many windows services develop in c# that run on Windows Server 2012.
My services have different responsabilities... They then connect on different databases on the server mentionned above.
Sometimes, in a realy intermitent manner, one of the service gets the following SqlException... While they other are still working fine...
Message: The client was unable to establish a connection because of an error during connection initialization process before login. Possible causes include the following: the client tried to connect to an unsupported version of SQL Server; the server was too busy to accept new connections; or there was a resource limitation (insufficient memory or maximum allowed connections) on the server. (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.)
I googled for some troubleshooting info with no luck...
What appears to be strange, it that two service working on the same database on the same server but only one gets the error...