Cannot get Ant Tasks to work after Vault 8 upgrade

If you are having a problem using Vault, post a message here.

Moderator: SourceGear

jstarbird
Posts: 146
Joined: Wed Jul 22, 2009 11:49 am

Cannot get Ant Tasks to work after Vault 8 upgrade

Post by jstarbird » Wed Jul 22, 2015 1:25 pm

We just upgraded to 8 and I got the 8 Ant tasks, installed them, and when I go to use them I keep getting a Null Pointer exception.
I've rebooted, verified files, etc.
The error occurs when I call vaultsetloginoptions and yes all the parameters have values so the Null Pointer exception doesn't make much sense.
I've changed nothing in this environment other than installing Vault 8 so this was all working prior to the upgrade.

The exact error info is:
java.lang.NullPointerException
at com.sourcegear.ant.tasks.VaultSetLoginOptions.execute(Unknown Source)

at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
a:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:435)
at org.apache.tools.ant.Target.performTasks(Target.java:456)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe
cutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
at org.apache.tools.ant.Main.runBuild(Main.java:851)
at org.apache.tools.ant.Main.startAnt(Main.java:235)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)


Thanks,
J

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: Cannot get Ant Tasks to work after Vault 8 upgrade

Post by Beth » Wed Jul 22, 2015 2:19 pm

Can you tell me the version from which you upgraded?

Did you upgrade in one step or through multiple versions?
Beth Kieler
SourceGear Technical Support

jstarbird
Posts: 146
Joined: Wed Jul 22, 2009 11:49 am

Re: Cannot get Ant Tasks to work after Vault 8 upgrade

Post by jstarbird » Wed Jul 22, 2015 2:34 pm

We were on 7.1.0 and upgraded to 8.0.1.
It was just a straight upgrade to 8.0.1.

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: Cannot get Ant Tasks to work after Vault 8 upgrade

Post by Beth » Wed Jul 22, 2015 3:16 pm

When you upgraded, did you switch machines at all, or was this an in-place upgrade?

Did you upgrade the Ant tasks to what was compiled with Vault 8? If using Vault Standard, this is what you would want: http://download.sourcegear.com/Vault/8. ... _1_299.zip.
Beth Kieler
SourceGear Technical Support

jstarbird
Posts: 146
Joined: Wed Jul 22, 2009 11:49 am

Re: Cannot get Ant Tasks to work after Vault 8 upgrade

Post by jstarbird » Wed Jul 22, 2015 4:02 pm

No it's the same system and I can use Vault fine via command line, UI Client, even via Jenkins plugin that uses the command line.
The Ant task isn't having a problem connecting as I have had those errors before and they are different, unless that was changed.
This is like it can't find part of the Vault Ant libs but I've verified they are all there and yes they are the Standard version as that is what we have. Or at least that is the package I used.

Just to let you know I tried using Ant's debug and verbose but it doesn't give me any additional useful info.

jstarbird
Posts: 146
Joined: Wed Jul 22, 2009 11:49 am

Re: Cannot get Ant Tasks to work after Vault 8 upgrade

Post by jstarbird » Wed Jul 22, 2015 6:43 pm

Some info I kept forgetting to post, this occurs with both Ant 1.9.2 and Ant 1.9.6.
It also is happening on multiple systems.

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: Cannot get Ant Tasks to work after Vault 8 upgrade

Post by Beth » Thu Jul 23, 2015 8:03 am

My concern is that you have the Vault 8 version of the Ant libraries. With the error being on vaultsetloginoptions, I would question whether it really is completing a login.

Can you take the exact options you have set for vaultsetloginoptions, and try them in either a Vault GUI client or a Vault CLC?
Beth Kieler
SourceGear Technical Support

jstarbird
Posts: 146
Joined: Wed Jul 22, 2009 11:49 am

Re: Cannot get Ant Tasks to work after Vault 8 upgrade

Post by jstarbird » Thu Jul 23, 2015 12:44 pm

I've done that already. As I said it works from these systems via CLC, same credentials, same everything.
Also the GUI client also works fine again with the same everything.

jstarbird
Posts: 146
Joined: Wed Jul 22, 2009 11:49 am

Re: Cannot get Ant Tasks to work after Vault 8 upgrade

Post by jstarbird » Thu Jul 23, 2015 12:57 pm

btw, I dont't think it ever completes a login. I believe the error I'm getting looks to me like either a Vault lib isn't being found or is misconfigured somehow.
Can you take the same zip, the Vault 8 Standard Ant Tasks, with Ant 1.9.2 or 1.9.6 and have it work correctly there?

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: Cannot get Ant Tasks to work after Vault 8 upgrade

Post by Beth » Thu Jul 23, 2015 2:03 pm

I'll get an environment together with Ant.

Could you send me your Vault server log found on the Vault server at %windir%\temp\sgvault\sgvault.log? You can either post it here or send it in an email to support at sourcegear.com (attn: Beth) with a link to this forum thread.
Beth Kieler
SourceGear Technical Support

jstarbird
Posts: 146
Joined: Wed Jul 22, 2009 11:49 am

Re: Cannot get Ant Tasks to work after Vault 8 upgrade

Post by jstarbird » Fri Jul 24, 2015 2:14 pm

I can get it but it shows nothing. The server is never reached.
I even ran it again just now to verify and there isn't even a login acknowledgment.

jclausius
Posts: 3702
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Re: Cannot get Ant Tasks to work after Vault 8 upgrade

Post by jclausius » Fri Jul 24, 2015 2:51 pm

Can you post (obfuscate if necessary) a quick Ant script we could use for testing? It would save us some steps for implementing a script trying to create a script in the same task order your script uses.
Jeff Clausius
SourceGear

jstarbird
Posts: 146
Joined: Wed Jul 22, 2009 11:49 am

Re: Cannot get Ant Tasks to work after Vault 8 upgrade

Post by jstarbird » Fri Jul 24, 2015 4:37 pm

The piece I use is for Labeling and it's a small target(function) in a large Ant script so here is that part.

<target name="LabelBuild" description="Labeling source with label">
<vaultsetloginoptions user="${vault_user}" password="${vault_user_pd}" URL="${env.VAULT_SERVER_URL}" repository="${env.VAULT_REPO}" />
<echo>Labeling $/${vault_branch1} with label - v${build_major_number}.${build_minor_number}.${build_revision_number}.${build_build_number}</echo>
<vaultlabel objectPath="$/${vault_branch1}" versionID="-1" labelName="v${build_major_number}.${build_minor_number}.${build_revision_number}.${build_build_number}"/>
</target>

I've echoed out, just before the set login options task, the variables used and they are all valid and again they are all the same as was used prior to Vault 8 upgrade and also the same values I can use from the CLC or UI without issue.

jclausius
Posts: 3702
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Re: Cannot get Ant Tasks to work after Vault 8 upgrade

Post by jclausius » Mon Jul 27, 2015 8:11 am

Thanks.

As you may have guessed, nothing was changed in the foundation classes from Vault 7 to Vault 8 in regards to Ant. We're trying to set up an environment as close as we can to yours ( first with Vault 7 and then upgrading to Vault 8 ) to recreate the behavior.

Thanks for your patience.
Jeff Clausius
SourceGear

jclausius
Posts: 3702
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Re: Cannot get Ant Tasks to work after Vault 8 upgrade

Post by jclausius » Mon Jul 27, 2015 11:02 am

Seeing the same behavior with Vault 7. You're saying Vault 7 worked in your case, correct?
Jeff Clausius
SourceGear

Post Reply