0x80131904 sql ошибка

I am seeing this in several situations and it is intermittent in our web based application connecting to SQL Server 2008 R2 serve back end. Users are coming across a point 2 point connection and seeing this on and off. Thought it was bandwidth issues until I started seeing it on terminal servers that are on the same core switch as this SQL server. I have checked remote connection enabled, Port 1433 is set correctly in Configuration for TCP/IP and the only thing I see that could be a cause is the timeout setting is set to 100000 in the remote connections rather than unlimited.

System.Data.SqlClient.SqlException (0x80131904):
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 — Could not open a connection to SQL Server)

System.ComponentModel.Win32Exception (0x80004005): The network path
was not found

at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) > at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, Boolean withFailover) at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover) at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout) at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance) at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData) at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions) at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions) at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource1 retry, DbConnectionOptions
userOptions, DbConnectionInternal& connection) at
System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection
owningConnection, TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource1 retry, DbConnectionOptions userOptions) at
System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection
outerConnection, DbConnectionFactory connectionFactory,
TaskCompletionSource1 retry, DbConnectionOptions userOptions) at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource1
retry) at
System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource1 retry) at System.Data.SqlClient.SqlConnection.Open() at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.<>c__DisplayClass1.b__0() at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute[TResult](Func1
operation) at
System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute(Action
operation) at
System.Data.Entity.Core.EntityClient.EntityConnection.Open()
ClientConnectionId:00000000-0000-0000-0000-000000000000

ee the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
Microsoft.Data.SqlClient.SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: Shared Memory Provider, error: 36 — The Shared Memory dll used to connect to SQL Server 2000 was not found) —> System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified
at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) in H:tsaagent2_work11ssrcMicrosoft.Data.SqlClientnetfxsrcMicrosoftDataSqlClientSqlInternalConnection.cs:line 779 at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) in H:tsaagent2_work11ssrcMicrosoft.Data.SqlClientnetfxsrcMicrosoftDataSqlClientTdsParser.cs:line 1668 at Microsoft.Data.SqlClient.TdsParser.ConsumePreLoginHandshake(SqlAuthenticationMethod authType, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, ServerCertificateValidationCallback serverCallback, ClientCertificateRetrievalCallback clientCallback, Boolean& marsCapable, Boolean& fedAuthRequired) in H:tsaagent2_work11ssrcMicrosoft.Data.SqlClientnetfxsrcMicrosoftDataSqlClientTdsParser.cs:line 1293 at Microsoft.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, Boolean withFailover, Boolean isFirstTransparentAttempt, SqlAuthenticationMethod authType, String certificate, ServerCertificateValidationCallback serverCallback, ClientCertificateRetrievalCallback clientCallback, Boolean useOriginalAddressInfo, Boolean disableTnir) in H:tsaagent2_work11ssrcMicrosoft.Data.SqlClientnetfxsrcMicrosoftDataSqlClientTdsParser.cs:line 640 at Microsoft.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover, Boolean isFirstTransparentAttempt, Boolean disableTnir) in H:tsaagent2_work11ssrcMicrosoft.Data.SqlClientnetfxsrcMicrosoftDataSqlClientSqlInternalConnectionTds.cs:line 2251 at Microsoft.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout) in H:tsaagent2_work11ssrcMicrosoft.Data.SqlClientnetfxsrcMicrosoftDataSqlClientSqlInternalConnectionTds.cs:line 1873 at Microsoft.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance) in H:tsaagent2_work11ssrcMicrosoft.Data.SqlClientnetfxsrcMicrosoftDataSqlClientSqlInternalConnectionTds.cs:line 1685 at Microsoft.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, ServerCertificateValidationCallback serverCallback, ClientCertificateRetrievalCallback clientCallback, DbConnectionPool pool, String accessToken, SqlClientOriginalNetworkAddressInfo originalNetworkAddressInfo, Boolean applyTransientFaultHandling) in H:tsaagent2_work11ssrcMicrosoft.Data.SqlClientnetfxsrcMicrosoftDataSqlClientSqlInternalConnectionTds.cs:line 536 at Microsoft.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions) in H:tsaagent2_work11ssrcMicrosoft.Data.SqlClientnetfxsrcMicrosoftDataSqlClientSqlConnectionFactory.cs:line 143 at Microsoft.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions) in H:tsaagent2_work11ssrcMicrosoft.Data.SqlClientnetfxsrcMicrosoftDataProviderBaseDbConnectionFactory.cs:line 163 at Microsoft.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) in H:tsaagent2_work11ssrcMicrosoft.Data.SqlClientnetfxsrcMicrosoftDataProviderBaseDbConnectionPool.cs:line 943 at Microsoft.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) in H:tsaagent2_work11ssrcMicrosoft.Data.SqlClientnetfxsrcMicrosoftDataProviderBaseDbConnectionPool.cs:line 2000 at Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) in H:tsaagent2_work11ssrcMicrosoft.Data.SqlClientnetfxsrcMicrosoftDataProviderBaseDbConnectionPool.cs:line 1412 at Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) in H:tsaagent2_work11ssrcMicrosoft.Data.SqlClientnetfxsrcMicrosoftDataProviderBaseDbConnectionPool.cs:line 1296
at Microsoft.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) in H:tsaagent2_work11ssrcMicrosoft.Data.SqlClientnetfxsrcMicrosoftDataProviderBaseDbConnectionFactory.cs:line 354 at Microsoft.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource1 retry, DbConnectionOptions userOptions) in H:tsaagent2_work11ssrcMicrosoft.Data.SqlClientnetfxsrcMicrosoftDataProviderBaseDbConnectionInternal.cs:line 766
at Microsoft.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource1 retry, DbConnectionOptions userOptions) in H:tsaagent2_work11ssrcMicrosoft.Data.SqlClientnetfxsrcMicrosoftDataProviderBaseDbConnectionClosed.cs:line 71 at Microsoft.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource1 retry) in H:tsaagent2_work11ssrcMicrosoft.Data.SqlClientnetfxsrcMicrosoftDataSqlClientSqlConnection.cs:line 1946
at Microsoft.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource1 retry, SqlConnectionOverrides overrides) in H:tsaagent2_work11ssrcMicrosoft.Data.SqlClientnetfxsrcMicrosoftDataSqlClientSqlConnection.cs:line 1934 at Microsoft.Data.SqlClient.SqlConnection.Open(SqlConnectionOverrides overrides) in H:tsaagent2_work11ssrcMicrosoft.Data.SqlClientnetfxsrcMicrosoftDataSqlClientSqlConnection.cs:line 1495 at Microsoft.Data.SqlClient.SqlConnection.Open() in H:tsaagent2_work11ssrcMicrosoft.Data.SqlClientnetfxsrcMicrosoftDataSqlClientSqlConnection.cs:line 1466 at Dapper.SqlMapper.<QueryImpl>d__1401.MoveNext() in //Dapper/SqlMapper.cs:line 1078
at System.Collections.Generic.List1..ctor(IEnumerable1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source) at Dapper.SqlMapper.Query[T](IDbConnection cnn, String sql, Object param, IDbTransaction transaction, Boolean buffered, Nullable1 commandTimeout, Nullable`1 commandType) in /
/Dapper/SqlMapper.cs:line 721
at WindowsFormsApp1.Form1.LoadLeadButton_Click(Object sender, EventArgs e) in M:developmentR1R1WindowsFormsApp1Form1.cs:line 21
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
ClientConnectionId:67e04f97-acbb-48e7-a4d7-918df00c2e58
Error Number:2,State:0,Class:20

************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4180.0 built by: NET48REL1LAST_B
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll

WindowsFormsApp1
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///M:/development/R1/R1/WindowsFormsApp1/bin/Debug/WindowsFormsApp1.exe

System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4084.0 built by: NET48REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll

System
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4084.0 built by: NET48REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll

System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4084.0 built by: NET48REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll

System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4084.0 built by: NET48REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll

System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4180.0 built by: NET48REL1LAST_B
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll

System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4084.0 built by: NET48REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll

System.Data
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4084.0 built by: NET48REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_32/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll

Microsoft.Data.SqlClient
Assembly Version: 2.0.20168.4
Win32 Version: 2.00.20168.4
CodeBase: file:///M:/development/R1/R1/WindowsFormsApp1/bin/Debug/Microsoft.Data.SqlClient.DLL

System.Transactions
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4084.0 built by: NET48REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_32/System.Transactions/v4.0_4.0.0.0__b77a5c561934e089/System.Transactions.dll

Dapper
Assembly Version: 2.0.0.0
Win32 Version: 2.0.35.21366
CodeBase: file:///M:/development/R1/R1/WindowsFormsApp1/bin/Debug/Dapper.DLL

System.Xml.Linq
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4084.0 built by: NET48REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml.Linq/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.Linq.dll

System.EnterpriseServices
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4084.0 built by: NET48REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_32/System.EnterpriseServices/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

Hello,

I am migrating client’s database to my hosted environment, the client runs
SQL Server 2008 R2
, and we run SQL Server 2014.

I am stuck on restoring one log file, which left below error message when I restore it:

Restoring files
  DBFile_20150401030954.trn
Error Message: System.Data.SqlClient.SqlException (0x80131904): SQL Server detec
ted a logical consistency-based I/O error: incorrect checksum (expected: 0x512cb
ec3; actual: 0x512dbec3). It occurred during a read of page (1:827731)
in databa
se ID 49 at offset 0x000001942a6000 in file ‘F:MSSQL12.INSTANCE9MSSQLDataOdy
sseyTSIAKL_Data.mdf’.  Additional messages in the SQL Server error log or system
 event log may provide more detail. This is a severe error condition that threat
ens database integrity and must be corrected immediately. Complete a full databa
se consistency check (DBCC CHECKDB). This error can be caused by many factors; f
or more information, see SQL Server Books Online.
RESTORE LOG is terminating abnormally.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolea
n breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception
, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObj
ect stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand
 cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler,
TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
   at System.Data.SqlClient.SqlDataReader.get_MetaData()
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, Run
Behavior runBehavior, String resetOptionsString)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBe
havior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 time
out, Task& task, Boolean asyncWrite, SqlDataReader ds)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehav
ior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletio
nSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehav
ior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteScalar()
   at OnBoardingTrnRestore.FileRestorer.FileIsRestored(SqlConnection connection,
 String sourceBackupFileName, String sourceDatabaseName, String destinationDatab
aseName, String databaseName, String strFileName) in c:DevWiseCloudOnBoarding
TrnRestoreOnBoardingTrnRestoreFileRestorer.cs:line 223
ClientConnectionId:6f583f98-9c23-4936-af45-0d7e9a9949ea
Finished

I have run restore filelistonly and verifyonly in both client and my box, and both worked well:

XXX_Data D:Program Files (x86)XXXDataYYY_Data.mdf

restore filelistonly:

D PRIMARY
70922469376 35184372080640
1 0
0 00000000-0000-0000-0000-000000000000
0 0
0 512 1
NULL 279441000014839500242
66CC6D17-575C-41E5-BB58-3FB4D33E288C
0 1 NULL
XXX_Log E:Program Files (x86)XXXLogYYY_Log.ldf
L NULL
31985762304 35184372080640
2 0
0 00000000-0000-0000-0000-000000000000
0 0
0 512 0
NULL 0
00000000-0000-0000-0000-000000000000 0
1 NULL

restore verifyonly:

Attempting to restore this backup may encounter storage space problems. Subsequent messages will provide details.
The path specified by «D:Program Files (x86)XXXDataYYY_Data.mdf» is not in a valid directory.
Directory lookup for the file «E:Program Files (x86)XXXLogYYY_Log.ldf» failed with the operating system error 3(The system cannot find the path specified.).
The backup set on file 1 is valid.

Dbcc checkdb also confirmed there is no error in client sql server database.

dbcc checkdb (XXX, NOINDEX) 

Results as follows:
DBCC results for ‘XXX’.
Warning: NO_INDEX option of checkdb being used. Checks on non-system indexes will be skipped.
Service Broker Msg 9675, State 1: Message Types analyzed: 17.
Service Broker Msg 9676, State 1: Service Contracts analyzed: 9.
Service Broker Msg 9667, State 1: Services analyzed: 7.
Service Broker Msg 9668, State 1: Service Queues analyzed: 7.
Service Broker Msg 9669, State 1: Conversation Endpoints analyzed: 0.
Service Broker Msg 9674, State 1: Conversation Groups analyzed: 0.
Service Broker Msg 9670, State 1: Remote Service Bindings analyzed: 0.
Service Broker Msg 9605, State 1: Conversation Priorities analyzed: 0.
DBCC results for ‘sys.sysrscols’.
There are 23808 rows in 350 pages for object «sys.sysrscols».

DBCC results for ‘BMBoard’.
There are 0 rows in 0 pages for object «BMBoard».
DBCC results for ‘CusOutturnHeader’.
There are 0 rows in 0 pages for object «CusOutturnHeader».
CHECKDB found 0 allocation errors and 0 consistency errors in database ‘XXX’.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.

We use ftp to transfer the log files from the another country to here, I confirmed the file’s MD5(checksum) is same as the copy in client’s environment, we have tried to upload the file a couple of times, same outcome.

The full backup is fine, I have successfully restored a series log backups prior to this file.

Has anyone seen this issue before? It is strange, all information indicates the file is good,but somehow it goes wrong.

Below are the version details:

Client: 

MICROSOFT SQL SERVER 2008 R2 (SP2) — 10.50.4000.0 (X64) 

My environment:

Microsoft SQL Server 2014 — 12.0.2480.0 (X64) 
Jan 28 2015 18:53:20 
Copyright (c) Microsoft Corporation
Enterprise Edition (64-bit) on Windows NT 6.3 <X64> (Build 9600: )

Thanks,

Albert

Discover expert solutions that worked for others

by Kazim Ali Alvi

Kazim has always been fond of technology, be it scrolling through the settings on his iPhone, Android device, or Windows. And at times, unscrewing the device to take… read more


Updated on May 12, 2023

Reviewed by
Alex Serban

Alex Serban

After moving away from the corporate work-style, Alex has found rewards in a lifestyle of constant analysis, team coordination and pestering his colleagues. Holding an MCSA Windows Server… read more

  • The 0x80131904 prevents users from signing in and has been a major concern for administrators.
  • It generally appears when incorrect credentials are provided, or the firewall is blocking the connection.
  • To fix things, check for network issues, verify firewall rules, or change the DNS entries, amongst other solutions.

fix 0x80131904 SQL error

XINSTALL BY CLICKING THE DOWNLOAD FILE

To fix various PC problems, we recommend Restoro PC Repair Tool:
This software will repair common computer errors, protect you from file loss, malware, hardware failure and optimize your PC for maximum performance. Fix PC issues and remove viruses now in 3 easy steps:

  1. Download Restoro PC Repair Tool that comes with Patented Technologies (patent available here).
  2. Click Start Scan to find Windows issues that could be causing PC problems.
  3. Click Repair All to fix issues affecting your computer’s security and performance
  • Restoro has been downloaded by 0 readers this month.

Administrators creating applications using a SQL connection don’t usually face many issues if the backend is tight. But often, due to misconfigurations or network issues, users come across the 0x80131904 error.

The message reads, A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 0 – The specified network name is no longer available.). It’s not something regular users can fix, and administrators, too, have a tough time dealing with it. Let’s find out more!

What is component error code 0x80131904?

The error usually has to do with a network-related issue, but if the problem persists, it could be settings to blame. More so, for some administrators, only a handful of users encountered the 0x80131904 error, while others could easily access things.

Here are a few reasons you are encountering the error:

  • Incorrect credentials: When a user enters incorrect credentials, the error message may appear. So you will have to verify that.
  • Firewall blocking the connection: In some cases, a firewall was blocking the connection, and it could be both, the one on the server’s side as well as the user’s end. For the latter, you can easily disable the firewall.
  • Network issues: Some administrators found that it was a network issue triggering the error, and things automatically resolved in a short while.
  • Misconfigured SQL settings: For a few, the server properties were misconfigured, or the security settings were not optimal, which led to the error.

How do I fix error 0x80131904?

Before we move to the slightly complex solutions, check these aspects first:

  • Verify that the user is not entering incorrect credentials to access the application.
  • Check for network issues and talk to the service provider for an update on it.
  • Make sure the firewall is not blocking the connection. You can disable it temporarily to verify the same.

If none work, head to the fixes listed next.

1. Change the DNS entries

  1. Press Windows + E to open File Explorer, paste the following path in the address bar, and hit Enter:C:/Windows/System32/Drivers/ETCpath
  2. Now, change the DNS entries in the hosts.ini file.

An administrator shared that changing the DNS entries fixed things when only a single user was unable to access the server while others could. Whether or not that’s the case with you, do try this first.

2. Reconfigure server authentication setting

  1. Open the Server Properties and select Security from the navigation pane.security to fix 0x80131904
  2. Now, under Server authentication, choose SQL server with Windows Authentication mode, and click OK to save the changes. security settings to fix 0x80131904

In some cases, the server’s security settings were be to blame for the 0x80131904: login failed error, and reconfiguring Server authentication to SQL Server and Windows Authentication mode got things running.

3. Downgrade the SQL client package

For many, the problem appeared after updating to a newer SQLClient package, which points to a bug in it. And in this case, you should downgrade to the previous one.

For instance, a user reported the issue after upgrading to 2.0.0 from 1.1.3 and reverting the change fixed things in no time.

Read more about this topic

  • Chatsonic Network Error: How to Bypass it
  • Why is Perplexity AI Not Working? 4 Ways to Fix It

4. Remove problematic suites

If nothing else worked, you could remove the following two cipher suites from the client list:TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 TLS_DHE_RSA_WITH_AES_128_GCM_SHA256

This has worked for many users, but remember to check if a patch has been released for the problem before making changes to fix 0x80131904.

Before you leave, check some quick tips to increase the Internet speed in Windows.

For any queries or to share what worked for you, drop a comment below.

Still having issues? Fix them with this tool:

SPONSORED

If the advices above haven’t solved your issue, your PC may experience deeper Windows problems. We recommend downloading this PC Repair tool (rated Great on TrustPilot.com) to easily address them. After installation, simply click the Start Scan button and then press on Repair All.

newsletter icon

8 Replies

  • Most likely, it’s firewall.


    Was this post helpful?
    thumb_up
    thumb_down

  • Author Alec Herrmann

    Alec6638


    This person is a Verified Professional

    This person is a verified professional.

    Verify your account
    to enable IT peers to see that you are a professional.

    thai pepper

    Microsoft SQL Server Expert

    • check
      131
      Best Answers
    • thumb_up
      314
      Helpful Votes

    I second Robert’s guess.  Likely the Microsoft Windows firewall software on the client (not your network firewall).

    To quickly determine this, simply turn OFF the Microsoft Windows Firewall (in Control Panel — Windows Firewall), reboot (if needed), and see if it works.


    Was this post helpful?
    thumb_up
    thumb_down

  • Author Skylar Purifoy

    Hey guys,

    thanks for the responses. I reset the firewall to default and tried the application but same error. Then I turned off the firewall and tried but also got the same error message. Next thing to try is removing his profile and re-creating it. 


    Was this post helpful?
    thumb_up
    thumb_down

  • Author Skylar Purifoy

    skylarpurifoy3 wrote:

    Hey guys,

    thanks for the responses. I reset the firewall to default and tried the application but same error. Then I turned off the firewall and tried but also got the same error message. Next thing to try is removing his profile and re-creating it. 

    well that didn’t work either. 


    Was this post helpful?
    thumb_up
    thumb_down

  • Author Alec Herrmann

    Alec6638


    This person is a Verified Professional

    This person is a verified professional.

    Verify your account
    to enable IT peers to see that you are a professional.

    thai pepper

    Microsoft SQL Server Expert

    • check
      131
      Best Answers
    • thumb_up
      314
      Helpful Votes

    You can try using PortQryV2 to see if the SQL ports are actually open from that computer?

    Querying 1434 will also return the available SQL instances.

    https://support.microsoft.com/en-us/help/832919/new-features-and-functionality-in-portqry-version-2-… Opens a new window

    Text

    C:downloads>portqry -n sqldev.mydomain.com -e 1433 -p udp
    Attempting to resolve name to IP address...
    Name resolved to 10.1.0.167
    querying...
    UDP port 1433 (ms-sql-s service): LISTENING or FILTERED
    

    Text

    C:downloads>portqry -n sqldev.mydomain.com -e 1434 -p udp
    Attempting to resolve name to IP address...
    Name resolved to 10.1.0.167
    querying...
    UDP port 1434 (ms-sql-m service): LISTENING or FILTERED
    Sending SQL Server query to UDP port 1434...
    Server's response:
    ServerName SQLDEV
    InstanceName MSSQLSERVER
    IsClustered No
    Version 12.0.5000.0
    tcp 1433
    np \SQLDEVpipesqlquery
      
    ==== End of SQL Server query response ====
    UDP port 1434 is LISTENING
    

    You can even use TelNet (if you have that utility installed) on port 1433 to just check if the sql server responds.  Look this method up online.


    Was this post helpful?
    thumb_up
    thumb_down

  • Ping is returning the correct IP address from this person’s machine? How about tracert? Are they in the same domain?


    Was this post helpful?
    thumb_up
    thumb_down

  • Author Skylar Purifoy

    Well we ended up changing the DNS entries in the hosts.ini file on C:/Windows/System32/Drivers/ETC and then it started working for him. 


    Was this post helpful?
    thumb_up
    thumb_down

  • Author Alec Herrmann

    Alec6638


    This person is a Verified Professional

    This person is a verified professional.

    Verify your account
    to enable IT peers to see that you are a professional.

    thai pepper

    Microsoft SQL Server Expert

    • check
      131
      Best Answers
    • thumb_up
      314
      Helpful Votes

    Good to hear that!  If that change (local DNS record in hosts file) made it work, then whatever DNS record that computer received for the sql server host query is incorrect.

    You should check its DHCP settings and see if the correct DNS server is being used?
    Your IT network guys (whoever set up the DHCP and DNS system in your network) can help you here.


    Was this post helpful?
    thumb_up
    thumb_down

Caroline Sosebee is a Senior Software Engineer at ThreeWill. She has 30+ years of software development experience and a broad scope of general IT knowledge.  At ThreeWill she has a proven track record of quality consultative and software development skills, focusing on the design and implementation of SharePoint solutions, both on-premises and in the Microsoft 365 cloud.

Did You Get SqlClient.SqlException (0x80131904)?

We recently ran across a very interesting and NOT (or barely) documented problem on one of our client’s on-premises SharePoint 2013 farms which was a doozy to solve.

The site with the problem is in a very large SharePoint farm being used as a central repository for reports that are accessed by employees throughout the company. Many of the reports are published automatically via Business Objects while many others are created and uploaded manually. The net of it is that there are thousands and thousands of files being added/manipulated daily (or weekly or monthly) within the document libraries in this site. All this activity creates a lot of churn in the databases and ultimately caused SharePoint to hit what would seem to be an impossible to reach value.

The problem first manifested itself as an inability to upload a new document or to edit the properties of an existing document. When searching the ULS logs, we found that it was triggering the below SQL error:

Error: SqlClient.SqlException (0x80131904): Arithmetic overflow error converting IDENTITY to data type int.

Definition: “An arithmetic overflow is caused by a calculated column value that exceeds the column’s specified size. When this error occurs, the calculation stops and the remainder of the results pane is not filled.”

Finding the Culprit

So the next step was to figure out which SQL table was throwing this arithmetic overflow error. We didn’t have direct access to the SharePoint SQL database, so we had someone on site who did have access to run a set of queries for us. The first one was used to determine which tables had an ‘ID’ column that could be throwing this error:

[sourcecode lang=”sql”]

SELECT

t.TABLE_NAME

,c.COLUMN_NAME

,c.TABLE_CATALOG

,c.TABLE_SCHEMA

FROM

INFORMATION_SCHEMA.COLUMNS AS c JOIN

INFORMATION_SCHEMA.TABLES AS t

ON t.TABLE_NAME = c.TABLE_NAME

WHERE

COLUMNPROPERTY(OBJECT_ID(c.TABLE_NAME)

,c.COLUMN_NAME,’IsIdentity’) = 1 AND

t.TABLE_TYPE = ‘Base Table’ AND

t.TABLE_NAME NOT LIKE ‘dt%’ AND

t.TABLE_NAME NOT LIKE ‘MS%’ AND

t.TABLE_NAME NOT LIKE ‘syncobj_%’

[/sourcecode]

Output:

TABLE_NAME COLUMN_NAME TABLE_CATALOG TABLE_SCHEMA
SiteQuota SQId WSS_Content_RRP dbo
Versions Id WSS_Content_RRP dbo
AllFileFragments Id WSS_Content_RRP dbo
SolutionResourceUsageDaily Id WSS_Content_RRP dbo
EventCache Id WSS_Content_RRP dbo
SolutionResourceUsageWindowed Id WSS_Content_RRP dbo
SolutionResourceUsageLog Id WSS_Content_RRP dbo
SiteDeletion Id WSS_Content_RRP dbo
SiteVersions Id WSS_Content_RRP dbo

We then ran a query on each of the tables in order to check their current values:

[sourcecode lang=”sql”]

select
max(SQId)
as SiteQuota from
SiteQuota:
2116070153

select
max(Id)
as Versions from
Versions:
9

select
max(Id)
as AllFileFragments from
AllFileFragments:
Null

select
max(Id)
as
SolutionResourceUsageDaily from
SolutionResourceUsageDaily:
Null

select
max(Id)
as EventCache from
EventCache:
637542714

select
max(Id)
as SolutionResourceUsageWindowed from
SolutionResourceUsageWindowed:
494160

select
max(Id)
as SolutionResourceUsageLog from
SolutionResourceUsageLog:
Null

select
max(Id)
as SiteDeletion from
SiteDeletion:
Null

select
max(Id)
as SiteVersions from
SiteVersions:
134

[/sourcecode]

As you can see from the results, it was pretty obvious which table was probably causing the error. What wasn’t so obvious is what this table did and what we could do about it.

IDENTITY columns are of type ‘int’ which allows for a maximum value of 2,147,483,647 (2 billion +) – a really huge number. Even though the current max value of the identity column on the SiteQuota table wasn’t this exact number, it definitely showed us that this one was the likely culprit. We confirmed by running the below query, which is used to return the last identity value generated for the table:

[sourcecode lang=”sql”]Select ident_current(‘SiteQuota’) [/sourcecode]

Returned value was 2,147,483,647

Do No Harm

Unfortunately, we had no idea what this table did so weren’t sure if we could reseed it or not. We only knew that the ‘SiteQuota’ table was a SharePoint system table that Microsoft does not publicly document (that we could find).

By running a series of tests on a local system though, we could tell that it was used every time a SharePoint item was touched (added / removed / updated) and that the IDENTITY column was being incremented by 2 each time one of these actions happened. We could also see that this was apparently a temporary ‘working’ table, meaning that items are added to it for the duration of the transaction then deleted.

The Solution

Given this, we were able to successfully reseed the IDENTITY column so that the system could get back online. We ran the following commands to do this and confirm success:

[sourcecode lang=”sql”]dbcc checkident (‘sitequota’, reseed, 0) [/sourcecode]

– this reset the identity column back to 0

[sourcecode lang=”sql”]select ident_current(‘sitequota’) [/sourcecode]

– this verified that it was reset correctly

After doing this, all was now right in this particular world!

For a typical SharePoint site, we think this limit should never even come close to being reached, which is probably why we had such a hard time finding any information about it out there. But this is such a huge SharePoint farm that this particular client will need to continue to monitor this value on an ongoing basis in order to keep the system from grinding to a halt again.

I hope this helped you – if it did, please leave a comment below and, as always, feel free to ask me questions.

Related Content:

Using the Microsoft.Net v4.0 SqlClient connectivity built-in to Microsoft.Net via the System.Data.SqlClient assembly, a particular machine cannot connect to a particular set of servers. When connections are attempted, the following error is thrown:

System.Data.SqlClient.SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 - An existing connection was forcibly closed by the remote host.) ---> System.ComponentModel.Win32Exception (0x80004005): An existing connection was forcibly closed by the remote host
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParserStateObject.SNIWritePacket(SNIHandle handle, SNIPacket packet, UInt32& sniError, Boolean canAccumulate, Boolean callerHasConnectionLock)
   at System.Data.SqlClient.TdsParserStateObject.WriteSni(Boolean canAccumulate)
   at System.Data.SqlClient.TdsParserStateObject.WritePacket(Byte flushMode, Boolean canAccumulate)
   at System.Data.SqlClient.TdsParser.TdsLogin(SqlLogin rec)
   at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover)
   at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout)
   at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance)
   at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo,String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions)
   at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
   at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup, DbConnectionOptions userOptions)
   at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
   at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
   at System.Data.SqlClient.SqlConnection.Open()
   at ConsoleApplication1.Module1.Main()

I can connect from other machines to the same target server using the same binary without issue. I can also connect from the problematic server if I recompile the binary against Microsoft.Net v2.0.

The target server is configured to audit failed logins, however no failures are logged in the SQL Server errorlog as a result of this issue — I can cause an audit entry if I login with an invalid SQL Server login just to be certain the auditing is working.

The code I’m using to test this issue is:

Module Module1

    Sub Main()

        Dim bUseSSL As Boolean = False

        If My.Application.CommandLineArgs.Contains("/SSL") Then
            bUseSSL = True
        End If

        If bUseSSL Then
            Console.WriteLine("Encryption enabled")
        Else
            Console.WriteLine("Encryption disabled")
        End If

        Dim cb As New Data.SqlClient.SqlConnectionStringBuilder
        cb.ApplicationName = "SqlClientTest"
        cb.DataSource = "<server_name_here>"
        cb.IntegratedSecurity = True
        cb.Encrypt = bUseSSL
        'cb.TrustServerCertificate = True
        cb.NetworkLibrary = "dbmssocn"

        Try
            Using sqlconnection As New System.Data.SqlClient.SqlConnection(cb.ConnectionString)
                Try
                    sqlconnection.Open()
                    Console.WriteLine("Connected to " & cb.DataSource)
                    Dim sqlcommand As New System.Data.SqlClient.SqlCommand("SELECT @@SERVERNAME;", sqlconnection)
                    Dim sqlreader As System.Data.SqlClient.SqlDataReader = sqlcommand.ExecuteReader
                    While sqlreader.Read
                        Console.WriteLine(sqlreader.GetString(0))
                    End While
                    sqlreader.Close()
                Catch ex As Exception
                    Console.WriteLine(cb.ConnectionString)
                    Console.WriteLine("")
                    Console.WriteLine(ex.ToString)
                End Try
                Console.WriteLine("Press 'q' to quit.")
                Dim cki As ConsoleKeyInfo = Console.ReadKey
                While cki.KeyChar.ToString.ToLower <> "q"
                    cki = Console.ReadKey
                End While
            End Using
        Catch ex As Exception
            Console.WriteLine(cb.ConnectionString)
            Console.WriteLine("")
            Console.WriteLine(ex.ToString)
        End Try
    End Sub

End Module

The same failure is logged regardless of the encryption setting, and regardless of the TrustServerCertificate setting.

Something appears to be forcing the .Net SqlClient v4.0 on this machine to use SSL even if I disable it via the connection string.

Any ideas what to check?

Понравилась статья? Поделить с друзьями:
  • 0x800fff ошибка windows 10 при обновлении
  • 0x800f0988 ошибка 0x800f0988 при установке обновления windows 10
  • 0x800f0984 ошибка 0x800f0984 при обновлении windows 10
  • 0x8024401f ошибка обновления windows 10
  • 0x8024401c ошибка центра обновления server 2016