Container lookup failures during result polling are masked by UnboundLocalError
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 80/100
Research direction
Start in lean/components/docker/docker_manager.py, in read_from_file: read the try block that calls get_container_by_name and Popen, then the generic except that prints p.stderr. Reproduce with a test that patches get_container_by_name to raise RuntimeError('Docker unavailable') and calls read_from_file('container', Path('result.json'), interval=0.01, timeout=0.1); done when that surfaces the original error and the existing successful-read and retry tests still pass.
Written by the indexing model from the issue text.
Description
Problem
DockerManager.read_from_file dereferences p.stderr in its generic exception handler even when container lookup or Popen failed before p was assigned. A Docker connection failure is consequently replaced by UnboundLocalError.
Reproduction
On current master, mock get_container_by_name to raise RuntimeError('Docker unavailable'), then call read_from_file('container', Path('result.json'), interval=0.01, timeout=0.1).
Observed: UnboundLocalError: cannot access local variable 'p' where it is not associated with a value, rather than a diagnostic of the Docker failure. The same happens if the first process cannot be started.
The relevant exception handler is in lean/components/docker/docker_manager.py, inside read_from_file.
Required result
A failure before process creation must preserve the original diagnostic and must not fail while formatting it. Existing successful reads and retry behavior must remain intact.
- Dominant language
- Python
- Stars
- 335
- Forks
- 172
- Avg merge
- 6h 54m
- Merged PRs (30d)
- 37
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from QuantConnect/lean-cli
-
priority:P2
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
QuantConnect/lean-cli#792 ·
Maintainers usually reply within 1 day
-
priority:P2
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
QuantConnect/lean-cli#786 ·
Maintainers usually reply within 1 day
-
priority:P2
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
QuantConnect/lean-cli#785 ·
Maintainers usually reply within 1 day
-
A partially written live command result aborts polling with JSONDecodeErrorPossibly taken @pcbeingused333 claimed this 3 days ago. Openpriority:P2
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
QuantConnect/lean-cli#784 ·
Maintainers usually reply within 1 day
-
priority:P2
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
QuantConnect/lean-cli#778 ·
Maintainers usually reply within 1 day
All issues in QuantConnect/lean-cli
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
pimutils/vdirsyncer#1242 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
open-webui/open-webui#35360 · 1 comment ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Suggest link: Destiny Verify (MIT zero-dependency pre-commit security, citation & link hygiene CLI)Open
Difficulty 1/5 Under an hour Newbie friendliness 68/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day