Created On:  05 April 2011

Problem:

Is it possible to identify the files that are being reported as in the StarTeam Server log as 'No such file or directory'?

00000004 2011-04-05 13:33:27 Exception thrown from Unknown: Class = FileSystemException, Code = 4(0x00000004)
  Msg = No such file or directory
  [OS Error Code] = 2
  [FileName] = C:\StarTeamVault\Attachments\Changes_Attachments\00000CD0

These errors occur when a user attempts to open an attachment on a Change Request, or Requirement etc. The user on the CPC is unlikely to get an error message, the attachment will simply fail to open.

Resolution:

The following query will return details of the missing attachments. Information includes:

  • Change Request number
  • CR Revision number
  • Attachment name
DECLARE @hex_val VARBINARY(8)

DECLARE @int_val int

-- change the following to match the missing 'file' in the error msg
-- e.g.  [FileName] = C:\StarTeam\Attachments\Changes_Attachments\00000CD0
-- then set the following to 0x00000CD0

SET @hex_val = 0x0000001A
SELECT @int_val = CONVERT(INT, @hex_val)
SELECT @hex_val = CONVERT(VARBINARY(8),REVERSE(@hex_val))

SELECT

  sc.ChangeNumber, sc.RevisionNumber, ca.Name

FROM

  syn_change sc, syn_changes_attachments ca

WHERE

sys.fn_sqlvarbasetostr(sc.attachmentids) LIKE '%' RIGHT(sys.fn_sqlvarbasetostr(@hex_val),8) '%'

AND ca.id = @int_val