Skip to content

Fix TypeError of non-dict response data from Agent announcement.#722

Merged
pvital merged 1 commit into
mainfrom
fix_options_type_error
Apr 29, 2025
Merged

Fix TypeError of non-dict response data from Agent announcement.#722
pvital merged 1 commit into
mainfrom
fix_options_type_error

Conversation

@pvital
Copy link
Copy Markdown
Member

@pvital pvital commented Apr 29, 2025

This PR fixes the TypeError of non-dict response data from Agent announcement.

tests/clients/kafka/test_confluent_kafka.py::TestConfluentKafka::test_trace_confluent_kafka_produce
  /root/repo/venv/lib/python3.12/site-packages/_pytest/threadexception.py:82: PytestUnhandledThreadExceptionWarning: Exception in thread Instana Machine
  
  Traceback (most recent call last):
    File "/usr/local/lib/python3.12/threading.py", line 1075, in _bootstrap_inner
      self.run()
    File "/usr/local/lib/python3.12/threading.py", line 1433, in run
      self.function(*self.args, **self.kwargs)
    File "/root/repo/venv/lib/python3.12/site-packages/fysom/__init__.py", line 315, in fn
      self.transition()
    File "/root/repo/venv/lib/python3.12/site-packages/fysom/__init__.py", line 310, in _tran
      self._after_event(e)
    File "/root/repo/venv/lib/python3.12/site-packages/fysom/__init__.py", line 342, in _after_event
      return getattr(self, fnname)(e)
             ^^^^^^^^^^^^^^^^^^^^^^^^
    File "/root/repo/venv/lib/python3.12/site-packages/fysom/__init__.py", line 99, in _callback
      return func(obj, *args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/root/repo/src/instana/fsm.py", line 95, in lookup_agent_host
      self.fsm.announce()
    File "/root/repo/venv/lib/python3.12/site-packages/fysom/__init__.py", line 315, in fn
      self.transition()
    File "/root/repo/venv/lib/python3.12/site-packages/fysom/__init__.py", line 310, in _tran
      self._after_event(e)
    File "/root/repo/venv/lib/python3.12/site-packages/fysom/__init__.py", line 342, in _after_event
      return getattr(self, fnname)(e)
             ^^^^^^^^^^^^^^^^^^^^^^^^
    File "/root/repo/venv/lib/python3.12/site-packages/fysom/__init__.py", line 99, in _callback
      return func(obj, *args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/root/repo/src/instana/fsm.py", line 163, in announce_sensor
      self.agent.set_from(payload)
    File "/root/repo/src/instana/agent/host.py", line 136, in set_from
      self.options.set_from(res_data)
    File "/root/repo/src/instana/options.py", line 142, in set_from
      if "secrets" in res_data:
         ^^^^^^^^^^^^^^^^^^^^^
  TypeError: argument of type 'bool' is not iterable

https://app.circleci.com/pipelines/github/instana/python-sensor/3917/workflows/5df45e12-c567-4688-82af-9a0f51f72bd4/jobs/29635?invite=true#step-104-6215_80

@pvital pvital requested a review from a team as a code owner April 29, 2025 13:38
@pvital pvital self-assigned this Apr 29, 2025
Signed-off-by: Paulo Vital <paulo.vital@ibm.com>
@pvital pvital force-pushed the fix_options_type_error branch from 64f6143 to eed27d7 Compare April 29, 2025 13:43
Copy link
Copy Markdown
Contributor

@CagriYonca CagriYonca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@pvital pvital merged commit 306df0d into main Apr 29, 2025
15 of 17 checks passed
@pvital pvital deleted the fix_options_type_error branch April 29, 2025 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants