Photonics

Photonics

Topics related to Lumerical and more.

Remote Python script stopped working after OS update

    • Anders Simonsen
      Subscriber

      Hi all,

      Last week, I was running a python script remotely through Lumerical's Interop Server. This week, we updated the workstation (Ubuntu 22.04) that runs the server and now the exact same script gives the following error:

            1 remoteArgs={ "hostname": "127.0.0.1", "port": 8989}
      ----> 2 fdtd = lumapi.FDTD(hide=True, remoteArgs=remoteArgs)

      File /opt/lumerical/v231/api/python/lumapi.py:1506, in FDTD.__init__(self, filename, key, hide, serverArgs, remoteArgs, **kwargs)
         1505 def __init__(self, filename=None, key=None, hide=False, serverArgs={}, remoteArgs={}, **kwargs):
      -> 1506     super(FDTD, self).__init__('fdtd', filename, key, hide, serverArgs, remoteArgs, **kwargs)

      File /opt/lumerical/v231/api/python/lumapi.py:1172, in Lumerical.__init__(self, product, filename, key, hide, serverArgs, remoteArgs, **kwargs)
         1161 """Keyword Arguments:
         1162         script: A single string containing a script filename, or a collection of strings
         1163                 that are filenames. Preffered types are list and tuple, dicts are not
         (...)
         1169                  opened before any scripts specified by the script keyword are run.
         1170 """
         1171 iapi = initLib(remoteArgs)
      -> 1172 handle = self.__open__(iapi, product, key, hide, serverArgs, remoteArgs)
         1173 self.handle = LumApiSession(iapi, handle)
         1175 self.syncUserFunctionsFlag = False

      File /opt/lumerical/v231/api/python/lumapi.py:1380, in Lumerical.__open__(self, iapi, product, key, hide, serverArgs, remoteArgs)
         1378         error = iapi.appGetLastError()
         1379         error = error.contents.str[:error.contents.len].decode('utf-8')
      -> 1380         raise LumApiError(error)
         1382 return h

      LumApiError: 'Exception [::appOpened]: Session not found'

      I have recreated the previous setup as much as possible, including rolling back the linux kernel to a version where everything worked, but the script returns the same error no matter what. Any suggestions?

       

      Best,

      Anders

    • Lito
      Ansys Employee

      @Anders Simonsen,

      Are you able to open and run the Lumerical CAD/GUI directly from terminal? 
      i.e. default install path shown in the command below:

      /opt/lumerical/v232/bin/fdtd-solutions &
      /opt/lumerical/v232/bin/mode-solutions &
      /opt/lumerical/v232/bin/device &

       

    • Anders Simonsen
      Subscriber

      @Lito Yap,

      Yes, I can run the GUI for fdtd-solutions from the terminal. We don't have a license for the others.

      I can also run my python script from an editor/terminal on the workstation if I don't use the remoteArgs option in lumapi.FDTD(). But it fails whenever I use the remoteArgs.

    • Lito
      Ansys Employee

      Did you update the environment on your Linux machine and the Interop Server's Certificates, after the OS update as per our KB? 

    • Anders Simonsen
      Subscriber

       

      Yes, I have regenerated the Interop Certificates. My script loads the python path temporarily at run-time – same as last week – so the environment should be up-to-date as well.

      I haven’t tried the explicit import with importlib.util() yet. Will try to make time for that test later today.

      Nevermind, it works now. No idea why. The latest big change I made was to rehost the license manager on to separate linux server. It used to run on the same workstation. But I don't see why that would resolve the problem.

      ¯\_(ツ)_/¯ 

Viewing 4 reply threads
  • The topic ‘Remote Python script stopped working after OS update’ is closed to new replies.