Skip to content

[Fix] GoAccess ignore historical compressed files#1142

Merged
RichardAnderson merged 1 commit into
vitodeploy:4.xfrom
RichardAnderson:fix/gz-logs-site-stats
Jun 4, 2026
Merged

[Fix] GoAccess ignore historical compressed files#1142
RichardAnderson merged 1 commit into
vitodeploy:4.xfrom
RichardAnderson:fix/gz-logs-site-stats

Conversation

@RichardAnderson

@RichardAnderson RichardAnderson commented Jun 4, 2026

Copy link
Copy Markdown
Member

This pull request makes a minor update to the GoAccess log analysis service, ignoring compressed log files, as these will have already been read, but during boundary crossing are read via zcat -f. Fixes a critical failure on log file ingestion over multiple months.

To apply the fix to an existing server, navigate to Server -> Services -> GoAccess -> ... -> Re-sync stats scripts

Summary by CodeRabbit

  • Bug Fixes
    • Improved log analysis processing to filter and handle compressed log files separately, now processing only uncompressed files.
    • Updated log analysis service version identifier.

@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 2e0b1705-2d90-4e4e-b9c3-f32950be630b

📥 Commits

Reviewing files that changed from the base of the PR and between 89f5266 and 9b74dbb.

📒 Files selected for processing (2)
  • app/Services/LogAnalysis/GoAccess/GoAccess.php
  • resources/views/ssh/services/log_analysis/goaccess/bin/process.blade.php

📝 Walkthrough

Walkthrough

The PR updates GoAccess log analysis to exclude compressed logs. The service version constant is incremented from 1 to 2, and the log processing script now filters files to skip .gz archives before invoking GoAccess, returning early if no uncompressed logs exist.

Changes

Log Processing Update

Layer / File(s) Summary
Service version signal
app/Services/LogAnalysis/GoAccess/GoAccess.php
SCRIPT_VERSION constant is incremented from 1 to 2 to signal the coordinated script update.
Log filtering for uncompressed files
resources/views/ssh/services/log_analysis/goaccess/bin/process.blade.php
Log processing now filters out non-existent and compressed (.gz) files, returning early if the filtered list is empty, then invokes GoAccess only with the remaining uncompressed logs.

Estimated Code Review Effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A script once took all files with glee,
Now filters out the .gz with care, you see,
Version two arrives to mark the change—
No compressed logs shall pass this range!
✨ Cleaner logs, a version bump, hooray!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: GoAccess service now ignores compressed historical log files to prevent processing issues.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the GoAccess log-analysis ingestion script to avoid passing already-rotated compressed log files (*.gz) directly into GoAccess during the normal incremental run path. This prevents GoAccess from aborting when it encounters compressed rotations, improving reliability for long-running log ingestion across month boundaries.

Changes:

  • Filter LOG_GLOB inputs to only include existing, uncompressed log files (*.gz excluded) for the normal (non-boundary) incremental GoAccess run.
  • Keep the boundary-window behavior intact (still uses zcat -f to reread across months when needed).
  • Bump the GoAccess script version to force updated script deployment.

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.

File Description
resources/views/ssh/services/log_analysis/goaccess/bin/process.blade.php Builds an explicit input file list and excludes *.gz files before invoking GoAccess in the normal incremental path.
app/Services/LogAnalysis/GoAccess/GoAccess.php Increments SCRIPT_VERSION to propagate the updated processing script to servers.

@saeedvaziry saeedvaziry self-requested a review June 4, 2026 16:24
@RichardAnderson RichardAnderson merged commit 6c66e68 into vitodeploy:4.x Jun 4, 2026
4 checks passed
@RichardAnderson RichardAnderson deleted the fix/gz-logs-site-stats branch June 4, 2026 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants