connection issue


I recently installed OMERO on a Ubuntu VM using this docker-compose file

The following was working properly:

  • connections from outside with omero web
  • connections from outside with omero.insight

(here outside means a Windows 10 x64 computer on the local network)

But then I realized that connecting from was not working. I had the same problem as described here Trouble connecting to omero server with Python

I tried to use OMERO CLI and I got the same result as @jsakkos, i.e. :

`WARNING:omero.client:..Ignoring error in client.__del__:<class 'Ice.SecurityException'> InternalException: 
Failed to connect: exception ::Ice::SecurityException {     
reason = SSL handshake failure: The parameter is incorrect. }`

So I used the same docker-compose project he suggested and I have now a functional ssl connection for the omero.web (which is nice!).

Now the following things are working :

  • connections with omero web (including ssl)
  • connections with omero.insight
  • connections with omero cli

But still, impossible to connect using I tried both from the Ubuntu VM (server) and from my Windows computer. I have:

import omero.clients
from omero.gateway import BlitzGateway

conn = BlitzGateway('root', 'omero', host='localhost', port=4064)
ConnectionRefusedException                Traceback (most recent call last)
<ipython-input-1-0d611f53a321> in <module>
      4 conn = BlitzGateway('root', 'omero', host='localhost', port=4064)
----> 5 conn.connect()

~/anaconda3/envs/omero/lib/python3.8/site-packages/omero/gateway/ in connect(self, sUuid)
   2227                 try:
   2228                     logger.debug("Creating Session...")
-> 2229                     self._createSession()
   2230                     logger.debug("Session created")
   2231                 except omero.SecurityViolation:

~/anaconda3/envs/omero/lib/python3.8/site-packages/omero/gateway/ in _createSession(self)
   2098             # the group
   2099             self.c.sf.getAdminService().getEventContext()
-> 2100         self.setSecure(
   2101         self.c.sf.detachOnDestroy()
   2102         self.SERVICE_OPTS = self.createServiceOptsDict()

~/anaconda3/envs/omero/lib/python3.8/site-packages/omero/gateway/ in setSecure(self, secure)
   2066         if hasattr(self.c, 'createClient') and (secure ^ self.c.isSecure()):
   2067             oldC = self.c
-> 2068             self.c = oldC.createClient(secure=secure)
   2069             oldC.__del__()  # only needs to be called if previous doesn't throw
   2070             self._createProxies()

~/anaconda3/envs/omero/lib/python3.8/site-packages/omero/ in createClient(self, secure)
    441         nClient.__insecure = not secure
    442         nClient.setAgent("%s;secure=%s" % (self.__agent, secure))
--> 443         nClient.joinSession(self.getSessionId())
    444         return nClient

~/anaconda3/envs/omero/lib/python3.8/site-packages/omero/ in joinSession(self, session)
    591         and password to rejoin a running session
    592         """
--> 593         return self.createSession(session, session)
    595     def createSession(self, username=None, password=None):

~/anaconda3/envs/omero/lib/python3.8/site-packages/omero/ in createSession(self, username, password)
    651                         ctx[omero.constants.IP] = self.__ip
    652                     rtr = self.getRouter(self.__ic)
--> 653                     prx = rtr.createSession(username, password, ctx)
    655                     # Create the adapter

~/anaconda3/envs/omero/lib/python3.8/site-packages/ in createSession(self, userId, password, _ctx)
    256         """
    257         def createSession(self, userId, password, _ctx=None):
--> 258             return _M_Glacier2.Router._op_createSession.invoke(self, ((userId, password), _ctx))
    260         """

ConnectionRefusedException: Ice.ConnectionRefusedException:
Connection refused

Could someone help me?

Can you try changing host='localhost' to the address of your OMERO server, either it’s DNS address or it IP?

My bad,

I was just missing the secure flag :laughing:

conn = BlitzGateway('root', 'omero', host='localhost', port=4064, secure=True)

@manics this example was from the Ubuntu vm itself, when I try from outside I use the IP address.

So now it works ! But only encrypted.

I guess the encrypted connection is slower, is it possible to configure OMERO to allow using both ?

Or if not possible, what should I change here: to use the non encrypted version ?

Thanks in advance

I think you can change this line

to ssl,tcp,wss to add unencrypted TCP connections.

If you do some benchmarking on encrypted vs unencrypyted connections could you share your results, as this will help us decide whether defaulting to fully encrypted connections in the future is a good idea or not. Thanks!

1 Like