I am getting following error when i am trying to connect Production DB from Local Environment.
I was able to connect Production DB before, but suddenly i am getting following error, any idea?
A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 0 — The handle is invalid.)
I was trying to run asp.net website in local PC, which has connection string of Production DB, following is stack trace for error I am getting in local environment.
> at MyWebsiteDAL.clsForumQuestion.SelectAll(Int32 CurrentPageIndex, Int32 PageSize) in D:EDriveMy WebSitesMyWebsiteMyWebsiteMyWebsiteDALclsForumQuestion.cs:line 821
at CodeConnect.Default.Page_Load(Object sender, EventArgs e) in D:EDriveMy WebSitesMyWebsiteMyWebsiteMyWebsiteDefault.aspx.cs:line 100
at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Any idea what might have gone wrong here?
Describe the bug
After I update the Microsoft.Data.SqlClient from 3.0.1 to 4.0.1 when I try to access the database I’m getting
Exception message:
Stack trace:
Microsoft.Data.SqlClient.SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 35 - An internal exception was caught)
---> System.Security.Authentication.AuthenticationException: The remote certificate was rejected by the provided RemoteCertificateValidationCallback.
at System.Net.Security.SslStream.SendAuthResetSignal(ProtocolToken message, ExceptionDispatchInfo exception)
at System.Net.Security.SslStream.CompleteHandshake(SslAuthenticationOptions sslAuthenticationOptions)
at System.Net.Security.SslStream.ForceAuthenticationAsync[TIOAdapter](TIOAdapter adapter, Boolean receiveFirst, Byte[] reAuthenticationData, Boolean isApm)
at System.Net.Security.SslStream.AuthenticateAsClient(SslClientAuthenticationOptions sslClientAuthenticationOptions)
at System.Net.Security.SslStream.AuthenticateAsClient(String targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, Boolean checkCertificateRevocation)
at Microsoft.Data.SqlClient.SNI.SNITCPHandle.EnableSsl(UInt32 options)
at Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
at Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
at Microsoft.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
at Microsoft.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
at Microsoft.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
at Microsoft.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry, SqlConnectionOverrides overrides)
at Microsoft.Data.SqlClient.SqlConnection.Open(SqlConnectionOverrides overrides)
at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerConnection.OpenDbConnection(Boolean errorsExpected)
at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenInternal(Boolean errorsExpected)
at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.Open(Boolean errorsExpected)
at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerDatabaseCreator.<>c__DisplayClass18_0.<Exists>b__0(DateTime giveUp)
at Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions.<>c__DisplayClass12_0`2.<Execute>b__0(DbContext c, TState s)
at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
at Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions.Execute[TState,TResult](IExecutionStrategy strategy, TState state, Func`2 operation, Func`2 verifySucceeded)
at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerDatabaseCreator.Exists(Boolean retryOnNotExists)
at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerDatabaseCreator.Exists()
at Microsoft.EntityFrameworkCore.Migrations.HistoryRepository.Exists()
at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration)
at Microsoft.EntityFrameworkCore.Design.Internal.MigrationsOperations.UpdateDatabase(String targetMigration, String connectionString, String contextType)
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.UpdateDatabaseImpl(String targetMigration, String connectionString, String contextType)
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.UpdateDatabase.<>c__DisplayClass0_0.<.ctor>b__0()
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action)
ClientConnectionId:51a7429a-eee3-4ee4-802e-be6c50c1129b
Error Number:-2146893019,State:0,Class:20
Expected behavior
Connect to database
Further technical details
Microsoft.Data.SqlClient version: 4.0.1
.NET target: .NET 6.0 on MacOS
SQL Server version: Microsoft SQL Server 2019 (RTM-CU14) (KB5007182) — 15.0.4188.2 (X64) Developer Edition (64-bit) on Linux (Ubuntu 20.04.3 LTS)
Operating system: Docker Linux
Additional context
I’m running EF Core 6.0.1 migrations
When you try to connect to a SQL Server database from a client application, under certain circumstances, you might get the below error message: A connection was successfully established with the server, but then an error occurred during the login process. (provider: Named Pipes Provider, error: 0 – No process is on the other end of the pipe.)
If you get this error message, don’t worry. It is quite descriptive and even more, the solution to this issue is quite simple.
Read on, in order to learn how you can resolve the issue.
How to Resolve the Issue
There are 2 things you can try in order to overcome this problem. Therefore, there are two checks you need to perform, in order to take corrective actions.
Strengthen your SQL Server Administration Skills – Enroll to our Online Course!
Check our online course on Udemy titled “Essential SQL Server Administration Tips”
(special limited-time discount included in link).Via the course, you will learn essential hands-on SQL Server Administration tips on SQL Server maintenance, security, performance, integration, error handling and more. Many live demonstrations and downloadable resources included!
(Lifetime Access/ Live Demos / Downloadable Resources and more!) Enroll from $14.99
First Check:
The first check involves ensuring that the maximum number of concurrent connections is set to 0. In order to check this, in SQL Server Management Studio (SSMS), right-click on instance, connections and check the value for the maximum number of concurrent connections option. If it is set to 0, it means unlimited.
Second Check:
The second check, involves ensuring that in your connection string, in the client application, along with the rest of the settings, the database name is correct:
string connString="Server=[SERVER_NAME]; Database=[DATABASE_NAME]; User ID = [USER_NAME]; Password=[PASSWORD]";
For example, in the case where you specified a database that does not exist, even though the connection to the SQL Server instance will be established, the provider will not be able to find the database thus resulting to the above error message.
I hope you found this tip useful and you managed to resolve the issue.
Featured Online Courses:
- SQL Server 2022: What’s New – New and Enhanced Features [New]
- Data Management for Beginners – Main Principles
- Introduction to Azure Database for MySQL
- Working with Python on Windows and SQL Server Databases
- Boost SQL Server Database Performance with In-Memory OLTP
- Introduction to Azure SQL Database for Beginners
- Essential SQL Server Administration Tips
- SQL Server Fundamentals – SQL Database for Beginners
- Essential SQL Server Development Tips for SQL Developers
- Introduction to Computer Programming for Beginners
- .NET Programming for Beginners – Windows Forms with C#
- SQL Server 2019: What’s New – New and Enhanced Features
- Entity Framework: Getting Started – Complete Beginners Guide
- A Guide on How to Start and Monetize a Successful Blog
- Data Management for Beginners – Main Principles
Troubleshooting: A connection was successfully established with the server, but then an error occurred during the login process.
Click to Tweet
Artemakis Artemiou is a Senior SQL Server Architect, Author, a 9 Times Microsoft Data Platform MVP (2009-2018). He has over 20 years of experience in the IT industry in various roles. Artemakis is the founder of SQLNetHub and {essentialDevTips.com}. Artemakis is the creator of the well-known software tools Snippets Generator and DBA Security Advisor. Also, he is the author of many eBooks on SQL Server. Artemakis currently serves as the President of the Cyprus .NET User Group (CDNUG) and the International .NET Association Country Leader for Cyprus (INETA). Moreover, Artemakis teaches on Udemy, you can check his courses here.
Views: 11,612
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept All”, you consent to the use of ALL the cookies. However, you may visit «Cookie Settings» to provide a controlled consent. Read More
Hi Ron,
This appears to be Network configuration related issue. I suggest you to check the following things:
1. Make sure your database engine is configured to accept remote connections
• Start > All Programs > SQL Server 2005 > Configuration Tools > SQL Server Surface Area Configuration
• Click on Surface Area Configuration for Services and Connections
• Select the instance that is having a problem > Database Engine > Remote Connections
• Enable local and remote connections
• Restart instance
2. Check the SQL Server service account
• If you are not using a domain account as a service account (for example if you are using NETWORK SERVICE), you may want to switch this first before proceeding
3. If you are using a named SQL Server instance, make sure you are using that instance name in your connection strings in your ASweb P.NET application
• Usually the format needed to specify the database server is machinenameinstancename
• Check your connection string as well
<connectionStrings>
<add name=»SampleConnectionString» connectionString=»Data Source=machinenameinstancename;Initial Catalog=AdventureWorks;Integrated Security=SSPI;Min Pool Size=5;Max Pool Size=60;Connect
Timeout=30″ providerName=»System.Data.SqlClient»/>
</connectionStrings>
4. You may need to create an exception on the firewall for the SQL Server instance and port you are using
• Start > Run > Firewall.cpl
• Click on exceptions tab
• Add the sqlservr.exe (typically located in C:Program Files (x86)Microsoft SQL ServerMSSQL.xMSSQLBinn, check your installs for the actual folder path), and port (default is 1433)
• Check your connection string as well
5. If you are using a named SQL Server instance, make sure you are using that instance name in your connection strings
6. Check SQLBrowser; check that it is running. You may also need to create an exception in your firewall
for SQLBrowser.
7. Check that you have connectivity to the SQL Server.
Note what you are using to connect: machine name, domain name or IP address? Use this when checking connectivity. For example if you are using myserver
• Start > Run > cmd
•netstat -ano| findstr 1433
•telnet myserver 1433
•ping -a myserver
Check what ports are IP addresses are being returned.
Regards,
Basit A. Farooq (MSC Computing, MCITP SQL Server 2005 & 2008, MCDBA SQL Server 2000)
http://basitaalishan.com
Please remember to click «Mark as Answer» on the post that helps you, and to click
«Unmark as Answer» if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
-
Proposed as answer by
Tuesday, December 18, 2012 3:37 PM
-
Marked as answer by
Allen Li — MSFT
Tuesday, December 25, 2012 1:33 AM
- Remove From My Forums
-
Question
-
Today I could not log into my local SQL Server 2012 instance with the following error message
A connection was successfully established with the server, but then an error occurred during the pre-login handshake.
provider: SSL Provider, error: 0 — An internal error occurred. (Microsoft SQL Server, Error: -2146893792)
I found many similar questions here and on the forums, but nothing helped. Please notice that in my case it just says
0 - An internal error occurred
- There are no errors in Event Viewer;
- I don’t use Encrypted Connections;
-
In SQL Server Configuration Manager,
Force
is set to
Protocol EntryptionFalse
,Trust
is set to
Server CertificateYes
(Originally
it wasNo
,
but in both cases it didn’t work); - I CAN connect to SQL Server using UDL;
- I tried to re-install SQL Server with all related components;
- Tried to uninstall .NET 4.5;
- In SQL Management Studio, in connection properties, Encrypt Connection is unchecked.
It worked fine yesterday, I have not installed any software since then.
Any ideas?
Thank you!
Содержание
- ИТ База знаний
- Полезно
- Навигация
- Серверные решения
- Телефония
- Корпоративные сети
- Фиксируем проблему SQL Error 233
- Бесплатный вводный урок на онлайн курс по Linux
- Включить TCP/IP стек
- Named Pipes
- Полезно?
- Почему?
- Sql server connection successfully established error 233
- Answered by:
- Question
- Answers
- All replies
- Sql server connection successfully established error 233
- Answered by:
- Question
- Answers
- All replies
ИТ База знаний
Курс по Asterisk
Полезно
— Узнать IP — адрес компьютера в интернете
— Онлайн генератор устойчивых паролей
— Онлайн калькулятор подсетей
— Калькулятор инсталляции IP — АТС Asterisk
— Руководство администратора FreePBX на русском языке
— Руководство администратора Cisco UCM/CME на русском языке
— Руководство администратора по Linux/Unix
Навигация
Серверные решения
Телефония
FreePBX и Asterisk
Настройка программных телефонов
Корпоративные сети
Протоколы и стандарты
Фиксируем проблему SQL Error 233
Порой при попытке подключения к БД в режиме SQL аутентификации, вы можете получить следующую ошибку:
Бесплатный вводный урок на онлайн курс по Linux
Мы собрали концентрат самых востребованных знаний, которые позволят начать карьеру администраторов Linux, расширить текущие знания и сделать уверенный шаг в DevOps
У нас есть пару способов, которые могут помочь в решение этой проблемы.
Включить TCP/IP стек
По умолчанию, SQL сервер использует порт 1433, которые использует в качестве транспорта TCP. Нам нужно включить TCP/IP в настройках Configuration Manager:
- Подключитесь к SQL серверу;
- Откройте SQL Server Configuration Manager. Перейдите в настройку SQL Server Network Configuration → Protocols for %название%;
- Проверяем, чтобы TCP/IP был включен (Enabled). Если выключен, то дважды левой кнопкой мыши нажмите на опцию и выберите Enabled = Yes;
После указанного вида работ службу (сервис) SQL необходимо перезагрузить.
Named Pipes
Так называемый Named Pipes (именованный канал) обеспечивает взаимодействие между процессами на одной машине, без снижения производительности. Эту опцию нужно включить, если вы столкнулись с 233 ошибкой:
- Подключитесь к SQL серверу;
- Откройте SQL Server Configuration Manager. Перейдите в настройку SQL Server Network Configuration → Protocols for %название%;
- Проверяем, чтобы Named Pipes был включен (Enabled). Если выключен, то дважды левой кнопкой мыши нажмите на опцию и выберите Enabled = Yes;
Данная опция соседствует с параметром TCP/IP, который мы включали ранее (см. скриншот выше).
Гре***ый фаеравол!
На самом деле, фаервол это хорошо. Он защищает от атак наши системы. Но порой, из – за него у нас не работают нужные компоненты, и, в том числе, появляется ошибка 233.
Добавим 1433 порт в исключения. Для этого:
- Запустить службу WF.msc (открыв меню Пуск и набрав в поиске);
- В настройка Windows Firewall with Advanced Security, слева, нажмите на Inbound Rules, после чего нажмите на New Rule в открывшемся меню справа;
- В Rule Type выбираем Port, нажимаем Next;
- В разделе Protocol and Ports, укажите TCP. В пункте Specific local ports указываем 1433. Нажмите Next;
- В разделе Action (действия, что делать?), выбираем Allow the connection, и нажимаем Next;
- В разделе Profile применяем политику для всех видов (Domain, Private, Public). Важно! — настройка данного пункта зависит от ваших корпоративных политик безопасности и мы не рекомендуем открывать Public;
- В финальном окне даем имя нашему правилу, например, Allow inbound SQL;
Проверяем удаленные подключения
Важно не забыть разрешить удаленные подключения к серверу. Сделать это не трудно:
- Открываем SQL Server Management Studio и подключаемся (доменная или SQL аутентификация);
- Выбираем сервер (верхняя сущность в иерархии слева, в меню), нажимаем на него правой кнопкой мыши и выбираем пункт Properties;
- В открывшемся окне нажимаем на Connections. В меню настройки нажимаем на чекбокс Allow remote connections to this server;
- Нажимаем OK;
Перезагружаем сервис SQL, проверяем, пропала ли ошибка? 🙂
Вместе и с нуля пройдем все этапы проектирования, администрирования, резервирования и масштабирования БД с использованием PostgreSQL, MS SQL и MySQL
Полезно?
Почему?
😪 Мы тщательно прорабатываем каждый фидбек и отвечаем по итогам анализа. Напишите, пожалуйста, как мы сможем улучшить эту статью.
😍 Полезные IT – статьи от экспертов раз в неделю у вас в почте. Укажите свою дату рождения и мы не забудем поздравить вас.
Источник
Sql server connection successfully established error 233
This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.
Answered by:
Question
While connecting the SQL server 2012 from server itself using SSMS with remote connection getting following error.
«A connection was successfully established with the server, but then an error occurred during the login process.
(provider: SSL Provider, error: 0 — No process is on the other end of the pipe.)
(Microsoft SQL Server, Error: 233)»
1. Named pipe and TCP/IP are enabled . Checked by SS Configuration Manager.
2. Browser service is running.
So Please advice a solution in this regard.
Answers
Your case is not clear to me. Is this remote connection or local connection.
from server itself = locally
SSMS with remote connection = remote
>> A connection was successfully established with the server, but then an error occurred during the login process.
First, you might want to look at the error log file created by SQL Server. A connection was successfully established, which mean that the real error will be logged in the SQL Server error log file. It should give us more information.
In the error log file you might find specific errors like
>> Ensure that mixed mode auth enabled
* If this did not solve your case, then please post the error log file information (attach it as text file since it might be too long to post in the content)
Ronen Ariely [Personal Site] [Blog] [Facebook] [Linkedin] |
- Edited by pituach MVP Friday, May 27, 2016 1:19 PM
- Marked as answer by Naseer CV Saturday, May 28, 2016 11:03 AM
Your case is not clear to me. Is this remote connection or local connection.
from server itself = locally
SSMS with remote connection = remote
>> A connection was successfully established with the server, but then an error occurred during the login process.
First, you might want to look at the error log file created by SQL Server. A connection was successfully established, which mean that the real error will be logged in the SQL Server error log file. It should give us more information.
In the error log file you might find specific errors like
>> Ensure that mixed mode auth enabled
* If this did not solve your case, then please post the error log file information (attach it as text file since it might be too long to post in the content)
Ronen Ariely [Personal Site] [Blog] [Facebook] [Linkedin] |
- Edited by pituach MVP Friday, May 27, 2016 1:19 PM
- Marked as answer by Naseer CV Saturday, May 28, 2016 11:03 AM
Did you restart the SQL Server Services ?
Make sure you have enabled the following protocols on that instance: Shared Memory, Named pipes, TCP/IP.
Change the authentication mode to Mixed mode if you are using a SQL login to get connected to the SQL Server instance.
Examine SQL Server Error Log as mentioned by Ronen and share any errors found with us.
Hope this helps.
Dear Ronen Ariely , Thanks a lot for the reply.
Please find the error log.
2016-05-27 16:11:36.63 spid51 Configuration option ‘show advanced options’ changed from 1 to 0. Run the RECONFIGURE statement to install.
2016-05-27 16:11:37.21 Logon Error: 17809, Severity: 20, State: 1.
2016-05-27 16:11:37.21 Logon Could not connect because the maximum number of ‘1’ user connections has already been reached. The system administrator can use sp_configure to increase the maximum value. The connection has been closed. [CLIENT: ]
Источник
Sql server connection successfully established error 233
This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.
Answered by:
Question
While connecting the SQL server 2012 from server itself using SSMS with remote connection getting following error.
«A connection was successfully established with the server, but then an error occurred during the login process.
(provider: SSL Provider, error: 0 — No process is on the other end of the pipe.)
(Microsoft SQL Server, Error: 233)»
1. Named pipe and TCP/IP are enabled . Checked by SS Configuration Manager.
2. Browser service is running.
So Please advice a solution in this regard.
Answers
Your case is not clear to me. Is this remote connection or local connection.
from server itself = locally
SSMS with remote connection = remote
>> A connection was successfully established with the server, but then an error occurred during the login process.
First, you might want to look at the error log file created by SQL Server. A connection was successfully established, which mean that the real error will be logged in the SQL Server error log file. It should give us more information.
In the error log file you might find specific errors like
>> Ensure that mixed mode auth enabled
* If this did not solve your case, then please post the error log file information (attach it as text file since it might be too long to post in the content)
Ronen Ariely [Personal Site] [Blog] [Facebook] [Linkedin] |
- Edited by pituach MVP Friday, May 27, 2016 1:19 PM
- Marked as answer by Naseer CV Saturday, May 28, 2016 11:03 AM
Your case is not clear to me. Is this remote connection or local connection.
from server itself = locally
SSMS with remote connection = remote
>> A connection was successfully established with the server, but then an error occurred during the login process.
First, you might want to look at the error log file created by SQL Server. A connection was successfully established, which mean that the real error will be logged in the SQL Server error log file. It should give us more information.
In the error log file you might find specific errors like
>> Ensure that mixed mode auth enabled
* If this did not solve your case, then please post the error log file information (attach it as text file since it might be too long to post in the content)
Ronen Ariely [Personal Site] [Blog] [Facebook] [Linkedin] |
- Edited by pituach MVP Friday, May 27, 2016 1:19 PM
- Marked as answer by Naseer CV Saturday, May 28, 2016 11:03 AM
Did you restart the SQL Server Services ?
Make sure you have enabled the following protocols on that instance: Shared Memory, Named pipes, TCP/IP.
Change the authentication mode to Mixed mode if you are using a SQL login to get connected to the SQL Server instance.
Examine SQL Server Error Log as mentioned by Ronen and share any errors found with us.
Hope this helps.
Dear Ronen Ariely , Thanks a lot for the reply.
Please find the error log.
2016-05-27 16:11:36.63 spid51 Configuration option ‘show advanced options’ changed from 1 to 0. Run the RECONFIGURE statement to install.
2016-05-27 16:11:37.21 Logon Error: 17809, Severity: 20, State: 1.
2016-05-27 16:11:37.21 Logon Could not connect because the maximum number of ‘1’ user connections has already been reached. The system administrator can use sp_configure to increase the maximum value. The connection has been closed. [CLIENT: ]
Источник