Bug 16499 - RRS: update scripts fail at startup when TOOLS_LOG_DIR is not set
Summary: RRS: update scripts fail at startup when TOOLS_LOG_DIR is not set
Status: IN PROGRESS REVIEW
Alias: None
Product: Recipe Reporting System (RRS)
Classification: Yocto Project Subprojects
Component: Recipe Reporting System (RRS) (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium+ normal
Target Milestone: 6.2 M2
Assignee: Tim Orling
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2026-11-14 07:16 UTC by Tim Orling
Modified: 2026-11-15 00:46 UTC (History)
0 users

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Orling 2026-11-14 07:16:24 UTC
All the RRS update scripts that use rrs/tools/common.py:get_logger() (rrs_maintainer_history.py, rrs_upgrade_history.py, rrs_upstream_history.py, rrs_distros.py, rrs_upstream_email.py) fail as soon as they start in the Docker image:

  File "/opt/layerindex/rrs/tools/common.py", line 39, in get_logger
    handler = RotatingFileHandler(filename, maxBytes=maxBytes)
  PermissionError: [Errno 13] Permission denied: '/opt/layerindex/UpstreamHistory'

get_logger() always adds a log file at os.path.join(settings.TOOLS_LOG_DIR, name), but TOOLS_LOG_DIR is "" in both settings.py and docker/settings.py, so the file is created in the current directory. In the Docker image that is /opt/layerindex, which belongs to root, while the scripts run as the layers user.

On a test instance this made the daily RRS update fail within a second every day without updating anything.

Separately, on layers.openembedded.org the RRS pages show no upstream status for any milestone from 5.3 M1 onwards (all 0%), and in a copy of its database the latest RecipeUpstreamHistory is from 2024-12-28 and the latest RecipeUpgrade from 2025-06-16, while RecipeMaintainerHistory is current. That may have a different cause; I will add what I find once these scripts run.

Fix: when TOOLS_LOG_DIR is not set, only log to the console (which systemd, cron or docker logs collect) instead of writing a file into the current directory.
Comment 1 Tim Orling 2026-11-15 00:46:32 UTC
Patch 1/6 of the series sent to yocto-patches, under review:
https://lore.kernel.org/all/20261115003506.53654-1-tim.orling@konsulko.com/