Category Archives: I\O

SQL Server 2008 – How to troubleshoot error: The operating system returned error 6(The handle is invalid……)

Recently i came across this error message in the sql server logs in one of our production systems.

“The operating system returned error 6(The handle is invalid.) to SQL Server during a read at offset 0x0000063931c000 in file ‘F:\MSSQL\DATA\DBFile_8.ndf’. Additional messages in the SQL Server error log and system event log may provide more detail. This is a severe system-level error condition that threatens database integrity and must be corrected immediately. Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online”.

i started reading about this error message and i found this KB article that discusses the error message and provides a resolution

Link to the KB Article:

The cause of the error as mentioned in the article:

SQL Server uses Windows API’s [e.g. ReadFile, WriteFile, ReadFileScatter, WriteFileGather] to perform the I/O operations. After performing these I/O operations, SQL Server checks for any error conditions associated with these API calls. If these API calls fail with an Operating System error, then SQL Server reports Error 823.

The 823 error message contains the following information:

i)The database file against which the I/O operation was performed
ii)The offset within the file where the I/O operation was attempted
iii)Is the I/O operation a read or write request
iv)The Operating System Error code and Error Description

The 823 error message usually indicates that there is a problem with underlying storage system or the hardware or a driver that is in the path of the I/O request. You can encounter this error when there are inconsistencies in the file system or if the database file is damaged“.

The resolution provided in the article was helpful for me to nail the issue. Please go through the KB article as discusses the RCA in detail

%d bloggers like this: