0
Not a bug

Exception: Unable to contact Server

Timothy Boyden 2 years ago in Studio updated 2 years ago 4

Trying to connect local instance of Studio to remote instance of Server. Receiving error "Exception: One or more errors occurred. Inner Exception: Unable to contact Server".

I tried debugging this with the source version of Studio in Visual Studio this morning. When clicking the New button, the code throws an exception and execution pauses. Attached are the messages from the Visual Studio output window.

New button exception messages.txt

I click continue in Visual Studio so I can test the Test Server function. That throws another exception, messages attached.

Test Server exception messages.txt

Image 961

The messages themselves are not helpful for that exception message. But here are the data contents of the comsController object:

ServicePayload --> args(0) --> {[ServerSource, {{"$id":"1","$type":"Dev2.Common.ServerSource, Dev2.Common","ServerName":null,"Address":"http://192.168.1.190:3142","AuthenticationType":3,"UserName":null,"Password":null,"TestCommand":null,"TestMessage":null,"ID":"04bb532e-2b67-413c-973f-fdbb1551381b","Name":null,"ResourcePath":null}}]}

It looks like the Test Connection button is trying to execute the test against the localhost server instead of the specified remote server. Here are the screenshotted contents of the connection object uses in the comsController.ExecuteCommand call:

Image 962

Because there is no local server running, I would expect that call to return null, and thus throw an exception per the code. Because it throws an exception, no log entry is being made for the failed Test Connection call. Hence why no attempt shows up in the Warewolf Studio logs. Attaching the log anyways, even though it doesn't show any of the above activity occurring:


Warewolf Studio.log

Here is the server log when doing the remote Hello World test via the local web browser:

wareWolf-Server.log

studio
Not a bug

That error is expected if there is no local server running. Test connection tests the connection between two servers, localhost and the remote server.

You have to run two servers (one local, one remote) just to use the client application locally for a remote machine? How does that even make sense? That's the equivalent of saying I have to run SQL Server locally just to use SSMS for a remote SQL Server. It may not be a bug, but it certainly is a very poor client-server design.

You can use
http://[[REMOTE SERVER ADDRESS]]:3142/secure/getserverversion.json
or
http://[[REMOTE SERVER ADDRESS]]:3142/secure/ping.json
To test your connection to a remote server.

EDIT: Where [[REMOTE SERVER ADDRESS]] is the hostname or IP address of the remote server.

It's not about testing it, it won't let you add the remote server to your server list unless the test succeeds. Ideally, the test would be optional or remove the local server dependency, and that would solve the issue.