Camera API silently starts with no cameras when credentials.json is unreadable
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- Python
- 星标
- 21
- 派生
- 10
- 平均合并
- 4 天 4 小时
- 30 天内合并 PR
- 13
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
pyronear/pyro-engine 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 88/100
pyronear/pyro-engine#368 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 45/100
pyronear/pyro-engine#490 ·
维护者通常 1 天内回复
-
module: engine type: enhancement
难度 5/5 一周以上 新手友好度 35/100
pyronear/pyro-engine#467 ·
维护者通常 1 天内回复
-
module: vision type: enhancement
难度 5/5 一周以上 新手友好度 25/100
pyronear/pyro-engine#466 ·
维护者通常 1 天内回复
-
module: vision type: enhancement
难度 5/5 一周以上 新手友好度 45/100
pyronear/pyro-engine#465 ·
维护者通常 1 天内回复
查看 pyronear/pyro-engine 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 74/100
software-mansion-labs/Diplomat#20 ·
维护者通常 1 天内回复
-
[Windows] Hidden title bar: a maximized window restored from minimized on a secondary monitor gets the primary monitor's work area as its client area可能已有人在做 @lijy91 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 67/100
libnativeapi/nativeapi#53 · 1 个 reaction ·
维护者通常 1 天内回复
-
View Counts discarded due to field name mismatch可能已有人在做 @rsiva0400 今天认领。 未关闭site-bug triage
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
Model version publishes the new UK firm entity as a person可能已有人在做 @vahid-ahmadi 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
PolicyEngine/policyengine.py#764 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
spcl/HPCAgent-Bench#264 ·
维护者通常 1 天内回复