서버와 성공적으로 연결되었지만 사전 로그인 핸드 셰이크 중에 오류가 발생했습니다.
Local Environment에서 Production DB를 연결하려고 할 때 다음과 같은 오류가 발생합니다.
이전에 프로덕션 DB에 연결할 수 있었는데 갑자기 다음과 같은 오류가 발생합니다.
서버와 성공적으로 연결되었지만 사전 로그인 핸드 셰이크 중에 오류가 발생했습니다. (공급자 : TCP 공급자, 오류 : 0-핸들이 잘못되었습니다.)
Production DB의 연결 문자열이있는 로컬 PC에서 asp.net 웹 사이트를 실행하려고했는데, 다음은 로컬 환경에서 발생하는 오류에 대한 스택 추적입니다.
D : \ EDrive \ My WebSites \ MyWebsite \ MyWebsite \ MyWebsiteDAL \ clsForumQuestion.cs : line 821의 MyWebsiteDAL.clsForumQuestion.SelectAll (Int32 CurrentPageIndex, Int32 PageSize) at CodeConnect.Default.Page_Load (Object sender, EventArgs e) in D : \ EDrive \ My WebSites \ MyWebsite \ MyWebsite \ MyWebsite \ Default.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, 부울 includeStagesAfterAsyncPoint)
여기서 무엇이 잘못되었을 지 아십니까?
해결책
1) VS.Net 솔루션 청소
2) 프로젝트를 다시 빌드하십시오.
3) IIS 재설정
4) 프로젝트를 다시 실행하십시오.
기본적으로 내 문제가 해결되었지만 내 경우에는이 오류가 발생하지 않았고 갑자기 로컬 환경에서 위의 오류가 발생하기 시작하므로 그 트릭이 나를 위해 작동 할 수 있습니다.
-작업 내용을 저장하고
-Visual Studio를 닫은 다음
-프로젝트를 다시 엽니 다.
항상 나를 위해 작동합니다.
메모리를 많이 사용하는 프로세스를 실행할 때이 오류가 발생했습니다. 시스템에 메모리가 부족해지기 시작하자 이런 종류의 오류가 발생했습니다. RAM을 더 잘 사용하기 위해 알고리즘을 변경해야했습니다.
일부 스레드는이 예외를 던졌지 만 다른 스레드는 다음을 던졌습니다.
System.Data.SqlClient.SqlException (0x80131904) : 연결 시간 초과가 만료되었습니다. 사전 로그인 핸드 셰이크 승인을 사용하는 동안 시간 초과 기간이 경과했습니다. 사전 로그인 핸드 셰이크가 실패했거나 서버가 제 시간에 응답하지 못했기 때문일 수 있습니다. 이 서버에 연결을 시도하는 동안 소요 된 시간은 다음과 같습니다.-[사전 로그인] 초기화 = 43606; handshake = 560; ---> System.ComponentModel.Win32Exception (0x80004005) : 대기 작업 시간이 초과되었습니다.
더 적은 RAM을 사용하여 실행할 수 있도록 시스템이 변경된 후 두 문제가 모두 사라졌습니다.
다음 명령을 실행하면 저에게 효과적이었습니다.
netsh Winsock reset
https://serverfault.com/a/487139/250527 에서 확인
몇 가지 사항을 확인할 수 있습니다.
프로덕션 서버는 원격 연결을 허용합니다. (특히 DBA가있는 경우 누군가이 기능을 끌 수 있음)
연결 문자열을 확인하십시오. 때때로 IP 주소 또는 서버 이름을 사용하는 경우이 오류가 발생합니다. 둘 다 시도하십시오.
나는 같은 문제가 있었고, 세션 데이터를 데이터베이스에 저장하고 있었고, 연결 문자열에는 Encrypt = True 가 있었는데 , SQL 클라이언트가 보안 (SSL) 모드에서 서버에 연결하라고 말한 것으로 가정하여이 기능을 제거했습니다!
제 경우에는 다음과 같습니다.
Persist Security Info=True;
제거해야하는 연결 문자열에서. 일단 내가 더 이상 문제가 없었습니다.
Ricardo 의 답변에서 설명했듯이 ,
netsh Winsock reset
나를 위해 일했습니다.
PS 인터넷 다운로드 관리자 또는 IP 설정을 변경하는 프로그램이 설치되어있는 경우 컴퓨터를 재부팅 할 때이 명령을 실행하면 IDM이 설정 변경을 요청합니다.이 경우에는 NO를 설정 한 다음 응용 프로그램을 실행하면 제대로 작동합니다.
희망
데이터베이스에 연결할 수없는 비슷한 문제가 발생하여 여기에서 권장 사항을 시도했습니다.
하루가 끝나면 이것이 저에게 효과적이었습니다.
SQL Server 구성 관리자 도구를 사용하여 SQL Server 클라이언트 컴퓨터에서 TCP / IP 및 / 또는 명명 된 파이프 프로토콜을 사용하도록 설정했습니다.
- 시작을 클릭하고 모든 프로그램을 가리킨 다음 SQL Server 구성 관리자를 클릭합니다.
- SQL Server 네트워크 구성을 클릭하여 확장 한 다음 클라이언트 프로토콜을 클릭합니다.
- TCP / IP 프로토콜을 마우스 오른쪽 단추로 클릭 한 다음 사용을 클릭합니다.
- Named Pipes 프로토콜을 마우스 오른쪽 단추로 클릭 한 다음 사용을 클릭합니다.
- 메시지가 나타나면 SQL Server 서비스를 다시 시작합니다.
나는 이것이 왜 또는 언제 비활성화되었는지 여전히 잘 모르겠습니다.
저에게 해결책은 좀비 IIS 익스프레스 작업자 프로세스를 죽이는 것입니다.
예를 들어 작업 관리자에서 찾아 작업을 종료합니다.
나는 이와 동일한 문제가 있었고 제안 된 수정 사항에 운이 없었습니다. 그런 다음 이 기사 를 접하고 LSP를 차단하는 Sendori라는 프로그램에 대한 Mirrh의 의견을 보았습니다. 내 컴퓨터에 어떻게 들어 갔는지 모르겠지만 거기에 있었고 제거하면 문제가 해결되었습니다.
기사가 작동하지 않으면 프로그램을 확인하고 Sendori가 보이면 제거하십시오.
SQL Server (Sharepoint) 서비스를 다시 시작 했는데 문제가 해결되었습니다.
I was getting the exact same problem with no chnges to the code base or servers. It turned out to be that the DB server was running at 100% CPU and SQL Server was being starved of any CPU time, which caused the timeout.
Had the same issue, the reason for it was BCrypt.Net library, compiled using .NET 2.0 framework, while the whole project, which used it, was compiling with .NET 4.0. If symptoms are the same, try download BCrypt source code and rebuild it in release configuration within .NET 4.0. After I'd done it "pre-login handshake" worked fine. Hope it helps anyone.
I experienced this error and did all the suggestions from you guys here but none had any effect for my error.
I caught the culprit: if you are using *.ini
file for your system, you might want to check what server name was input there and make sure it is the same as the one in your web.config connection string.
Same problem here and no answers listed here worked, nor any solutions I could find online. The issue started shortly after Windows 10 anniversary update got applied on my dev PC and only affected my old SQL Server 2005 instance. I was not able to connect to the instance via my Web Applications or even using Sql Management Studio.
For what it's worth, this is what resolved it for me:
Open SQL Server Configuration Manager (depending on what version of SQL Server you're running):
- C:\Windows\SysWOW64\SQLServerManager.msc
- C:\Windows\SysWOW64\SQLServerManager10.msc OR
- C:\Windows\SysWOW64\SQLServerManager12.msc OR
- etc
Select SQL Server Services
Locate the troubled service and view Properties
- eg SQL Server (SQL2005) in my case
In the Log On tab, change the "Built-in account" to "Network Service"
Which is almost what this random solution said: http://www.kutayzorlu.com/operating-systems/linux-unix-redhat-debian-ubuntu-opensuse-centos/general-server-administrating/error-fixed-a-connection-was-successfully-established-with-the-server-but-then-an-error-occurred-during-the-pre-login-handshake-12405.html
I chose Network Service for no reason at all. Mine was already configured to use Local System. This security doesn't matter to me as it was only problematic on my Local development machine, only accessed locally. I can't advise why this works, but it did.
In my case, i was getting the error when i wanted to access a remote database. However, i solved it by starting SQL Server Browser service.
Had the same problem from many days. I had to explicitly add TLS1.2 support in my core project to address this error and it worked fine. ( ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;)
See below link for more details (thanks to author Usman Khurshid) https://www.itechtics.com/connection-successfully-established-error-occured-pre-login-handshake/
'IT박스' 카테고리의 다른 글
Java8 Lambda와 익명 클래스 (0) | 2020.08.19 |
---|---|
SQL Server 2008 데이터베이스를 강제로 오프라인으로 전환하는 방법 (0) | 2020.08.19 |
C #에서 비동기 적으로 메서드를 호출하는 방법 (0) | 2020.08.19 |
Java에서 순차 정수 목록 또는 배열을 생성하려면 어떻게해야합니까? (0) | 2020.08.19 |
Git으로 로컬 브랜치 삭제 (0) | 2020.08.19 |