Camera API silently starts with no cameras when credentials.json is unreadable
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 66/100
Research direction
Start with pyro_camera_api/core/config.py, where the issue shows credentials.json loading errors are swallowed, and inspect the compose configuration and README “Data directory” section. Check how the API handles unreadable credentials and how the engine writes data/heartbeat; decide whether errors should be logged or startup should fail, and clarify the required directory ownership. Done when the failure is visible and the deployment guidance covers the reported permissions.
Written by the indexing model from the issue text.
Description
What happens
pyro_camera_api/core/config.py swallows any error while loading credentials.json:
if CREDENTIALS_PATH.exists():
try:
with Path(CREDENTIALS_PATH).open("r", encoding="utf8") as f:
RAW_CONFIG = json.load(f)
except Exception:
RAW_CONFIG = {}
With the compose hardening (cap_drop: [ALL], so no CAP_DAC_OVERRIDE for root), a credentials.json that is not owned by root (for example chmod 600 by the deploy user) cannot be read. The camera API then starts healthy with an empty registry: /cameras/cameras_list is empty, every /cameras/latest_image returns 404, and nothing in the logs says why.
In the same setup the engine crashes at start with PermissionError: [Errno 13] Permission denied: 'data/heartbeat' (the data directory is not writable by root without CAP_DAC_OVERRIDE).
Steps to reproduce
chown -R 1000:1000 data && chmod 600 data/credentials.jsondocker compose up -dcurl localhost:8081/cameras/cameras_list→{"camera_ids": []}, no error logged.
Suggestions
- Log the exception (or fail fast) instead of silently using
{}. - Document in the README "Data directory" section that
./datamust be owned by root (or by the container user) because ofcap_drop: ALL.
- Dominant language
- Python
- Stars
- 21
- Forks
- 10
- Avg merge
- 4d 4h
- Merged PRs (30d)
- 13
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
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 pyronear/pyro-engine
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
pyronear/pyro-engine#368 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
pyronear/pyro-engine#490 ·
Maintainers usually reply within 1 day
-
module: engine type: enhancement
Difficulty 5/5 Over a week Newbie friendliness 35/100
pyronear/pyro-engine#467 ·
Maintainers usually reply within 1 day
-
module: vision type: enhancement
Difficulty 5/5 Over a week Newbie friendliness 25/100
pyronear/pyro-engine#466 ·
Maintainers usually reply within 1 day
-
module: vision type: enhancement
Difficulty 5/5 Over a week Newbie friendliness 45/100
pyronear/pyro-engine#465 ·
Maintainers usually reply within 1 day
All issues in pyronear/pyro-engine
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
software-mansion-labs/Diplomat#20 ·
Maintainers usually reply within 1 day
-
[Windows] Hidden title bar: a maximized window restored from minimized on a secondary monitor gets the primary monitor's work area as its client areaPossibly taken @lijy91 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
libnativeapi/nativeapi#53 · 1 reaction ·
Maintainers usually reply within 1 day
-
View Counts discarded due to field name mismatchPossibly taken @rsiva0400 claimed this today. Opensite-bug triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Model version publishes the new UK firm entity as a personPossibly taken @vahid-ahmadi claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
PolicyEngine/policyengine.py#764 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
spcl/HPCAgent-Bench#264 ·
Maintainers usually reply within 1 day