Camera API silently starts with no cameras when credentials.json is unreadable
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 66/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 21
- Fork
- 10
- Merge trung bình
- 4 ngày 4 giờ
- Pull request đã merge (30 ngày)
- 13
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của pyronear/pyro-engine
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
pyronear/pyro-engine#368 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
pyronear/pyro-engine#490 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
module: engine type: enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
pyronear/pyro-engine#467 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
module: vision type: enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
pyronear/pyro-engine#466 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
module: vision type: enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 45/100
pyronear/pyro-engine#465 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của pyronear/pyro-engine
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
software-mansion-labs/Diplomat#20 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Windows] Hidden title bar: a maximized window restored from minimized on a secondary monitor gets the primary monitor's work area as its client areaCó thể đã có người làm @lijy91 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
libnativeapi/nativeapi#53 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
View Counts discarded due to field name mismatchCó thể đã có người làm @rsiva0400 đã nhận hôm nay. Đang mởsite-bug triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Model version publishes the new UK firm entity as a personCó thể đã có người làm @vahid-ahmadi đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
PolicyEngine/policyengine.py#764 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
spcl/HPCAgent-Bench#264 ·
Maintainer thường phản hồi trong vòng 1 ngày