*VIEWER* with SSH

Started by Ned L, January 10, 2019, 12:55:54 PM

Previous topic - Next topic

Ned L

I am helping a client move an existing Providex Plus application to a new server.
On the new server, when trying to execute:
   OPEN (7) "*VIEWER*"
they get the following error:

0134 LET ParametersSoftware=NEW("*viewer/parameters","*viewer/software.prm")
Error #99: Feature not supported
   Current program is /pxplus/lib/_dev/preview, line 134


I found a post on this forum "How can I spawn a process when using WindX and SSH" (July 12, 2018)
and based on it, I tried setting
   %PXPLUS_HOST$="*x.x.x.x;22" (where x.x.x.x is the IP address of the server)
but that didn't seem to make any difference.
That same post suggests running *plus/cs/host in the background.  How would I do that? 

Details:
They have been running Providex 9.1 On Red Hat Enterprise Linux 5.3
The new system runs Providex 15 on Red Hat Enterprise Linux 7.6

They have been connecting sessions using
"C:\PVX Plus Technologies\Windx Plugin V10\pxplus.exe" WindX
and *VIEWER* has been working with no problems.

Under the new system, they connect using
"C:\PVX Plus Technologies\Windx Plugin 2018\pxplus.exe", with connection type SSH

Is there a way to give them access to *VIEWER* using the SSH connection?
If not, is there a recommended alternate way to connect that WOULD give them access the *VIEWER* ?

Thanks in advance for any assistance.

Ned Lee
QA Solutions Division, AMS Software



Mike King

An SSH connection requires each session to log in to the server thus you cannot directly use any functionality that spawns a separate process such as SSH.

What you can to is make sure there is an open port on your server and set %PXPLUS_HOST$ as described in our online documentation regard *windx.utl;spawn.
(see last part of https://manual.pvxplus.com/page/windx/windxutl.htm)

So for example if your host is at IP address 192.168.1.123 and you open up port 20000 then you could set %PXPLUS_HOST$ to

*192.168.1.123;20000




Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

Ned L

Mike -
Thank you for your response!
But I need more guidance.
1) In your example, does 'open up port 20000' refer to specifying a port that the host firewall considers 'open'?  Or is it just 'any' port number?

2) My client has a 40 user license.  It is possible that more than one user will try to use *VIEWER* simultaneously. Can I use a hard-coded port number in the program (which would mean multiple users would use the same port number)?  If not, is there simple way for the PVX program to determine a separate port number for each user and set %PXPLUS_HOST$ appropriately?

Sorry if I'm being dense.   I really do appreciate your help.
- Ned

Mike King

#3
The 20000 can be any port you want, it just has to be open on your server so that the workstation can make an in-bound connection to it.

As for multiple users, the logic used to spawn a process does the following:


  • Generates a random key (session ID)
  • Write this key to a control file
  • Locks a control record on the same control file to assure  only one process is doing starting up/connecting at a time
  • Spawns a process on the server to monitor the selected port.  This process will listen for incoming connection on the specified port.
  • Spawns a process on the workstation passing it the host address, port and random key
  • Waits for the record with the session id to be removed (max 30 seconds)
  • Removes lock from control record and exits back to process

When the workstation connects to the host the process, it passes it the random key.  The spawned host process then stop listening for any more connections and removes the key from the control file completing the connection which can then be used to run the viewer or any other program.

The above process means only one port is needed and can be shared between users.
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

Ned L

Mike -
I am still having trouble.
Should the IP address in %PXPLUS_HOST$ be the address of the server, or the IP address of the Windows machine running Windx?  I've tried both, and the IT guy of my client has tried opening the firewall (for tcp) on both systems.

Restating the question:
Assume the the server is IP address 1.2.3.1 and WindX is running on 4.5.6.7 and an available port is 2000.
Should %PXPLUS_HOST$ be
*1.2.3.1;2000
or
*4.5.6.7;2000
or something else?

Also, if the value should be 4.5.6.7;2000 (which will be different on each user's WindX) what is an easy way for PxPlus sessions to determine their own IP address?

Thanks for your your help.
- Ned

Mike King

Assuming you are using WindX to connect to your host/server.

The IP address should be the same as you provided to WindX, just the port number needs to change as port 22 is the SSH connection port.

You should be able to the firewall/connection as follows:

On one WIndX session:

  OPEN (1) "[TCP];20000"
  READ RECORD (1) R$
  WHILE 1
  READ RECORD (1,TIM=1 :(,ERR=*BREAK) R$
  PRINT R$
  WEND
  PRINT (1) "HTTP/1.1 200 OK"
  PRINT (1) "Content-type: text/plain",'lf'
  PRINT (1) "Hello There"
  CLOSE (1)


Then on your workstation open a browser and navigate to

  http://x.x.x.x:20000

Where x.x.x.x is the IP address of your server.

The first session will wait for a connection on port 20000 (or whatever port you chose).  When the browser connects it will respond with "Hello There".  Make sure you use the server IP address not its network name to avoid a browser error.
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

Ned L

Mike -
Thank you for your patience and ongoing help.
I am still getting
    0134 LET ParametersSoftware=NEW("*viewer/parameters","*viewer/software.prm")
    Error #99: Feature not supported
    Current program is /pxplus/lib/_dev/preview, line 134
when I try to
    OPEN (7) "*VIEWER*"
I am using
"C:\PVX Plus Technologies\Windx Plugin 2018\pxplus.exe"
to start WindX, connection type SSH, port 22

I think I've done everything you've said to do (see below).  The IT guy at the client says he has opened port 20000 fully, and when I do the test program you suggested, he can see traffic on port 20000, followed by a 'random' port opening.

FYI:
I have done what you suggested, and the test program you suggested now works as you said it would.  (It waits until my browser (on the WindX PC) asks for a connection, and then displays


GET / HTTP/1.1
Accept: application/x-ms-application, image/jpeg, application/xaml+xml, image/gi
f, image/pjpeg, application/x-ms-xbap, application/vnd.ms-excel, application/vnd
.ms-powerpoint, application/msword, */*
Accept-Language: en-US
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/7.
0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C;
.NET4.0E)
Accept-Encoding: gzip, deflate
Host: nn.nn.nn.nn:20000
Connection: Keep-Alive


and stops.

Any further suggestions?)
- Ned


EVa

Ned,

What's the output of PKG when entered in console mode ?

-Eric-

Ned L

Eric -
Sorry for the delay in responding, and thank you for your response.
Here's what I get:
PxPlus Type         = Professional
Expiry Date         = none
User Count          = 40
Version Information = 15000002 / Activation Level 15

*****  Activated Packages  *****
20001  Internet Toolkit                 20003  SSL Support
20004  Multiple Image Type Support      20005  Smart Controls
20006  Chart Control                    20007  Customizer
20008  Views                            20010  BBx Keyed File Read
20011  OLE Server                       20012  Report Writer
20013  Thin Client Plug-in              20014  MySQL
20017  Native Oracle Support            20018  Native DB2 Support
20019  ADO Interface to MS Sql          21020  eSignature

*****  Separately Activated Packages  *****
7587   PxPlus Enabled                 Expiry Date=none

*****  Non-Activated Packages  *****
20002  Web Server                       20009  Application Server
20015  XML                              20020  PxServer
20021  MyTiles

EVa

Ned,


Can you start the trace window and enable host tracing (& log all errors) and tell us on what line in which program you are getting the error 99 ?


-Eric-

Ned L

Eric -
Thank you for your continuing assistance.
Thanks for suggesting the trace.
The problem seems to be in
*viewer/parameters.pvc
in the OnCreate: section:
0611 WEND
0612 CADone:
0613 IF Counter>0 THEN RETURN 1 ELSE RETURN 0
0616 END DEF
0618 OnCreate:
0619 ENTER _._._.FileName$,ERR=*NEXT
0620 IF _._._.FileName$="" THEN LET _._._.FileName$="*usr/applications.prm"
0622 LET _._._.Channel=HFN
0623 OCRetryOpen:
0624 OPEN OBJECT (_._._.Channel,KEY="*PaRaMTr",ERR=OC_OpenErr)_._._.FileName$
0641 OC_OpenErr:
0642 IF ERR=12 THEN {KEYED _._._.FileName$,[1:1:10:"+"],[2:1:32:"C"]+[3:1:96:"C
0642:U"]+[4:1:50:"C"]+[5:1:50:"C"]+[6:1:5],[4:1:50:"C"]+[2:1:32:"C"]+[3:1:96:"C
0642:"]+[6:1:5],[5:1:50:"C"]+[2:1:32:"C"]+[3:1:96:"C"]+[6:1:5],0,-30000,OPT="X"
0642:,SEP=*,BSZ=31
0653  }
0654 EXIT ERR
0656 OnDelete:
0657 IF _._._.Channel THEN CLOSE (_._._.Channel)
0659 RETURN
0001 REM "RDK/MMS UTILITIES - AMS GENERIC ERROR HANDLER"
0002 REM "AMSERR"


(Line 0001 indicates the place our error handler is triggered.)
Does the above trace tell you anything?
- Ned




EVa

Ned,


You are getting an error at this line:

0624 OPEN OBJECT (_._._.Channel,KEY="*PaRaMTr",ERR=OC_OpenErr)_._._.FileName$

The program then jumps to:

0641 OC_OpenErr:

And you get another error at this line:

0642 IF ERR=12 THEN { KEYED _._._.FileName$,[1:1:10:"+"],[2:1:32:"C"]+[3:1:96:"C

So it appears that _._._.FileName$ is causing a problem.  The filename comes from the ENTER at line 619 (*viewer/parameters.pvc).  Try adding this line of code to *viewer/parameters.pvc to identify the name of that file:

0621 MSGBOX "Filename = "+_._._.filename$,"Info"

That will at least tell us what file is the cause of the error.


-Eric-

Ned L

Eric -
Thanks for hanging in there with me...
The MSGBOX shows the filename as
*viewer/software.prm

When I went to /pxplus/lib/_viewer
I saw that software.prm had a timestamp of January 8th and was owned by the Linux account my clients and I log in with, and permissions -rw-rw-rw-.
I tried renaming the file so that line 642 would get an Error 12 and recreate the file. It did, but I'm still getting an Error 99.

I'm at the point that I need to call PxPlus tech support, and will do so. 
But if you have any further ideas, please let me know.
Thank you for your interest and all your assistance!
- Ned