Connection problem to local omero server using omero matlab toolbox

Hi there,
I’ve installed a local omero server on Ubuntu 18.04 with VMware. The host is Win10.
The server is running and the access via web client and omero.insight works well.

Then I’ve written a matlab script using the omero matlab toolbox to access the server.
I’ve tested the matlab script by using a test account on the ome-demoserver and it works fine.

Now I tried to connect my local server with the same script and I get an error message:

servername='192.168.204.129';
user='root';
password='*******';
client = loadOmero(servername)

client =

omero.client@3387ab0

session = client.createSession(user, password);

Java exception occurred:
Ice.ConnectionLostException

    error = 0

	at IceInternal.AsyncResultI.__wait(AsyncResultI.java:276)

	at Ice.ObjectPrxHelperBase.end_ice_isA(ObjectPrxHelperBase.java:310)

	at Ice.ObjectPrxHelperBase.ice_isA(ObjectPrxHelperBase.java:92)

	at Ice.ObjectPrxHelperBase.ice_isA(ObjectPrxHelperBase.java:69)

	at Ice.ObjectPrxHelperBase.checkedCastImpl(ObjectPrxHelperBase.java:2810)

	at Ice.ObjectPrxHelperBase.checkedCastImpl(ObjectPrxHelperBase.java:2770)

	at Glacier2.RouterPrxHelper.checkedCast(RouterPrxHelper.java:1787)

	at omero.client.getRouter(client.java:889)

	at omero.client.createSession(client.java:810)

Any ideas how to solve the problem?
Regards
Michael

Hi Michael,

the execption you posted, is this the full stack trace or did you cut it off? I wonder if the underlying problem is an SSL issue, which we’ve seen on Debian/Ubuntu servers before. If that’s the case you’d probably have the same issue with OMERO.insight. Can you log into your local server using Insight?

Kind Regards,
Dominik

Hi Dominik,
yes, it is the full stack trace shown in the matlab command window. I don’t now if there is any log file on the server where I could get more information.
From the host sytem (Windows 10) I can login with Insight to the server (running in VMware) without any problems. The web client works, too.

And you are running Matlab on the same Windows 10 host system, right? If you don’t have an issue with Insight connecting from there, then it’s probably not the SSL issue. I doubt there will be anything useful in the server logs, if the connection initialization already fails. But worth a try. It’s in the OMERO server directory: <SERVER_DIR>/var/log/Blitz-0.log . Can you see anything suspicious in there, when you run the Matlab code?

Matlab runs on the same machine, you are right. I cleared the Blitz log and tried once more but there are no entries related to the run of matlab script.
But the stack trace is different now:

Java exception occurred:
Ice.SecurityException

    reason = "IceSSL: handshake error"

	at IceInternal.AsyncResultI.__wait(AsyncResultI.java:276)

	at Ice.ObjectPrxHelperBase.end_ice_isA(ObjectPrxHelperBase.java:310)

	at Ice.ObjectPrxHelperBase.ice_isA(ObjectPrxHelperBase.java:92)

	at Ice.ObjectPrxHelperBase.ice_isA(ObjectPrxHelperBase.java:69)

	at Ice.ObjectPrxHelperBase.checkedCastImpl(ObjectPrxHelperBase.java:2810)

	at Ice.ObjectPrxHelperBase.checkedCastImpl(ObjectPrxHelperBase.java:2770)

	at Glacier2.RouterPrxHelper.checkedCast(RouterPrxHelper.java:1787)

	at omero.client.getRouter(client.java:889)

	at omero.client.createSession(client.java:810)

Caused by: javax.net.ssl.SSLException: Received fatal alert: handshake_failure

	at sun.security.ssl.Alerts.getSSLException(Alerts.java:208)

	at sun.security.ssl.SSLEngineImpl.fatal(SSLEngineImpl.java:1647)

	at sun.security.ssl.SSLEngineImpl.fatal(SSLEngineImpl.java:1615)

	at sun.security.ssl.SSLEngineImpl.recvAlert(SSLEngineImpl.java:1781)

	at sun.security.ssl.SSLEngineImpl.readRecord(SSLEngineImpl.java:1070)

	at sun.security.ssl.SSLEngineImpl.readNetRecord(SSLEngineImpl.java:896)

	at sun.security.ssl.SSLEngineImpl.unwrap(SSLEngineImpl.java:766)

	at javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:624)

	at IceSSL.TransceiverI.handshakeNonBlocking(TransceiverI.java:381)

	at IceSSL.TransceiverI.initialize(TransceiverI.java:33)

	at Ice.ConnectionI.initialize(ConnectionI.java:1921)

	at Ice.ConnectionI.message(ConnectionI.java:940)

	at IceInternal.ThreadPool.run(ThreadPool.java:395)

	at IceInternal.ThreadPool.access$300(ThreadPool.java:12)

	at IceInternal.ThreadPool$EventHandlerThread.run(ThreadPool.java:832)

	at java.lang.Thread.run(Thread.java:748)

Hi Miguelle
Which version of Matlab are you using? Matlab is shipped with its own Java version so that could be the source of the issue.
An option could be to start Matlab with a different version of Java.

Cheers
Jmarie

Hi,
I’m using ML 2019b. I’ve read the correspondig thread and the approach to use a different java version. But I’ve tested my script on the ome-demoserver and it works fine. So I think it is not related to the java version.
Thanks

Hi, I’ve tried another Matlab versions to establish the connection to my local server::

  • ML 2018a: script works
  • ML 2018b: script works
  • ML 2019b: works not
  • ML 2020a: works not

So the problem seems to be caused by Matlab (or its internal java)
Curiously the connection to the ome-demoserver can be established in all tested matlab versions, but the connection to my local server works only in Matlab 2018a/b.
Any ideas?

Additionally I’ve checked the java versions:

  • ML2018b: ‘Java 1.8.0_152-b16 with Oracle Corporation Java HotSpot™ 64-Bit Server VM mixed mode’
  • ML2019b: ‘Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot™ 64-Bit Server VM mixed mode’
  • ML2020a: ‘Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot™ 64-Bit Server VM mixed mode’

Finally I linked the java of ML2020 back to the java shipped with ML2018. Now the script works (using java 1.8.0_152-b16).
Nevertheless, the behavior is very strange that the script always is running on the ome-demoserver.

So it is not really a solution but an acceptable workaround.

Thanks for your investigation Miguelle! Could you give the https://github.com/ome/omero-certificates tool a try? It generates and assigns a self-signed SSL certificate to the OMERO.server. Often this resolves various SSL issues. Hopefully then it’s not necessary any longer to “hack” your Matlab installation.

Kind Regards,
Dominik