Title: Intermittent or no connection established to SQL Server · Issue #11804 · PowerShell/PowerShell · GitHub
Open Graph Title: Intermittent or no connection established to SQL Server · Issue #11804 · PowerShell/PowerShell
X Title: Intermittent or no connection established to SQL Server · Issue #11804 · PowerShell/PowerShell
Description: #Steps to reproduce Create a connection to a SQL Server and run a command from the SQLserver module $connectionString = "Server=
Open Graph Description: #Steps to reproduce Create a connection to a SQL Server and run a command from the SQLserver module $connectionString = "Server=
X Description: #Steps to reproduce Create a connection to a SQL Server and run a command from the SQLserver module $connectionString = "Server=<servername>,14481;database=hoclusters;Integrated Security...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/11804
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Intermittent or no connection established to SQL Server","articleBody":"#Steps to reproduce\r\n\r\n```powershell 7 \r\nCreate a connection to a SQL Server and run a command from the SQLserver module\r\n$connectionString = \"Server=\u003cservername>,14481;database=hoclusters;Integrated Security=True;Persist Security Info=True;User ID=$user;Password=$pwd\"\r\n$sqlConnection = New-Object System.Data.SqlClient.SqlConnection $connectionString\r\n$SqlCmd = New-Object System.Data.SqlClient.SqlCommand\r\n$SqlCmd.Connection = $SqlConnection\r\n$SqlCmd.CommandTimeout = 0\r\n\r\ninvoke-sqlcmd -serverinstance '\u003cservername>,14481' -database 'master' -query \"select @@servername\" -QueryTimeout 60\r\n\r\n\r\n```\r\n\r\n# Expected behavior\r\n\r\n```\r\ninvoke-sqlcmd command to return server name after successful connection\r\n\r\n```\r\n\r\n# Actual behavior\r\n\r\n```\r\nA connection is established but the pre-login handshake times out\r\n```\r\n\r\n# Environment data\r\n\r\n\u003c!-- Name Value\r\n---- -----\r\nPSVersion 7.0.0-rc.2\r\nPSEdition Core\r\nGitCommitId 7.0.0-rc.2\r\nOS Microsoft Windows 10.0.17763\r\nPlatform Win32NT\r\nPSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}\r\nPSRemotingProtocolVersion 2.3\r\nSerializationVersion 1.1.0.1\r\nWSManStackVersion 3.0\r\n\r\n PS /> $PSVersionTable\r\n\r\nName Value\r\n---- -----\r\nPSVersion 7.0.0-rc.2\r\nPSEdition Core\r\nGitCommitId 7.0.0-rc.2\r\nOS Linux 3.10.0-1062.9.1.el7.x86_64 #1 SMP Fri Dec 6 15:49:49 UTC 2019\r\nPlatform Unix\r\nPSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}\r\nPSRemotingProtocolVersion 2.3\r\nSerializationVersion 1.1.0.1\r\nWSManStackVersion 3.0-->\r\n\r\n```\r\nException : \r\n Type : Microsoft.SqlServer.Management.Common.ConnectionFailureException\r\n TargetSite : \r\n Name : Connect\r\n DeclaringType : Microsoft.SqlServer.Management.Common.ConnectionManager\r\n MemberType : Method\r\n Module : Microsoft.SqlServer.ConnectionInfo.dll\r\n StackTrace : \r\n at Microsoft.SqlServer.Management.Common.ConnectionManager.Connect()\r\n at Microsoft.SqlServer.Management.PowerShell.SmoCmdlet.ConnectToServer(String instance, PSCredential cred, Nullable`1 timeout)\r\n at Microsoft.SqlServer.Management.PowerShell.SmoContextSensitiveTargetedWithServerInstanceCmdlet`1.ResolveTargets()+MoveNext()\r\n Message : Failed to connect to server \u003cservername>,14481.\r\n InnerException : \r\n Type : System.Data.SqlClient.SqlException\r\n Errors : \r\n Source : Core .Net SqlClient Data Provider\r\n Number : 258\r\n Class : 20\r\n Server : \u003cservername>,14481\r\n Message : A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: SSL Provider, error:\r\n0 - The wait operation timed out.)\r\n ClientConnectionId : d95f684b-ab07-4bb7-9f0f-cfa4c9517b1e\r\n Class : 20\r\n Number : 258\r\n Server : \u003cservername>,14481\r\n Source : Core .Net SqlClient Data Provider\r\n ErrorCode : -2146232060\r\n TargetSite : Void .ctor(System.Data.ProviderBase.DbConnectionPoolIdentity, System.Data.SqlClient.SqlConnectionString, System.Data.SqlClient.SqlCredential,\r\nSystem.Object, System.String, System.Security.SecureString, Boolean, System.Data.SqlClient.SqlConnectionString, System.Data.SqlClient.SessionData, Boolean, System.String)\r\n StackTrace : \r\n at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object\r\nproviderInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData\r\nreconnectSessionData, Boolean applyTransientFaultHandling, String accessToken)\r\n at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool\r\npool, DbConnection owningConnection, DbConnectionOptions userOptions)\r\n at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options,\r\nDbConnectionPoolKey poolKey, DbConnectionOptions userOptions)\r\n at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)\r\n at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)\r\n at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean\r\nonlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)\r\n at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions,\r\nDbConnectionInternal& connection)\r\n at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions,\r\nDbConnectionInternal oldConnection, DbConnectionInternal& connection)\r\n at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1\r\nretry, DbConnectionOptions userOptions)\r\n at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry,\r\nDbConnectionOptions userOptions)\r\n at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)\r\n at System.Data.SqlClient.SqlConnection.Open()\r\n at Microsoft.SqlServer.Management.Common.ConnectionManager.InternalConnect()\r\n at Microsoft.SqlServer.Management.Common.ConnectionManager.Connect()\r\n Message : A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: SSL Provider,\r\nerror: 0 - The wait operation timed out.)\r\n Data : System.Collections.ListDictionaryInternal\r\n InnerException : \r\n Type : System.ComponentModel.Win32Exception\r\n NativeErrorCode : 258\r\n ErrorCode : -2147467259\r\n Message : The wait operation timed out.\r\n HResult : -2147467259\r\n HResult : -2146232060\r\n Source : Microsoft.SqlServer.ConnectionInfo\r\n HResult : -2146233087\r\nTargetObject : \u003cservername>,14481\r\nCategoryInfo : ObjectNotFound: (\u003cservername>,14481:String) [Read-SqlTableData], ConnectionFailureException\r\nFullyQualifiedErrorId : ConnectionToServerFailed,Microsoft.SqlServer.Management.PowerShell.ReadSqlTableData\r\nInvocationInfo : \r\n MyCommand : Read-SqlTableData\r\n ScriptLineNumber : 1\r\n OffsetInLine : 1\r\n HistoryId : 11\r\n Line : Read-SqlTableData -ServerInstance '\u003cservername>,14481' -DatabaseName ho_cpu_wait -SchemaName \"dbo\" -TableName \"table1\"\r\n PositionMessage : At line:1 char:1\r\n + Read-SqlTableData -ServerInstance '\u003cservername>. …\r\n + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n InvocationName : Read-SqlTableData\r\n CommandOrigin : Internal\r\nScriptStackTrace : at \u003cScriptBlock>, \u003cNo file>: line 1\r\nPipelineIterationInfo : \r\n\r\n```\r\n","author":{"url":"https://github.com/Spectre-007","@type":"Person","name":"Spectre-007"},"datePublished":"2020-02-07T14:02:15Z","url":"https://github.com/PowerShell/PowerShell/issues/11804"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:6389b43d-8e07-9d7a-0fee-65f7eda89253 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8DD2:15BFB5:D622D:122BF1:6AFD4B49 |
| html-safe-nonce | d43630dba780f6e8ce4a6e3167ebe82e9590f1d8a5115a933ae8f5e3568c0116 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4REQyOjE1QkZCNTpENjIyRDoxMjJCRjE6NkFGRDRCNDkiLCJ2aXNpdG9yX2lkIjoiNTE0MTU1NjgyMjcyNDY2MDA0MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 02939a8ef5475a3764b9010017a8ed07b3e70b1706741474f5ea58048a0a86b4 |
| hovercard-subject-tag | issue:561655280 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/11804/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f385f36a7e28ccf0a89c4aa3b70b638db04a801bf38bae7fae9e9e48a6e8b418/PowerShell/PowerShell/issues/11804 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f385f36a7e28ccf0a89c4aa3b70b638db04a801bf38bae7fae9e9e48a6e8b418/PowerShell/PowerShell/issues/11804 |
| og:image:alt | #Steps to reproduce Create a connection to a SQL Server and run a command from the SQLserver module $connectionString = "Server= |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Spectre-007 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 66653c2e55a6fff2930be1bdf07ee4f8aa137e3956d056c822563be6f878755e |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | b6f01f7cb9f35f8c09949773241a3d49dd04b340 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width