Nant Vault task; vaultgetbylabel exception
Moderator: SourceGear
Nant Vault task; vaultgetbylabel exception
Does anybody tried to use the Vault Nant task to retrieve a particular labeled source?
I was trying the below task, but I get an exception.
I have some folder structure created of the branch I'm trying to get, but not the complete folder structure. I did not get any files.
I ran nant in verbose mode but I did not receive any additional error information.
Versions:
- Using the 3.1.6 Vault client, with the 3.16 release of the Nant task.
- Nant 0.85-rc3
- .NET 2.0 framework
Marco
<!-- - Load custom vault tasks. See for the latest documentation on the tasks:
http://vaultpub.sourcegear.com/build/latest/doc/ -->
< loadtasks>
< fileset>
< include name="NAnt.VaultTasks.dll " />
</ fileset>
</ loadtasks>
< if test ="${property::exists('source.label')}">
< echo message=" Using Vault label ${source.label}" />
< vaultgetbylabel url="${source.server }"
username= "${source.username}"
password= "${source.password}"
repository= "${source.repository}"
path= "${solution.sourcepath}"
destination= "${source.dir}"
labelstring= "${source.label}"/>
</ if>
refresh-source:
[echo] Using Vault label 1.0.1.2
[vaultgetbylabel] Vault: Retrieving repository structure information from the s
erver...
[vaultgetbylabel] Vault: Saving repository information to disk...
[vaultgetbylabel] Vault: Working
[vaultgetbylabel] Vault: Requesting files...
[vaultgetbylabel] Vault: Downloading files...
[vaultgetbylabel] Vault: Updating local files...
[vaultgetbylabel] Vault: Saving repository information to disk...
[vaultgetbylabel] Vault: Working
BUILD FAILED
INTERNAL ERROR
VaultClientOperationsLib.GetLatestVersionFailedException: Exception of type Vaul
tClientOperationsLib.GetLatestVersionFailedException was thrown.
at VaultClientOperationsLib.ClientInstance.ProcessGetFileRequests(GetFileInfo
[] infos, MakeWritableType makeWritable, SetFileTimeType setFileTime, MergeType
merge, Boolean updateHiddenFilesOnly, String ancestorFullPath, Boolean flat, Str
ing ancestorDiskPath, OverwritePrompt PromptData, Boolean isLabelGet, String cur
rentPathToLabelItem, Int64 labelID, Boolean isRetry)
at VaultClientOperationsLib.ClientInstance.GetByLabelToNonWorkingFolder_GetDa
ta(VaultClientFile[] files, Boolean overwrite, MakeWritableType makeWritable, Se
tFileTimeType setFileTime, String ancestorFullPath, String ancestorDiskPath, Ove
rwritePrompt PromptData, Int64 labelID, String currentPathToLabelItem, String la
belSubItemPath, Boolean isLabelGetForSingleFile)
at VaultClientOperationsLib.ClientInstance.GetByLabelToNonWorkingFolder_GetDa
ta(VaultClientFolder folder, Boolean recursive, Boolean overwrite, MakeWritableT
ype makeWritable, SetFileTimeType setFileTime, String destinationDiskPath, Overw
ritePrompt PromptData, Int64 labelID, String currentPathToLabelItem, String labe
lSubItemPath)
at VaultClientOperationsLib.ClientInstance.GetLabeledFolderToNonWorkingFolder
(VaultClientFolder vcRepFolder, String strLabelName, String strLabelPath, String
& strLocalDir, Boolean bRecursive)
at NAnt.Contrib.Tasks.SourceGearVault.vaultgetbylabel.GetByLabel(String fileN
ame) in C:\temp\vaultnant2.0\latest\src\VaultGetByLabel.cs:line 141
at NAnt.Contrib.Tasks.SourceGearVault.vaultgetbylabel.ExecuteTask() in C:\tem
p\vaultnant2.0\latest\src\VaultGetByLabel.cs:line 110
at NAnt.Core.Task.Execute()
at NAnt.Core.TaskContainer.ExecuteChildTasks()
at NAnt.Core.Tasks.IfTask.ExecuteTask()
at NAnt.Core.Task.Execute()
at NAnt.Core.Target.Execute()
at NAnt.Core.Project.Execute(String targetName, Boolean forceDependencies)
at NAnt.Core.Tasks.CallTask.ExecuteTask()
at NAnt.Core.Task.Execute()
at NAnt.Core.Target.Execute()
at NAnt.Core.Project.Execute(String targetName, Boolean forceDependencies)
at NAnt.Core.Project.Execute()
at NAnt.Core.Project.Run()
Please send bug report to nant-developers@lists.sourceforge.net .
Total time: 3.3 seconds.
I was trying the below task, but I get an exception.
I have some folder structure created of the branch I'm trying to get, but not the complete folder structure. I did not get any files.
I ran nant in verbose mode but I did not receive any additional error information.
Versions:
- Using the 3.1.6 Vault client, with the 3.16 release of the Nant task.
- Nant 0.85-rc3
- .NET 2.0 framework
Marco
<!-- - Load custom vault tasks. See for the latest documentation on the tasks:
http://vaultpub.sourcegear.com/build/latest/doc/ -->
< loadtasks>
< fileset>
< include name="NAnt.VaultTasks.dll " />
</ fileset>
</ loadtasks>
< if test ="${property::exists('source.label')}">
< echo message=" Using Vault label ${source.label}" />
< vaultgetbylabel url="${source.server }"
username= "${source.username}"
password= "${source.password}"
repository= "${source.repository}"
path= "${solution.sourcepath}"
destination= "${source.dir}"
labelstring= "${source.label}"/>
</ if>
refresh-source:
[echo] Using Vault label 1.0.1.2
[vaultgetbylabel] Vault: Retrieving repository structure information from the s
erver...
[vaultgetbylabel] Vault: Saving repository information to disk...
[vaultgetbylabel] Vault: Working
[vaultgetbylabel] Vault: Requesting files...
[vaultgetbylabel] Vault: Downloading files...
[vaultgetbylabel] Vault: Updating local files...
[vaultgetbylabel] Vault: Saving repository information to disk...
[vaultgetbylabel] Vault: Working
BUILD FAILED
INTERNAL ERROR
VaultClientOperationsLib.GetLatestVersionFailedException: Exception of type Vaul
tClientOperationsLib.GetLatestVersionFailedException was thrown.
at VaultClientOperationsLib.ClientInstance.ProcessGetFileRequests(GetFileInfo
[] infos, MakeWritableType makeWritable, SetFileTimeType setFileTime, MergeType
merge, Boolean updateHiddenFilesOnly, String ancestorFullPath, Boolean flat, Str
ing ancestorDiskPath, OverwritePrompt PromptData, Boolean isLabelGet, String cur
rentPathToLabelItem, Int64 labelID, Boolean isRetry)
at VaultClientOperationsLib.ClientInstance.GetByLabelToNonWorkingFolder_GetDa
ta(VaultClientFile[] files, Boolean overwrite, MakeWritableType makeWritable, Se
tFileTimeType setFileTime, String ancestorFullPath, String ancestorDiskPath, Ove
rwritePrompt PromptData, Int64 labelID, String currentPathToLabelItem, String la
belSubItemPath, Boolean isLabelGetForSingleFile)
at VaultClientOperationsLib.ClientInstance.GetByLabelToNonWorkingFolder_GetDa
ta(VaultClientFolder folder, Boolean recursive, Boolean overwrite, MakeWritableT
ype makeWritable, SetFileTimeType setFileTime, String destinationDiskPath, Overw
ritePrompt PromptData, Int64 labelID, String currentPathToLabelItem, String labe
lSubItemPath)
at VaultClientOperationsLib.ClientInstance.GetLabeledFolderToNonWorkingFolder
(VaultClientFolder vcRepFolder, String strLabelName, String strLabelPath, String
& strLocalDir, Boolean bRecursive)
at NAnt.Contrib.Tasks.SourceGearVault.vaultgetbylabel.GetByLabel(String fileN
ame) in C:\temp\vaultnant2.0\latest\src\VaultGetByLabel.cs:line 141
at NAnt.Contrib.Tasks.SourceGearVault.vaultgetbylabel.ExecuteTask() in C:\tem
p\vaultnant2.0\latest\src\VaultGetByLabel.cs:line 110
at NAnt.Core.Task.Execute()
at NAnt.Core.TaskContainer.ExecuteChildTasks()
at NAnt.Core.Tasks.IfTask.ExecuteTask()
at NAnt.Core.Task.Execute()
at NAnt.Core.Target.Execute()
at NAnt.Core.Project.Execute(String targetName, Boolean forceDependencies)
at NAnt.Core.Tasks.CallTask.ExecuteTask()
at NAnt.Core.Task.Execute()
at NAnt.Core.Target.Execute()
at NAnt.Core.Project.Execute(String targetName, Boolean forceDependencies)
at NAnt.Core.Project.Execute()
at NAnt.Core.Project.Run()
Please send bug report to nant-developers@lists.sourceforge.net .
Total time: 3.3 seconds.
Using the 3.1.6 distribution, I can't reproduce your problem using the 1.1. framework or the 2.0 framework. NAnt 0.85-rc3 ships configured to use Beta 1 of the 2.0 framework, which I didn't test. Have you changed nant.exe.config to use the RTM 2.0 framework?
If you look at the very beginning of your verbose nant output (you didn't include it above) you can tell. Configured to use 2.0 RTM, mine looks like this:
If you look at the very beginning of your verbose nant output (you didn't include it above) you can tell. Configured to use 2.0 RTM, mine looks like this:
Code: Select all
NAnt 0.85 (Build 0.85.1932.0; rc3; 4/16/2005)
Copyright (C) 2001-2005 Gerry Shaw
http://nant.sourceforge.net
Framework 'net-1.0' is invalid and has not been loaded : The 'System.dll' assembly does not exist in framework assembly directory 'C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705'..
Framework 'mono-1.0' is invalid and has not been loaded : Registry Path Not Found! - key='SOFTWARE\Mono\';hive='Microsoft.Win32.RegistryHive[]';.
Framework 'mono-2.0' is invalid and has not been loaded : Registry Path Not Found! - key='SOFTWARE\Mono\';hive='Microsoft.Win32.RegistryHive[]';.
Framework 'sscli-1.0' is invalid and has not been loaded : Framework directory 'C:\sscli\build\v1.x86fstchk.rotor' does not exist..
Buildfile: file:///C:/temp/nantTest.build
Target framework: Microsoft .NET Framework 2.0
Target(s) specified: nantTest
nantTest:
[loadtasks] Scanning assembly "NAnt.VaultTasks" for extensions.
[vaultgetbylabel] Vault: Retrieving repository structure information from the server...
[vaultgetbylabel] Vault: Saving repository information to disk...
[vaultgetbylabel] Vault: Working
[vaultgetbylabel] Vault: Requesting files...
[vaultgetbylabel] Vault: Downloading files...
... (zillions of files listed here) ...
[vaultgetbylabel] Vault: Updating local files...
[vaultgetbylabel] Vault: Saving repository information to disk...
[vaultgetbylabel] Vault: Working
BUILD SUCCEEDED
Total time: 504.6 seconds.
Ian Olsen
SourceGear
SourceGear
And in case it's helpful, my test nant script looks like this:
Code: Select all
<?xml version="1.0" ?>
<project name="Vault" default="nantTest">
<target name="nantTest">
<!-- Load Vault NAnt Tasks -->
<loadtasks assembly="NAnt.VaultTasks.dll" />
<!-- Get Labelled Source -->
<vaultgetbylabel
url="http://x.sourcegear.com"
username="username"
password="password"
repository= "vault tree"
path="$/Labels/3.1/src"
destination= "c:\temp\src"
labelstring= "Build 3.1.7.3690"/>
</target>
</project>
Ian Olsen
SourceGear
SourceGear
Ian
Thanks for your assistance. I did notice now that I actually was running the 1.1 framework. (I have the 2.0 RTM. installed but that is not recognized by NAnt)
How did you configure NAnt to use the 2.0 RTM?
Marco
C:\BUILD-~1\ADMINI~1>nant -verbose -buildfile:KBB.AdministrationTool.build
NAnt 0.85 (Build 0.85.1932.0; rc3; 4/16/2005)
Copyright (C) 2001-2005 Gerry Shaw
http://nant.sourceforge.net
Framework 'net-1.0' is invalid and has not been loaded : The 'System.dll' assemb
ly does not exist in framework assembly directory 'C:\WINDOWS\Microsoft.NET\Fram
ework\v1.0.3705'..
Framework 'net-2.0' is invalid and has not been loaded : Framework directory 'C:
\WINDOWS\Microsoft.NET\Framework\v2.0.40607' does not exist..
Framework 'mono-1.0' is invalid and has not been loaded : Registry Path Not Foun
d! - key='SOFTWARE\Mono\';hive='Microsoft.Win32.RegistryHive[]';.
Framework 'mono-2.0' is invalid and has not been loaded : Registry Path Not Foun
d! - key='SOFTWARE\Mono\';hive='Microsoft.Win32.RegistryHive[]';.
Framework 'sscli-1.0' is invalid and has not been loaded : Framework directory '
C:\sscli\build\v1.x86fstchk.rotor' does not exist..
Thanks for your assistance. I did notice now that I actually was running the 1.1 framework. (I have the 2.0 RTM. installed but that is not recognized by NAnt)
How did you configure NAnt to use the 2.0 RTM?
Marco
C:\BUILD-~1\ADMINI~1>nant -verbose -buildfile:KBB.AdministrationTool.build
NAnt 0.85 (Build 0.85.1932.0; rc3; 4/16/2005)
Copyright (C) 2001-2005 Gerry Shaw
http://nant.sourceforge.net
Framework 'net-1.0' is invalid and has not been loaded : The 'System.dll' assemb
ly does not exist in framework assembly directory 'C:\WINDOWS\Microsoft.NET\Fram
ework\v1.0.3705'..
Framework 'net-2.0' is invalid and has not been loaded : Framework directory 'C:
\WINDOWS\Microsoft.NET\Framework\v2.0.40607' does not exist..
Framework 'mono-1.0' is invalid and has not been loaded : Registry Path Not Foun
d! - key='SOFTWARE\Mono\';hive='Microsoft.Win32.RegistryHive[]';.
Framework 'mono-2.0' is invalid and has not been loaded : Registry Path Not Foun
d! - key='SOFTWARE\Mono\';hive='Microsoft.Win32.RegistryHive[]';.
Framework 'sscli-1.0' is invalid and has not been loaded : Framework directory '
C:\sscli\build\v1.x86fstchk.rotor' does not exist..
Ian,
I tried it both with the 2.0 RTM and also with the 1.1 .NET framework. Both no luck.
I am able to get a labeled version through the Vault GUI Client.
The NAnt invoked task will get the subfolder structure. But does not retrieve the files. Considering that the sub folders are correctly created, I don't expect that it is a write access permission to the folder.
Files do not have a specific label. I'm trying to use the Folder labels what should be inherrited down to the files contained in that folder (correct me if I'm wrong here)
I also tried to replace all the nant properties values to the direct values. No change with that.
So basically the Vault login works, the path is correctly set. The folder structure is retrieved. But not any of the files.
Marco
I tried it both with the 2.0 RTM and also with the 1.1 .NET framework. Both no luck.
I am able to get a labeled version through the Vault GUI Client.
The NAnt invoked task will get the subfolder structure. But does not retrieve the files. Considering that the sub folders are correctly created, I don't expect that it is a write access permission to the folder.
Files do not have a specific label. I'm trying to use the Folder labels what should be inherrited down to the files contained in that folder (correct me if I'm wrong here)
I also tried to replace all the nant properties values to the direct values. No change with that.
So basically the Vault login works, the path is correctly set. The folder structure is retrieved. But not any of the files.
Marco
Can we run the Vault nant task with more verbose output to find out what the root cause of the problem is?
The folder structure is succefull created, however it seems to throw an exception on getting the first file. I'm running Nant as as admin on my box. So I should have all the possible folder read/write/create settings.
The folder structure is succefull created, however it seems to throw an exception on getting the first file. I'm running Nant as as admin on my box. So I should have all the possible folder read/write/create settings.
Last edited by marco on Fri Jan 27, 2006 9:17 am, edited 1 time in total.
Marco,
The NAnt tasks are open source; you can get the source from our public Vault repository here: http://vaultpub.sourcegear.com (user guest, password guest). You could add some logging to get additional output and build it yourself using your 3.1.6 libraries. Or better yet, step through it in the debugger.
As I mentioned, we've been unable to reproduce your problem with a number of permutations, so it's got to be something unique about your setup. Can you get the same label to the same location on disk (on the same machine) using the GUI client?
The NAnt tasks are open source; you can get the source from our public Vault repository here: http://vaultpub.sourcegear.com (user guest, password guest). You could add some logging to get additional output and build it yourself using your 3.1.6 libraries. Or better yet, step through it in the debugger.
As I mentioned, we've been unable to reproduce your problem with a number of permutations, so it's got to be something unique about your setup. Can you get the same label to the same location on disk (on the same machine) using the GUI client?
Ian Olsen
SourceGear
SourceGear
folder names that includes '.' is not properly recognized
Two issues
<ul>
<li> VaultLib Version 3.1.6.3658 does not have a method DeleteDirectoryRecursivelyIncludingReadOnly
Misc.DeleteDirectoryRecursivelyIncludingReadOnly(tmpdiskPath);
Can not compile. Temp resolution replaced with Directory.Delete....</li>
<li> Main problem: my Vault folder is $\folder1\folder2\folder.name.bla
The method IsVaultFolder can not find this in the Root.FindFolderRecursive
string normalizedPath = RepositoryPath.NormalizeFolder( folderName );
vaultClientFolder = ClientInstance.TreeCache.Repository.Root.FindFolderRecursive( normalizedPath );
Question What does NormalizeFolder do, and what does FindFolderRecursice do exactly
The results of the normalizedPath seems ok. But I don't know what the implemetation is of FindFolderRecursive.
</li>
</ul>
Marco
<ul>
<li> VaultLib Version 3.1.6.3658 does not have a method DeleteDirectoryRecursivelyIncludingReadOnly
Misc.DeleteDirectoryRecursivelyIncludingReadOnly(tmpdiskPath);
Can not compile. Temp resolution replaced with Directory.Delete....</li>
<li> Main problem: my Vault folder is $\folder1\folder2\folder.name.bla
The method IsVaultFolder can not find this in the Root.FindFolderRecursive
string normalizedPath = RepositoryPath.NormalizeFolder( folderName );
vaultClientFolder = ClientInstance.TreeCache.Repository.Root.FindFolderRecursive( normalizedPath );
Question What does NormalizeFolder do, and what does FindFolderRecursice do exactly
The results of the normalizedPath seems ok. But I don't know what the implemetation is of FindFolderRecursive.
</li>
</ul>
Marco