BookmarkSubscribeRSS Feed
ChrisHemedinger
Community Manager

I don't know much about the port-forwarding software you mention, but you can try the 8591 connection with another tool that I built called SasHarness, which is an example of a Microsoft .NET application connecting via SAS Integration Technologies.  You can get the tool (source and binaries) on my GitHub repository.

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
rf_mikael
Fluorite | Level 6

Thank you, I'll review. 

rf_mikael
Fluorite | Level 6

Chris, 

I have both ports forwarded now - 8561 and 8591. 

Tested by SAS Integration Technologies Configuration and shows success:

 

Congratulations! You have successfully established a connection with the SAS server. The details of the SAS server are below.

SAS Server Definition Information:
Machine DNS Name: localhost
Prog ID: SAS.Workspace.1.0
Class Identifier: 440196D4-90F0-11D0-9F41-00A024BB830C
Protocol: IOM Bridge
Encryption Level: Credentials
Encryption Algorithm(s): SASProprietary
Port: 8591
Service: sasobjspawn


But when I open EG it seems to connect but when I click on the SASapp to see the directory of files on the server, I get these errors:

 

Exception Details:
----------------------------------------
Exception type: SAS.EG.SDS.SDSException
Message: Could not establish a connection to the server on the requested machine. Verify that the server has been started and that the host and port of the server match the client's connection information.
Source: SAS.EG.SDS.Model
Target Site: SASWorkspace

Stack Trace:
at SAS.EG.SDS.Model.Server.SASWorkspace()
at SAS.EG.SDS.Views.View.DoPopulate(DisplayOperation& op)

Inner Exception Details:
----------------------------------------
Exception type: SAS.EC.Directory.Model.SDSException
Message: Could not establish a connection to the server on the requested machine. Verify that the server has been started and that the host and port of the server match the client's connection information.
Source: EC.Directory
Target Site: Connect

Inner Exception Details:
----------------------------------------
Exception type: System.Runtime.InteropServices.COMException
Message: Could not establish a connection to the server on the requested machine. Verify that the server has been started and that the host and port of the server match the client's connection information.
Source: SASObjectManager
Target Site: CreateObjectByLogicalNameAndLogins

Stack Trace:
at SASObjectManager.ObjectFactoryMulti2Class.CreateObjectByLogicalNameAndLogins(String Name, Boolean synchronous, Object pIOMI, String LogicalName, LoginDef pOMRLoginDef, LoginDef pSASLoginDef, String nameValuePairs)
at SAS.EC.Directory.Model.Server.Connect(ConnectionInfo connInfo)

 

What else does Enterprise Guide need to successfully connect?

rf_mikael
Fluorite | Level 6

Forwarded 8581 as well - still, the same error. 

ChrisHemedinger
Community Manager

I'm not familiar with the port forwarding mechanism, but if ITConfig works, then EG *should* work as well.  Do you have access to PowerShell?

 

You could try saving this script into a PS1 file and then running (pass your host name in as an argument).

 

if ($args.Count -eq 1)
{
  $host = $args[0] 
}
else
{
  Write-Host "EXAMPLE Usage: CheckServerHealth.ps1 <host-name or IP address>"
  Exit -1
}


$ports = @{
 8561  = "SAS Metadata Server"
 8591  = "SAS Workspace Server"
 8581  = "SAS Object Spawner Operator"
 8571  = "SAS Object Spawner Load Balancing"
 5451  = "SAS OLAP Server"
 8701  = "SAS Logical Pooled Workspace Server"
 8601  = "SAS Logical Stored Process Server"
 7551  = "SAS/Connect Spawner"
 8551  = "SAS/Share Server"
 5091  = "SAS Remote Services Registry"
 22031 = "SAS Framework Data Server"
 8080  = "SAS Web Application Server"
}

foreach ($port in $ports.Keys)
{
    $tcp = New-Object System.Net.Sockets.TcpClient
    try
    {
       $tcp.Connect($host,$port)
       Write-Host "SUCCESS: Connection to " $ports.Item($port) " on port " $port
    }
    catch
    {
      Write-Host "FAIL: Unable to connect to " $ports.Item($port) " on port " $port
      Write-Host "  " $_.Exception.Message
    }

}
It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
PaulHomes
Rhodochrosite | Level 12

It sounds like SSH tunneling is being used where an SSH connection is made to a SAS server (or another machine within the SAS servers network) and the SSH client opens ports on the workstation and forwards traffic to designated ports in the server network. This can be tricky because the SAS servers will return hostnames for the client to connect to and so those hostnames will have to be redirected to the localhost interface for the client to use the SSH tunnels.  I had tried this with mixed success with SAS in the past and ended up switching to using a VPN instead.

 

However for the use case you mentioned (SAS EG connects to the metadata server on tunnelled port 8561 and then to the object spawner on tunnelled port 8591) I was able to get it to succeed (although if you turn on EG logging you may see failures to connect on other ports such as 7980).

 

The process I followed, with the SSH server, SAS metadata server and SAS object spawner all running on the same server machine, was:

  1. Configure the server firewall to block all connections from the client except SSH port 22
  2. Edit the clients hosts file to redirect the server hostname(s) to localhost - this includes both short and fully qualified hostnames (e.g. 127.0.0.1 locahost sasserver sasserver.example.com). Whilst you might use localhost or 127.0.0.1 for the initial connection to the metadata server the connection to the object spawner will be done using the server name registered in metadata (e.g. sasserver.example.com). This has to also be redirected to localhost to use the tunnel. Of course, if this is being done for remote access for a mobile workstation, it will need to be reverted whenever the workstation returns to the target network.
  3. SSH to the server with the 2 tunnels e.g. ssh -v -L 8561:localhost:8561 -L 8591:localhost:8591  localhost is used here because the metadata server and object spawner are on the same machine where the remote end of the SSH tunnel is. Actual host names would be used if they were on different machines to the SSH server.
  4. Start up EG and use a profile that connects to sasserver on port 8561. With local host redirection this will send it to localhost port 8561 which will be forwarded over the SSH tunnel to remote localhost/sasserver port 8561
  5. Within EG expand SASApp to trigger the connection to the workspace server. The metadata query will return the object spawner host name and port (e.g. sasserver:8591) With local host redirection EG will connect to localhost port 8591 which will be forwarded over the SSH tunnel to remote localhost/sasserver port 8591
  6. Checking the object spawner log file you will see the client connection peer IP address is the SSH server machine where the remote end of the tunnel emerges (which may be 127.0.0.1 if the SSH server and object spawner are on the same machine).

This all worked for me so I am wondering if perhaps there is something amiss with either your local hostname redirections or tunnel configurations. Can you post details on your server topology, how you have edited the workstation hosts file and how you setup the SSH tunnels.

 

Also which version of SAS and EG are you using. My test above was with SAS 9.4 M0 and SAS EG 7.1.

 

Cheers

Paul

 

rf_mikael
Fluorite | Level 6

Resolved. 

 

Thanks, Paul. My IT guys understood your instructions. 

What we had to do was to forward three ports: 8561 (inbound/outbound), 8581, 8591

 

Then add this line to the "hosts" file on my local machine

C:\Windows\System32\Drivers\etc\

127.0.0.1       MYSASSERVER MYSASSERVER.MYDOMAIN.COM

 

EG access works fine now!

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 21 replies
  • 9099 views
  • 3 likes
  • 7 in conversation