Vault cannot connect from Fedora

If you are having a problem using Vault, post a message here.
Post Reply
nphi
Posts: 4
Joined: Tue Jul 09, 2013 11:48 am

Vault cannot connect from Fedora

Post by nphi » Tue Jul 09, 2013 1:11 pm

Hello,

We are using Vault Pro 5.1, and typically have no troubles. We recently started an Android project that required us to develop on Linux platform. When trying to connect to our vault server from Fedora Linux, there is some strange behavior where vault is attempting to resolve the name of my workstation and the connection fails. This happens both in the Eclipse plugin and from the CLI vault tools.

I have tracked this issue to a fault in the InetAddress.getLocalHost() function on various Linux platforms. Please note that I do not have a static IP, so i cannot just edit the /etc/hosts file to neatly resolve this issue. You can see Sun's evaluation of the problem in Java here: http://bugs.sun.com/bugdatabase/view_bu ... id=4665037

Sun essentially closed the issue and said that the JDK NetworkInterface API should be used instead. Is there a chance that this deprecated function call can be replaced with the suggested API calls (perhaps it already is in newer versions?)

grievous-intersection is the hostname of my machine, here are the results of trying to connect to Vault:

From Eclipse Plugin:

Caused by: System.Exception: The connection to the server failed: server cannot be contacted or uses a protocol that is not supported by this client. grievous-intersection: grievous-intersection: Name or service not known ---> java.net.UnknownHostException: grievous-intersection: grievous-intersection: Name or service not known
at java.net.InetAddress.getLocalHost(InetAddress.java:1466)
at system.Net.Dns.GetHostName(Dns.cs:217)
at VaultClientNetLib.VaultConnection.get_MachineID(Unknown Source)
at VaultClientNetLib.VaultConnection.Login(Unknown Source)
at VaultClientOperationsLib.ClientInstance.Login(Unknown Source)
at VaultClientIntegrationLib.ServerOperations.Login(ServerOperations.cs:3407)
at VaultClientIntegrationLib.ServerOperations.Login(ServerOperations.cs:3537)
at com.sourcegear.vault.ui.commands.ConnectCommand.doRun(ConnectCommand.java:59)
at com.cdesg.core.command.Command.run(Command.java:80)
at com.cdesg.uihelper.command.RunnableWithProgressCommandAdapter.run(RunnableWithProgressCommandAdapter.java:67)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
--- End of inner exception stack trace ---
at clr.System.ExceptionStaticWrapper.ExceptionCtor(Unknown Source)
at VaultClientIntegrationLib.ServerOperations.Login(ServerOperations.cs:3418)
at VaultClientIntegrationLib.ServerOperations.Login(ServerOperations.cs:3537)
at com.sourcegear.vault.ui.commands.ConnectCommand.doRun(ConnectCommand.java:59)
at com.cdesg.core.command.Command.run(Command.java:80)
at com.cdesg.uihelper.command.RunnableWithProgressCommandAdapter.run(RunnableWithProgressCommandAdapter.java:67)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)

at clr.System.ExceptionStaticWrapper.ExceptionCtor(Unknown Source)
at VaultClientIntegrationLib.ServerOperations.Login(ServerOperations.cs:3418)
at VaultClientIntegrationLib.ServerOperations.Login(ServerOperations.cs:3537)
at com.sourcegear.vault.ui.commands.ConnectCommand.doRun(ConnectCommand.java:59)
at com.cdesg.core.command.Command.run(Command.java:80)
at com.cdesg.uihelper.command.RunnableWithProgressCommandAdapter.run(RunnableWithProgressCommandAdapter.java:67)
... 1 more

From vault CLI tools:

[user@grievous-intersection vaultproJavaCLC]$ ./vaultpro get -host <HOST> -user <USER> -password <PASSWORD> -workingfolder <FOLDER> <PROJECTNAME>
<vault>
<error>
<exception>System.Exception: The connection to the server failed: server cannot be contacted or uses a protocol that is not supported by this client. grievous-intersection: grievous-intersection: Name or service not known ---> java.net.UnknownHostException: grievous-intersection: grievous-intersection: Name or service not known
at java.net.InetAddress.getLocalHost(InetAddress.java:1466)
at system.Net.Dns.GetHostName(Dns.cs:217)
at VaultClientNetLib.VaultConnection.get_MachineID(Unknown Source)
at VaultClientNetLib.VaultConnection.Login(Unknown Source)
at VaultClientOperationsLib.ClientInstance.Login(Unknown Source)
at VaultClientIntegrationLib.ServerOperations.Login(ServerOperations.cs:3407)
at VaultClientIntegrationLib.ServerOperations.Login(ServerOperations.cs:3537)
at VaultCmdLineClient.VaultCmdLineClient.ProcessCommand(Unknown Source)
at VaultCmdLineClient.VaultCmdLineClient.$Main$(Unknown Source)
at VaultCmdLineClient.VaultCmdLineClient.main(Unknown Source)
--- End of inner exception stack trace ---
at clr.System.ExceptionStaticWrapper.ExceptionCtor(Unknown Source)
at VaultClientIntegrationLib.ServerOperations.Login(ServerOperations.cs:3418)
at VaultClientIntegrationLib.ServerOperations.Login(ServerOperations.cs:3537)
at VaultCmdLineClient.VaultCmdLineClient.ProcessCommand(Unknown Source)
at VaultCmdLineClient.VaultCmdLineClient.$Main$(Unknown Source)
at VaultCmdLineClient.VaultCmdLineClient.main(Unknown Source)
</exception>
</error>
<result>
<success>False</success>
</result>
</vault>[user@grievous-intersection vaultproJavaCLC]$

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Re: Vault cannot connect from Fedora

Post by lbauer » Tue Jul 09, 2013 2:52 pm

I don't think we've had reports of this before. We'll need to consult with our developers.

What version of Fedora are you using?
Linda Bauer
SourceGear
Technical Support Manager

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Re: Vault cannot connect from Fedora

Post by lbauer » Wed Jul 10, 2013 9:55 am

Could you run this from the command line:

Code: Select all

echo $USERDNSDOMAIN
Does that return anything?

If not, can you set the environment variable (export it as well) to the domain name of your network?

Next, see if you can log into Vault from Eclipse or the Java CLC.
Linda Bauer
SourceGear
Technical Support Manager

nphi
Posts: 4
Joined: Tue Jul 09, 2013 11:48 am

Re: Vault cannot connect from Fedora

Post by nphi » Wed Jul 10, 2013 11:07 am

lbauer wrote:I don't think we've had reports of this before. We'll need to consult with our developers.

What version of Fedora are you using?
I am using vanilla Fedora 18.

I should also mention I am using stock OpenJDK:

[user@grievous-intersection vaultproJavaCLC]$ alternatives --display java
java - status is manual.
link currently points to /usr/java/jdk1.7.0_21/jre/bin/java
/usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java - priority 170025
slave keytool: /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/keytool
slave orbd: /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/orbd
slave pack200: /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/pack200
slave rmid: /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/rmid
slave rmiregistry: /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/rmiregistry
slave servertool: /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/servertool
slave tnameserv: /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/tnameserv
slave unpack200: /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/unpack200
slave jre_exports: /usr/lib/jvm-exports/jre-1.7.0-openjdk.x86_64
slave jre: /usr/lib/jvm/jre-1.7.0-openjdk.x86_64
slave java.1.gz: /usr/share/man/man1/java-java-1.7.0-openjdk.1.gz
slave keytool.1.gz: /usr/share/man/man1/keytool-java-1.7.0-openjdk.1.gz
slave orbd.1.gz: /usr/share/man/man1/orbd-java-1.7.0-openjdk.1.gz
slave pack200.1.gz: /usr/share/man/man1/pack200-java-1.7.0-openjdk.1.gz
slave rmid.1.gz: /usr/share/man/man1/rmid-java-1.7.0-openjdk.1.gz
slave rmiregistry.1.gz: /usr/share/man/man1/rmiregistry-java-1.7.0-openjdk.1.gz
slave servertool.1.gz: /usr/share/man/man1/servertool-java-1.7.0-openjdk.1.gz
slave tnameserv.1.gz: /usr/share/man/man1/tnameserv-java-1.7.0-openjdk.1.gz
slave unpack200.1.gz: /usr/share/man/man1/unpack200-java-1.7.0-openjdk.1.gz
/usr/java/jdk1.7.0_21/jre/bin/java - priority 20000
slave keytool: (null)
slave orbd: (null)
slave pack200: (null)
slave rmid: (null)
slave rmiregistry: (null)
slave servertool: (null)
slave tnameserv: (null)
slave unpack200: (null)
slave jre_exports: (null)
slave jre: (null)
slave java.1.gz: (null)
slave keytool.1.gz: (null)
slave orbd.1.gz: (null)
slave pack200.1.gz: (null)
slave rmid.1.gz: (null)
slave rmiregistry.1.gz: (null)
slave servertool.1.gz: (null)
slave tnameserv.1.gz: (null)
slave unpack200.1.gz: (null)
Current `best' version is /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java.
Last edited by nphi on Wed Jul 10, 2013 11:39 am, edited 2 times in total.

nphi
Posts: 4
Joined: Tue Jul 09, 2013 11:48 am

Re: Vault cannot connect from Fedora

Post by nphi » Wed Jul 10, 2013 11:30 am

lbauer wrote:Could you run this from the command line:

Code: Select all

echo $USERDNSDOMAIN
Does that return anything?

If not, can you set the environment variable (export it as well) to the domain name of your network?

Next, see if you can log into Vault from Eclipse or the Java CLC.
Unfortunately my network configuration is a bit different today, I am working remotely connected to a VPN instead of being directly on our work network.

This environment variable was not defined, but exporting it didn't seem to make a difference one way or another (I set it to a variety of values and my results below were the same regardless).

Strangely while testing this, I got the CLI tools ttrangely while testing this, I got the CLI tools to work even though the exception appeared. The below call worked, and it did pull the project successfully. Unfortunately the eclipse plugin still chokes on this exception and fails.o work even though the exception appeared. The below call worked, and it did pull the project successfully. Unfortunately the eclipse plugin still chokes on this exception and fails.

{EDIT} OK, I take this back. Exporting this environment variable is definitely what allowed the CLI tools to work. It doesn't matter *what* the environment variable is set to, just as long as it is set to *something*. When I used

Code: Select all

unset USERDNSDOMAIN
the CLI tools stopped working just as previously reported. When using

Code: Select all

export USERDNSDOMAIN=""
the CLI tools work like below.

[/code][user@grievous-intersection vaultproJavaCLC]$ ./vaultpro get -host <host> -repository <repository> -user <user> -password <password> -workingfolder <localpath> <vaultpath>
java.net.UnknownHostException: grievous-intersection: grievous-intersection: Name or service not known
at java.net.InetAddress.getLocalHost(InetAddress.java:1466)
at system.Environment.get_MachineName(Unknown Source)
at VaultClientNetLib.VaultConnection.get_MachineID(Unknown Source)
at VaultClientNetLib.VaultConnection.Login(Unknown Source)
at VaultClientOperationsLib.ClientInstance.Login(Unknown Source)
at VaultClientIntegrationLib.ServerOperations.Login(ServerOperations.cs:3407)
at VaultClientIntegrationLib.ServerOperations.Login(ServerOperations.cs:3537)
at VaultCmdLineClient.VaultCmdLineClient.ProcessCommand(Unknown Source)
at VaultCmdLineClient.VaultCmdLineClient.$Main$(Unknown Source)
at VaultCmdLineClient.VaultCmdLineClient.main(Unknown Source)
Caused by: java.net.UnknownHostException: grievous-intersection: Name or service not known
at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:894)
at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1286)
at java.net.InetAddress.getLocalHost(InetAddress.java:1462)
... 9 more
<vault>
<result>
<success>True</success>
</result>
</vault>

nphi
Posts: 4
Joined: Tue Jul 09, 2013 11:48 am

Re: Vault cannot connect from Fedora

Post by nphi » Wed Jul 10, 2013 11:56 am

lbauer wrote:Could you run this from the command line:

Code: Select all

echo $USERDNSDOMAIN
Does that return anything?

If not, can you set the environment variable (export it as well) to the domain name of your network?

Next, see if you can log into Vault from Eclipse or the Java CLC.

Since my last post was getting messy...

Somehow just having this environment variable exported (to anything) resolves all my problems.

Indeed, if I export this and then start eclipse from the command line the eclipse plugin also works.

Even though it still complains that it can't resolve my machine name, it at least connects through to vault and works as expected. Now if I could just get it exported when starting eclipse from Gnome menu...

Regardless, this is enough of a solution for me. I appreciate it!

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Re: Vault cannot connect from Fedora

Post by lbauer » Wed Jul 10, 2013 3:10 pm

Glad that worked for you!

You might try to export USERDNSDOMAIN from the ".profile" file in your home directory. This file gets sourced at login, so $USERDNSDOMAIN *should* then get passed to eclipse when it's started from Gnome menu.
Linda Bauer
SourceGear
Technical Support Manager

Post Reply