support: capture journal tail from before last reboot#738
Open
cyberb wants to merge 3 commits into
Open
Conversation
GetLogs only dumps the current boot's journal, so an unclean reboot (hard freeze / power-off, e.g. the photoprism OOM livelock on weak ARM) leaves no trace of what happened in the seconds before it went down. Add a 'journalctl -b -1 -n 100' section: the last 100 lines of the previous boot, which is where the kernel hung-task/watchdog/OOM lines land right before the box dies. Degrades gracefully to journald's 'boot not available' message when storage is volatile.
The image proxy hardcoded the legacy object path
(apps.syncloud.org/releases/{channel}/images/{app}-128.png). Newly
published apps (e.g. games) are no longer written there, so the lookup
404'd and the UI fell back to the placeholder icon.
The platform already lists apps via local snapd (/v2/find); snapd relays
the store's media[].url. Capture that, and have /rest/proxy/image resolve
the icon URL from snapd by app name, then stream the bytes. The platform
no longer constructs any store/S3 path — it uses the URL snapd provides
and only proxies bytes (browser can't load the http store URL directly
from the https UI, so the fetch stays server-side).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The debug-email support report (
GetLogs) only dumps the current boot's journal (journalctl -n 2000). When the box goes down uncleanly — hard freeze / power-off, e.g. the photoprism OOM livelock on weak ARM (forum 650, forum 654) — there's no trace of what happened in the seconds before it died.What
Add a
previousBootTail()section:journalctl -b -1 -n 100, the last 100 lines of the previous boot. That's where the kernel hung-task / watchdog / OOM lines land right before an unclean reboot. Slotted right after the current-boot dump inGetLogs.Degrades gracefully to journald's "boot not available" message when storage is volatile.
Verification
go build ./support/+go test ./support/pass.borisarm64: journald is persistent (/var/log/journalships in the image, ~2.8 GB, 6 boots retained), sojournalctl -b -1 -n 100returns real prior-boot data — the section populates. No install-hook change needed.Out of scope
The persistent journal has no
SystemMaxUsecap (pre-existing, ~2.8 GB) — not addressed here.