Skip to content

fix: set json-file logging driver for default log options - #62

Merged
pilat merged 1 commit into
mainfrom
fix/logging-driver-json-file
Oct 15, 2026
Merged

pilat merged 1 commit into
mainfrom
fix/logging-driver-json-file

Conversation

@pilat

@pilat pilat commented Oct 15, 2026

Copy link
Copy Markdown
Owner

Problem

devbox up fails on Docker Desktop 4.95.0 (Engine 29.8.2, macOS arm64) with:

compression cannot be enabled when max file count is 1

Cause

Devbox injects default logging options (max-size: 10m, max-file: 1) into every service that has no explicit logging configuration, but it never sets the logging driver itself. The options are therefore applied to whatever the daemon's default driver is:

  • json-file accepts max-file=1 with no compression, so it worked by accident on setups where json-file was the daemon default.
  • The modern default driver local (used by recent Docker Desktop) keeps a single compressed file per container. Its compression is incompatible with max-file=1, so container creation fails.

Because the failure depends on the daemon configuration, the same manifest worked on some machines and failed on others.

Fix

applyDefaultLogging now sets driver: json-file explicitly together with the existing max-size/max-file options, so container creation no longer depends on the daemon's default logging driver. Services that define their own logging configuration in compose files are untouched, and docker logs / log viewers keep working since json-file remains the standard readable driver.

Tests

  • internal/project/logging_test.go covers both paths of applyDefaultLogging: services without logging config receive the json-file driver with the expected options, and services with their own logging config are preserved.
  • go test ./internal/project/ -race passes; golangci-lint reports no issues.

@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Repository: pilat/devbox/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 695fe00e-3c2e-463a-a031-785862c973d5
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@pilat
pilat force-pushed the fix/logging-driver-json-file branch from f041b7b to 4015f9a Compare October 15, 2026 02:25
devbox injects max-size/max-file logging options into services without
an explicit logging driver. When the daemon's default driver is 'local'
(as on recent Docker Desktop), 'max-file=1' is incompatible with its
compression and container creation fails with "compression cannot be
enabled when max file count is 1".

Set the driver to json-file explicitly in the default logging config,
keeping the same options. Services that already define their own
logging configuration are untouched.
@pilat
pilat force-pushed the fix/logging-driver-json-file branch from 4015f9a to c71b0fb Compare October 15, 2026 02:50
@pilat pilat assigned pilat and unassigned pilat Oct 15, 2026
@pilat
pilat merged commit 0db7733 into main Oct 15, 2026
3 checks passed
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.

1 participant