Question

I have a question what the following error / error code means:

NT_STATUS_INVALID_HANDLE in the class jcifs.smb.NtStatus.

This is from "The Java CIFS Client Library"

I am trying to figure out when exactly this error occurs. Does it happen when the file is not found in the shared path? Or does it occur when the shared folder connection gets lost?

If anyone is aware of this, do help!

I went through source code available here

Regards, Girish

Was it helpful?

Solution

When a Fid does not exists

  • SMB error code -> ERRbadfid(0x0006)
  • NT status code -> STATUS_INVALID_HANDLE(0xC0000008)
  • POSIX equivalent -> ENOENT
  • Description -> The Fid supplied is invalid.

Fid: A 16-bit value that the Server Message Block (SMB) server uses to represent an opened file, named pipe, printer, or device. A Fid is returned by an SMB server in response to a client request to open or create a file, named pipe, printer, or device. The SMB server guarantees that the Fid value returned is unique for a given SMB connection until the SMB connection is closed, at which time the Fid value may be reused. The Fid is used by the SMBclient in subsequent SMB commands to identify the opened file, named pipe, printer, or device.

or when a TID (Tree identifier, a unique ID for a resource in use by client) is no longer valid

  • SMB error code -> ERRinvtid(0x0005)
  • NT status code -> STATUS_INVALID_HANDLE(0xC0000008)STATUS_SMB_BAD_TID(0x00050002)
  • POSIX equivalent ->
  • Description -> The TID is no longer valid.

or UID (User Identifier) is not valid

  • SMB error code -> ERRbaduid(0x005B)
  • NT status code -> STATUS_INVALID_HANDLE(0xC0000008)STATUS_SMB_BAD_UID(0x005B0002)
  • POSIX equivalent ->
  • Description -> The UID supplied is not known to the session.

in the SMB Header fields during a session/transaction.

The two last errors could be raised when you are trying to open a new session from the client while an other session is still active, this causes the old session to be reset by the server.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top