asu icon indicating copy to clipboard operation
asu copied to clipboard

feat(error-log): add a concise error logging capability

Open efahl opened this issue 2 months ago • 2 comments

Record build errors in a rotating log to allow easier diagnosis of upstream imagebuilder and package build issues. Add a separate web page for access to the log's content. Log content is exposed via an API call, so other downstream tools may utilize the data.

Note that the log content is intentionally minimal and anonymized to minimize any use for tracking ASU users.


Web page from my tests:

Total errors logged: 431 (showing 10 most recent)
Time period: 2025-10-16T17:04 - 2025-10-20T13:24

2025-10-20T09:00 24.10-SNAPSHOT:ath79/generic:elecom_wrc-300ghbk2-i 409 Client Error: Conflict (can only kill running containers. e03fcd1e72a08f3b15501ec3b93e48245c868c1556eeb17fa93809c90123225d is in state stopped: container state improper)
2025-10-20T12:29 24.10-SNAPSHOT:ath79/generic:elecom_wrc-300ghbk2-i Impossible package selection
2025-10-20T12:33 24.10-SNAPSHOT:x86/64:generic Impossible package selection
2025-10-20T12:34 SNAPSHOT:x86/64:generic Impossible package selection
2025-10-20T12:59 SNAPSHOT:x86/64:generic Impossible package selection: bort
2025-10-20T13:01 SNAPSHOT:x86/64:generic Impossible package selection: dnsmasq not in manifest
2025-10-20T13:04 24.10-SNAPSHOT:x86/64:generic Impossible package selection: dnsmasq-full
2025-10-20T13:15 24.10-SNAPSHOT:x86/64:generic Impossible package selection: dnsmasq-full invalid
2025-10-20T13:21 24.10-SNAPSHOT:ath79/generic:tplink_archer-c7-v4 Impossible package selection: base-files invalid
2025-10-20T13:24 24.10-SNAPSHOT:ath79/generic:elecom_wrc-300ghbk2-i Impossible package selection: base-files invalid

efahl avatar Oct 20 '25 22:10 efahl

Codecov Report

:x: Patch coverage is 97.14286% with 2 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 92.55%. Comparing base (5e65dec) to head (bb9995a). :warning: Report is 312 commits behind head on main.

Files with missing lines Patch % Lines
asu/build.py 75.00% 1 Missing :warning:
asu/main.py 75.00% 1 Missing :warning:
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1522       +/-   ##
===========================================
+ Coverage   80.75%   92.55%   +11.79%     
===========================================
  Files          15       15               
  Lines         977     1451      +474     
===========================================
+ Hits          789     1343      +554     
+ Misses        188      108       -80     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar Oct 20 '25 23:10 codecov[bot]

Example use of the API:

$ curl -s 'https://my-asu-server.lan/api/v1/build-errors?n_entries=50' | awk 'NR>3 {print $2}' | sort | uniq -c | sort -nr
     24 24.10-SNAPSHOT:ath79/generic:elecom_wrc-300ghbk2-i
     19 24.10-SNAPSHOT:x86/64:generic
      4 SNAPSHOT:x86/64:generic
      2 24.10-SNAPSHOT:ath79/generic:tplink_archer-c7-v4
      1 24.10.1:lantiq/xrx200:bt_homehub-v5a

efahl avatar Oct 20 '25 23:10 efahl