MDSplus / mdsplus

The MDSplus data management system
https://mdsplus.org/
Other
71 stars 43 forks source link

MDSPlus does not support SSH connections? #2423

Open milligen opened 2 years ago

milligen commented 2 years ago

I installed the latest stable MDSplus package for OSX from https://www.mdsplus.org/index.php/Latest_Macintosh_Distributions.

I need to make a connection over SSH (instructions for my particular application: https://docs.psnc.pl/pages/viewpage.action?pageId=70879117)

Running the example python script, I get this:

Protocol SSH is not supported.
Error in connect
('in readExperimental, MDSplus failed: ', MdsIpException('Error connecting to ssh://jet',))

Looking in the directory /usr/local/mdsplus/lib, I see no libMdsIpSSH.dylib or libMdsIpTunnel.dylib.

Why is that? Doesn't the standard MDSplus package support SSH?

joshStillerman commented 2 years ago

It should, I will poke around and see what is going on.  There may be issues with Montery.  And I know you need sshpass.

What version of MACOS are you running ?  and what version of MDSplus ?

On 11/24/21 4:29 AM, milligen wrote:

I installed the latest stable MDSplus package for OSX from https://www.mdsplus.org/index.php/Latest_Macintosh_Distributions.

I need to make a connection over SSH (instructions for my particular application: https://docs.psnc.pl/pages/viewpage.action?pageId=70879117)

Running the example python script, I get this:

|Protocol SSH is not supported. Error in connect ('in readExperimental, MDSplus failed: ', MdsIpException('Error connecting to ssh://jet',)) |

Looking in the directory /usr/local/mdsplus/lib, I see no libMdsIpSSH.dylib or libMdsIpTunnel.dylib.

Why is that? Doesn't the standard MDSplus package support SSH?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/MDSplus/mdsplus/issues/2423, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABY5AZPGCXXRY7YU2ROS3S3UNSV6RANCNFSM5IVSA33Q. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

-- Joshua Stillerman Research Engineer MIT Plasma Science and Fusion Center 617.253.8176 @.***

milligen commented 2 years ago

My OSX is Mojave (10.14). The ssh authentication runs via public/private keys and appears to work (the command ssh -v yields "Authentication succeeded (publickey).") For MDSplus, I'm using the latest stable distribution, that's "MDSplus-7-96-17-osx.pkg" I'm worried the libMdsIpSSH.dylib and/or libMdsIpTunnel.dylib libraries are missing; did I fail to install something?

joshStillerman commented 2 years ago

I have mojave on my system, I can try an install and see.  I am finding that local MDSplus with the current alpha on mojave is not working well.  It is on my list to look into it

On 11/24/21 12:12 PM, milligen wrote:

My OSX is Mojave (10.14). The ssh authentication runs via public/private keys and appears to work (the command ssh -v yields "Authentication succeeded (publickey).") For MDSplus, I'm using the latest stable distribution, that's "MDSplus-7-96-17-osx.pkg" I'm worried the libMdsIpSSH.dylib and/or libMdsIpTunnel.dylib libraries are missing; did I fail to install something?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/MDSplus/mdsplus/issues/2423#issuecomment-978071339, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABY5AZILBPHXZED2G7OVFILUNUMHDANCNFSM5IVSA33Q. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

-- Joshua Stillerman Research Engineer MIT Plasma Science and Fusion Center 617.253.8176 @.***

joshStillerman commented 2 years ago

I have looked at this (at least in the alpha distro) SSH mdsip connections are implemented using scripts in /usr/local/mdsplus/bin in particular:

bin/mdsip-client-ssh
bin/mdsip-server-ssh
bin/mdsip-client-sshp

In order for this to work on Montery, /usr/local/mdsplus/bin needs to be in your PATH. Existing directions for modifying and creating environment variables described on https://www.mdsplus.org/ do not work. I think you need both PATH and DYLD_LIBRARY_PATH. Try:

export PATH=/usr/local/mdsplus/bin:$PATH
export DYLD_LIBRARY_PATH=/usr/local/mdsplus

Then ssh connections should work:

(base) jas@josh-macbook-pro bin % tditest
mdsconnect('ssh://alcdaq.psfc.mit.edu')
1
getenv('HOSTNAME')
""
getenv('HOST')
""
mdsvalue('getenv("HOSTNAME")')
"alcdaq6.psfc.mit.edu"

If things are different with stable let me know. -josh

milligen commented 2 years ago

That didn't work, unfortunately. I switched to alpha distro, but to no avail.

ls bin/mdsip*
bin/mdsip               bin/mdsip-client-ssh    bin/mdsip-server-ssh    bin/mdsiptest
bin/mdsip-client-http   bin/mdsip-client-sshp   bin/mdsip_server
bin/mdsip-client-local  bin/mdsip-server-http   bin/mdsipd

Looks OK. The PATH environment variable is OK (contains /usr/local/mdsplus/bin), but it is not possible to set DYLD_LIBRARY_PATH (the command is simply ignored). Apparently, this environment variable cannot be set on Mac, see https://developer.apple.com/forums/thread/13161

Testing mdsplus using tditest yields:

mdsconnect('ssh://jet')
1
getenv('HOSTNAME')
""
getenv('HOST')
"MacBook-Pro-de-Boudewijn.local"
mdsvalue('getenv("HOSTNAME")')
""

In any case, mdsconnect works from within tditest, but not from within Matlab:

status = mdsconnect('ssh://jet')

status =

    -1

mdsvalue('getenv("HOSTNAME")')

ans =

    'Java exception occurred: 
     MDSplus.MdsException: %TDI-E-UNKNOWN_VAR, Unknown/undefined variable name
        at MDSplus.Data.execute(Native Method)'

I also got mdsconnect/mdsvalue working from a c program, so I can now access JET data, which is the main thing. That it doesn't work from inside Matlab is inconvenient but I can live with that.

joshStillerman commented 2 years ago

status = mdsconnect('ssh://jet') Has to be _status = mdsconnect('ssh://jet')

WhoBrokeTheBuild commented 1 year ago

We will retest this on a clean Mac install and get back to you.

santorofer commented 1 year ago

I think this simply has to do with the fact that is not possible (or easy) to set the Mac desktop environment, as milligen mentioned above.

If you were to start Matlab from a Mac OSX terminal, where the environment is defined (e.g .zshrc contains the line source $MDSPLUS_DIR/setup.sh):

1- open a terminal 2- execute:

fsantoro at MacBook-Pro-81 in /Applications/MATLAB_R2023a.app/bin 
$ ./matlab

That seems to work fine. Have you tried that before?