Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error occurred during the pre-login handshake error:success #690

Closed
RagingPuppies opened this issue Aug 13, 2020 · 9 comments
Closed

error occurred during the pre-login handshake error:success #690

RagingPuppies opened this issue Aug 13, 2020 · 9 comments

Comments

@RagingPuppies
Copy link

Hi,
maybe someone here can enlighten me, i receive once or twice in a day the following messages (lets say 1\100000 calls):

A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 0 - Success)
or
A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 0 - Unknown error)

The service running on Linux machine in a docker container (Rancher) and making calls to mssql 2016, i do know that the call is not completed and there is an error, it's just that "success" doesn't tell me much about how to solve it...
i randomly get that from all my services..

  • no pod restarts
  • I have no events correlating in the DB servers

and have rad the whole internet and usually the error is more informative in other people posts...
can someone help me here?

@ErikEJ
Copy link
Contributor

ErikEJ commented Aug 13, 2020

Which client version??

@RagingPuppies
Copy link
Author

@ErikEJ System.Data.SqlClient, Version=4.5.0.1

@JRahnama
Copy link
Member

JRahnama commented Aug 13, 2020

@RagingPuppies Can I ask for more detail? What version of netcore is installed on your machine? we did have some similar issues in the past.

@RagingPuppies
Copy link
Author

@JRahnama yeah sure,
Machine Ubuntu 18.04 with Kubernetes v1.17.2
Docker: 5:18.09
Container with .netcore 3.1
Windows 2016 with MSSQL 2016 CU7 (13.0.5337.0)

anything else?

@JRahnama
Copy link
Member

JRahnama commented Aug 13, 2020

@RagingPuppies Thanks for the quick response. If possible, have you tried using the latest version of System.Data.SqlClient or Microsoft.Data.SqlClient V2.0.0? Also one last thing, is it possible to share us a repro of your code? we will try to reproduce the issue here and follow from there.

@RagingPuppies
Copy link
Author

RagingPuppies commented Aug 17, 2020

@JRahnama
i would also like to add that when it happens it's for 2 sec with several of these errors while we have heavy load on our servers

you can use the following to repreduce

_async Task<List> ICurrenciesDal.GetCurrencies()
{
List result = new List();

        IBaseDal thisIBaseDal = this as IBaseDal;

        using (SqlConnection conn = new SqlConnection(thisIBaseDal.ConnectionString))
        {
            DynamicParameters parameters = new DynamicParameters();

            ErrorDbParameters.AddErrorDbParams(parameters);

            CommandDefinition command = new CommandDefinition(GET_CURRENCIES_STORED_PROCEDURE_NAME, parameters, commandType: CommandType.StoredProcedure);

            using (var reader = await conn.ExecuteReaderAsync(command))
            {
                while (await reader.ReadAsync())
                {
                    CurrenciesDO plRowData = await GetDataFromReader(reader);

                    result.Add(plRowData);
                }
            }

           ErrorDbParameters.ValidateErrorDbParams(parameters, new int[] { ErrorCodes.ERROR_GENERAL_NOROWS });
        }

        return result;
    }_

@cheenamalhotra cheenamalhotra added this to Needs triage in SqlClient Triage Board via automation Aug 19, 2020
@cheenamalhotra cheenamalhotra moved this from Needs triage to Under Investigation in SqlClient Triage Board Aug 19, 2020
@JRahnama
Copy link
Member

JRahnama commented Sep 3, 2020

@RagingPuppies based on the sample code you sent me I made an application and let it ran for a dayand a night, could not see the issue happening. Is it possible for you to run your application with Microsoft.Data.Sqlclient V2.0.0 or the latest preview ( we do not have that support in System.Data.Sqlclient) and run PerfView on your Windows container to capture EventSource Traces for Microsoft.Data.SqlClient.EventSource? This could be done either in command line or interface. If the answer is yes,

you need to run the command as perfview /onlyProviders=*Microsoft.Data.SqlClient.EventSource run <Your_Application.exe>

and set the path to the folder that has the executive file of your project.

you either can generate a secrete gist and send me the link in a private conversation if you are concerned about your information or even easier email me the link or the file itself.

Doing this will give us more information about the issue and its occurrences.

@RagingPuppies
Copy link
Author

So the error code was solved, it was a network component (linkerd) answering to tcp even tho the sqlserver is not responding, skipping sql port will reveal the true error... Thank you all

@JRahnama
Copy link
Member

JRahnama commented Sep 8, 2020

@RagingPuppies I am glad the issue is resolved. Feel free to close the issue if there is no related topic to discuss here.

SqlClient Triage Board automation moved this from Under Investigation to Closed Sep 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

3 participants