Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: "Attempt to overwrite 'name' in LogRecord" in async_pipeline.py #194

Closed
danliszka1 opened this issue Feb 11, 2025 · 1 comment · Fixed by deepset-ai/haystack#8845

Comments

@danliszka1
Copy link

Running the AsyncPipeline gave me a KeyError, originating from the log statement on line 138 in async_pipeline.py

Environment:

  • Python version: 3.11.8
  • Library tag: 0.6.0

Stack trace:

2025-02-11 12:26:49   File "/src/app/.venv/lib/python3.11/site-packages/haystack_experimental/core/pipeline/async_pipeline.py", line 509, in run_async
2025-02-11 12:26:49     async for partial in self.run_async_generator(
2025-02-11 12:26:49   File "/src/app/.venv/lib/python3.11/site-packages/haystack_experimental/core/pipeline/async_pipeline.py", line 384, in run_async_generator
2025-02-11 12:26:49     async for partial_result in _wait_for_one_task_to_complete():
2025-02-11 12:26:49   File "/src/app/.venv/lib/python3.11/site-packages/haystack_experimental/core/pipeline/async_pipeline.py", line 265, in _wait_for_one_task_to_complete
2025-02-11 12:26:49     partial_result = finished.result()
2025-02-11 12:26:49                      ^^^^^^^^^^^^^^^^^
2025-02-11 12:26:49   File "/src/app/.venv/lib/python3.11/site-packages/haystack_experimental/core/pipeline/async_pipeline.py", line 244, in _runner
2025-02-11 12:26:49     result = await _run_component_async(component_name, component_inputs)
2025-02-11 12:26:49              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-02-11 12:26:49   File "/src/app/.venv/lib/python3.11/site-packages/haystack_experimental/core/pipeline/async_pipeline.py", line 138, in _run_component_async
2025-02-11 12:26:49     logger.info("Running component {name}", name=component_name)
2025-02-11 12:26:49   File "/src/app/.venv/lib/python3.11/site-packages/haystack/logging.py", line 144, in _log_only_with_kwargs
2025-02-11 12:26:49     return func(
2025-02-11 12:26:49            ^^^^^
2025-02-11 12:26:49   File "/usr/local/lib/python3.11/logging/__init__.py", line 1489, in info
2025-02-11 12:26:49     self._log(INFO, msg, args, **kwargs)
2025-02-11 12:26:49   File "/usr/local/lib/python3.11/logging/__init__.py", line 1632, in _log
2025-02-11 12:26:49     record = self.makeRecord(self.name, level, fn, lno, msg, args,
2025-02-11 12:26:49              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-02-11 12:26:49   File "/src/app/.venv/lib/python3.11/site-packages/haystack/logging.py", line 197, in _wrapper
2025-02-11 12:26:49     return original_make_records(name, level, fn, lno, interpolated_msg, (), exc_info, func, extra, sinfo)
2025-02-11 12:26:49            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-02-11 12:26:49   File "/usr/local/lib/python3.11/logging/__init__.py", line 1606, in makeRecord
2025-02-11 12:26:49     raise KeyError("Attempt to overwrite %r in LogRecord" % key)
2025-02-11 12:26:49 KeyError: "Attempt to overwrite 'name' in LogRecord"
@mathislucka
Copy link
Member

Thanks for reporting @danliszka1! We'll work on a fix quickly. Note that we now also merged the AsyncPipeline into haystack main. We'll have the 2.10 release this week, so please switch to the implementation in main once it's available there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants