Warning: Can't synchronize with repository "(default)" (/home/git/ome.git does not appear to be a Git repository.). Look in the Trac log for more information.
Notice: In order to edit this ticket you need to be either: a Product Owner, The owner or the reporter of the ticket, or, in case of a Task not yet assigned, a team_member"

Bug #1518 (closed)

Opened 15 years ago

Closed 15 years ago

OMERO in subprocess under Windows without full environment causes SocketException

Reported by: jamoore Owned by: jamoore
Priority: blocker Cc: dzmacdonald
Sprint: n.a.
Total Remaining Time: n.a.

Description

Under Windows, OmeroScripts were failing with:

Traceback (most recent call last):
 File "./script", line 29, in <module>
   client = s.client(uuid, "simple ping script", s.Long("a").inout(), s.String("b").inout())
 File "C:\hudson\workspace\omero-windows-integration\trunk\dist\lib\python\omero\scripts.py", line 119, in client
   kwargs["client"] = omero.client()
 File "C:\hudson\workspace\omero-windows-integration\trunk\dist\lib\python\omero\__init__.py", line 19, in client
   return omero.clients.BaseClient(*args, **kwargs)
 File "C:\hudson\workspace\omero-windows-integration\trunk\dist\lib\python\omero\clients.py", line 130, in __init__
   self._initData(id)
 File "C:\hudson\workspace\omero-windows-integration\trunk\dist\lib\python\omero\clients.py", line 237, in _initData
   self.__oa = self.__ic.createObjectAdapter("omero.ClientCallback")
 File "C:\Ice-3.3.1\python\Ice.py", line 274, in createObjectAdapter
   adapter = self._impl.createObjectAdapter(name)
Ice.SocketException: Ice.SocketException:
Unknown error
WARNING:omero.client:Ignoring error in client.__del__:<class 'Ice.DNSException'>

The following reproduced:

import Ice
import sys, os
import subprocess

# Main
if "main" in sys.argv:

    # Failed
    import omero.util
    env = omero.util.Environment("PATH","PYTHONPATH")
    env.set("ICE_CONFIG","cfg.txt")
    env = env()

    # Passed
    ## env = os.environ.copy()
    ## env["ICE_CONFIG"] = "cfg.txt"

    out = file("out","w")
    err = file("err","w")
    popen = subprocess.Popen(["python", "t.py","sub"], cwd=".", env=env, stdout=out, stderr=err)
    popen.wait()
elif "sub" in sys.argv:
    import omero.scripts as s
    s.client("name",None)
else:
    print "t.py [ main | sub ]"
    

Changing the two "##" lines (using a copy of the full environment) corrected the problem.

Change History (1)

comment:1 Changed 15 years ago by jmoore

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets. You may also have a look at Agilo extensions to the ticket.

1.3.13-PRO © 2008-2011 Agilo Software all rights reserved (this page was served in: 0.63001 sec.)

We're Hiring!