Skip to content

Logging Handler often encounters errors #987

Description

@wk9874

Description of Bug

When using the logging handler, I often get errors similar to this:

--- Logging error ---
Traceback (most recent call last):
  File "/github/home/.cache/pypoetry/virtualenvs/simvue-fds-CpC4W15U-py3.11/lib/python3.11/site-packages/simvue/handler.py", line 38, in emit
    self._run_object.log_event(_msg)
  File "/github/home/.cache/pypoetry/virtualenvs/simvue-fds-CpC4W15U-py3.11/lib/python3.11/site-packages/simvue/utilities.py", line 317, in wrapper
    return class_func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/github/home/.cache/pypoetry/virtualenvs/simvue-fds-CpC4W15U-py3.11/lib/python3.11/site-packages/simvue/run.py", line 115, in _wrapper
    return _function(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/github/home/.cache/pypoetry/virtualenvs/simvue-fds-CpC4W15U-py3.11/lib/python3.11/site-packages/simvue/utilities.py", line 355, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/github/home/.cache/pypoetry/virtualenvs/simvue-fds-CpC4W15U-py3.11/lib/python3.11/site-packages/pydantic/_internal/_validate_call.py", line 40, in wrapper_function
    return wrapper(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/github/home/.cache/pypoetry/virtualenvs/simvue-fds-CpC4W15U-py3.11/lib/python3.11/site-packages/pydantic/_internal/_validate_call.py", line 137, in __call__
    res = self.__pydantic_validator__.validate_python(pydantic_core.ArgsKwargs(args, kwargs))
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/github/home/.cache/pypoetry/virtualenvs/simvue-fds-CpC4W15U-py3.11/lib/python3.11/site-packages/simvue/run.py", line 1451, in log_event
    self._error("Cannot log events when not in the running state")
  File "/github/home/.cache/pypoetry/virtualenvs/simvue-fds-CpC4W15U-py3.11/lib/python3.11/site-packages/simvue/run.py", line 647, in _error
    raise SimvueRunError(message)
simvue.exception.SimvueRunError: Cannot log events when not in the running state
Call stack:
  File "/__t/Python/3.11.15/x64/lib/python3.11/threading.py", line 1002, in _bootstrap
    self._bootstrap_inner()
  File "/__t/Python/3.11.15/x64/lib/python3.11/threading.py", line 1045, in _bootstrap_inner
    self.run()
  File "/__t/Python/3.11.15/x64/lib/python3.11/threading.py", line 982, in run
    self._target(*self._args, **self._kwargs)
  File "/__w/connectors-fds/connectors-fds/simvue_fds/connector.py", line 877, in _slice_parser
    slice_parsed = self._parse_slice()
  File "/__w/connectors-fds/connectors-fds/simvue_fds/connector.py", line 801, in _parse_slice
    logger.warning(
  File "/__t/Python/3.11.15/x64/lib/python3.11/logging/__init__.py", line 1501, in warning
    self._log(WARNING, msg, args, **kwargs)
  File "/__t/Python/3.11.15/x64/lib/python3.11/logging/__init__.py", line 1634, in _log
    self.handle(record)
  File "/__t/Python/3.11.15/x64/lib/python3.11/logging/__init__.py", line 1644, in handle
    self.callHandlers(record)
  File "/__t/Python/3.11.15/x64/lib/python3.11/logging/__init__.py", line 1706, in callHandlers
    hdlr.handle(record)
  File "/__t/Python/3.11.15/x64/lib/python3.11/logging/__init__.py", line 978, in handle
    self.emit(record)
  File "/github/home/.cache/pypoetry/virtualenvs/simvue-fds-CpC4W15U-py3.11/lib/python3.11/site-packages/simvue/handler.py", line 40, in emit
    logging.Handler.handleError(self, record)
Message: '\n                        Your Simvue server is out of date, and is running a noSim version\n                        which is lower than the version required to support OBSTs within 3D metrics.\n                        Ask your admin to upgrade to noSim version 1.6.4 or higher.\n                        Falling back to uploading OBSTs as zeros...\n                        '
Arguments: ()
WARNING simvue_fds.connector: 
                        Your Simvue server is out of date, and is running a noSim version
                        which is lower than the version required to support OBSTs within 3D metrics.
                        Ask your admin to upgrade to noSim version 1.6.4 or higher.
                        Falling back to uploading OBSTs as zeros...
                        

I'm not sure why its trying to send an event when the run is not in the running state, since the logging I am using always does logging within the Run context

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions