After executing the following command using the Vault command line client:
Code: Select all
vault GETVERSION -host repo.example.com -user user -password pass -repository repo -verbose 1 $/path/to/file .
The
entire error is shown in the output of the command:
Code: Select all
<vault>
<!--Get latest version failed for $/path/to/file: Invalid revision number.-->
<error>
<exception>VaultClientOperationsLib.GetLatestVersionFailedException: Exception of type 'VaultClientOperationsLib.GetLatestVersionFailedException' was thrown.
at VaultClientOperationsLib.ClientInstance.ProcessGetFileRequests(GetFileInfo[] infos, MakeWritableType makeWritable, SetFileTimeType setFileTime, MergeType merge, Boolean updateHiddenFilesOnly, String ancestorFullPath, Boolean flat, String ancestorDiskPath, OverwritePrompt PromptData, Boolean isLabelGet, String currentPathToLabelItem, Int64 labelID, Boolean isRetry, Boolean isGetByDisplayVersion)
at VaultClientOperationsLib.ClientInstance.GetByDisplayVersionToNonWorkingFolder(VaultClientFile[] files, MakeWritableType makeWritable, SetFileTimeType setFileTime, String ancestorFullPath, String ancestorDiskPath, OverwritePrompt PromptData)
at VaultClientOperationsLib.ClientInstance.GetByDisplayVersionToNonWorkingFolder(VaultClientFile file, MakeWritableType makeWritable, SetFileTimeType setFileTime, String ancestorFullPath, String ancestorDiskPath, OverwritePrompt PromptData)
at VaultClientIntegrationLib.GetOperations.performGetVersion(String objectPath, Int32 version, String strDestFolder, GetOptions getOptions)
at VaultClientIntegrationLib.GetOperations.ProcessCommandGetVersionToLocationOutsideWorkingFolder(String objectPath, Int32 version, GetOptions getOptions, String destPath)
at VaultCmdLineClient.VaultCmdLineClient.ProcessCommand(Args curArg)
at VaultCmdLineClient.VaultCmdLineClient.Main(String[] args)</exception>
</error>
<result>
<success>False</success>
</result>
</vault>
In answer to your question,
yes, I can see version 1 of the file via the Vault GUI Client. Can you explain why the GUI would allow me to see and get version 1 of this file without a problem, while the command line client and the API won't (which both use the same code in VaultClientOperationsLib according to the stack trace)?
The other information I am including is the SOAP request and response - which I have captured - to /VaultService/VaultService.asmx. I have only included the request/response where the SOAPAction is "
http://www.sourcegear.com/schemas/vault ... nloadFiles" for the case of using the command line interface as above and when using the GUI client.
The request/response recorded when using the command line client as shown above:
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Header>
<VaultAuth xmlns="http://www.sourcegear.com/schemas/vault">
<Token>
d8a735b3-634c-4a17-b34c-6a25b5fdec11IHoT3R087CZ8sk5lOfWtLw==</Token>
</VaultAuth>
</soap:Header>
<soap:Body>
<BeginDownloadFiles xmlns="http://www.sourcegear.com/schemas/vault">
<nRepID>10</nRepID>
<requests>
<VaultRequestGetFile>
<ItemPath>
$/path/to/file</ItemPath>
<BaseObjVerID>0</BaseObjVerID>
<TargetObjVerID>0</TargetObjVerID>
<ObjID>417923</ObjID>
<Version>1</Version>
</VaultRequestGetFile>
</requests>
</BeginDownloadFiles>
</soap:Body>
</soap:Envelope>
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<BeginDownloadFilesResponse xmlns="http://www.sourcegear.com/schemas/vault">
<BeginDownloadFilesResult>0</BeginDownloadFilesResult>
<requests>
<VaultRequestGetFile>
<ItemPath>
$/path/to/file</ItemPath>
<Response xsi:type="VaultResponseGetFile">
<Status>1013</Status>
<FileToken>
5b7174c0-2d0a-47a7-855f-25981c5815a5</FileToken>
<FileLength>0</FileLength>
<FileCRC>4294967295</FileCRC>
<ObjVerID>-1</ObjVerID>
<ID>-1</ID>
<Version>-1</Version>
<EOL>2</EOL>
<FileDeltaLength>0</FileDeltaLength>
<DeltaFileInfoIDLength>0</DeltaFileInfoIDLength>
</Response>
<BaseObjVerID>0</BaseObjVerID>
<TargetObjVerID>0</TargetObjVerID>
<ObjID>417923</ObjID>
<Version>1</Version>
</VaultRequestGetFile>
</requests>
<strDownloadID>
485238c7-0fce-4834-8296-69e9b77be0ed</strDownloadID>
</BeginDownloadFilesResponse>
</soap:Body>
</soap:Envelope>
This request/response recorded when using the windows client to achieve the same thing as I am trying to achieve using the command line client:
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Header>
<VaultAuth xmlns="http://www.sourcegear.com/schemas/vault">
<Token>
1e9b84ac-f7db-49d7-a88f-914e5d53085abtmle3n3REBur6uB6Ed5rw==</Token>
</VaultAuth>
</soap:Header>
<soap:Body>
<BeginDownloadFiles xmlns="http://www.sourcegear.com/schemas/vault">
<nRepID>10</nRepID>
<requests>
<VaultRequestGetFile>
<ItemPath>
$/path/to/file</ItemPath>
<BaseObjVerID>0</BaseObjVerID>
<TargetObjVerID>217619</TargetObjVerID>
<ObjID>417923</ObjID>
<Version>0</Version>
</VaultRequestGetFile>
</requests>
</BeginDownloadFiles>
</soap:Body>
</soap:Envelope>
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<BeginDownloadFilesResponse xmlns="http://www.sourcegear.com/schemas/vault">
<BeginDownloadFilesResult>0</BeginDownloadFilesResult>
<requests>
<VaultRequestGetFile>
<ItemPath>
$/path/to/file</ItemPath>
<Response xsi:type="VaultResponseGetFile">
<Status>1590</Status>
<FileToken>
4d9cfddb-56ca-48fd-9726-8829e11fdbd3</FileToken>
<FileLength>4780</FileLength>
<FileCRC>3261393260</FileCRC>
<ModifiedDate>
<Ticks>633056293211870000</Ticks>
</ModifiedDate>
<TxDate>
<Ticks>633092513627500000</Ticks>
</TxDate>
<ObjVerID>217619</ObjVerID>
<ID>23774</ID>
<Version>1</Version>
<EOL>2</EOL>
<FileDeltaLength>810</FileDeltaLength>
<DeltaFileInfoIDLength>810</DeltaFileInfoIDLength>
</Response>
<BaseObjVerID>0</BaseObjVerID>
<TargetObjVerID>217619</TargetObjVerID>
<ObjID>417923</ObjID>
<Version>0</Version>
</VaultRequestGetFile>
</requests>
<strDownloadID>
7fa2c9d5-bb55-4017-a98f-371351604c67</strDownloadID>
</BeginDownloadFilesResponse>
</soap:Body>
</soap:Envelope>
You will no doubt notice the differences. Any explanation (even if it is just that there is a bug in VaultClientOperationsLib) would be appreciated. I am using Vault version 4.1.2.18185 and the corresponding version of the command line client and the client API.
Thanks.