Skip to content

Fix mount_logs container startup on macOS Colima#24593

Open
NouemanKHAL wants to merge 3 commits into
masterfrom
noueman/fix-shared-logs-colima-mount
Open

Fix mount_logs container startup on macOS Colima#24593
NouemanKHAL wants to merge 3 commits into
masterfrom
noueman/fix-shared-logs-colima-mount

Conversation

@NouemanKHAL

Copy link
Copy Markdown
Member

What does this PR do?

Anchors the shared log files created by mount_logs (in datadog_checks_dev's docker_run) under $HOME on macOS instead of the default $TMPDIR (/var/folders).

Motivation

On macOS the Docker daemon runs inside a VM. Colima, a common local Docker setup, shares only the user's home directory by default. The file that shared_logs creates under $TMPDIR is therefore invisible to the daemon, so Docker materializes the missing bind-mount source as an empty directory. Any container expecting a file at that mount path then breaks.

Concretely, this makes ddev test <integration> fail for any integration that uses mount_logs=True on Colima. For VoltDB it manifests as the voltdb0 container crashing on startup: its log4j DailyRollingFileAppender targets /var/log/voltdb.log (bind-mounted from ${DD_LOG_1}), finds a directory instead of a file, and dies with java.io.FileNotFoundException: /var/log/voltdb.log (Is a directory) followed by a NullPointerException. The environment fixture then exhausts its retries and every integration test errors during setup.

$HOME is shared by both Colima and Docker Desktop, so anchoring the shared-logs temp directory there fixes Colima without affecting Docker Desktop. Linux is unchanged (the daemon is local, so $TMPDIR is already daemon-visible), so CI behavior is unaffected.

Validation:

  • ddev test datadog_checks_dev lint clean; ddev test datadog_checks_dev -- -k docker -> 28 passed.
  • Before: ddev test voltdb on Colima -> voltdb0 crashes with (Is a directory) NPE, all integration tests error at setup.
  • After (code fix only, no TMPDIR override): voltdb0 boots, no log4j crash, integration test passes (18s).

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Add qa/required if this PR needs QA validation, or qa/skip-qa if it does not. Exactly one of the two is required.
  • If you need to backport this PR to another branch, you can add the backport/<branch-name> label to the PR and it will automatically open a backport PR once this one is merged

On macOS the Docker daemon runs inside a VM. Colima, a common local
setup, shares only the user's home directory by default, so the shared
log file that mount_logs creates under $TMPDIR (/var/folders) is not
visible to the daemon. Docker then materializes the missing bind source
as an empty directory, which breaks any container that expects a file at
that path (e.g. VoltDB's log4j appender crashes on startup).

Anchor the shared-logs temp directory under $HOME on darwin, a location
both Colima and Docker Desktop share. Linux is unchanged since the
daemon is local there.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@NouemanKHAL NouemanKHAL added the qa/skip-qa Automatically skip this PR for the next QA label Jul 17, 2026
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@datadog-prod-us1-4

datadog-prod-us1-4 Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Tests  Code Coverage

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 0.00%
Overall Coverage: 88.44% (+0.10%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 240e83a | Docs | Datadog PR Page | Give us feedback!

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@NouemanKHAL
NouemanKHAL marked this pull request as ready for review July 17, 2026 15:19
@NouemanKHAL
NouemanKHAL requested a review from a team as a code owner July 17, 2026 15:19
@dd-octo-sts

dd-octo-sts Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Validation Report

All 21 validations passed.

Show details
Validation Description Status
agent-reqs Verify check versions match the Agent requirements file
ci Validate CI configuration and code coverage settings
codeowners Validate every integration has a CODEOWNERS entry
config Validate default configuration files against spec.yaml
dep Verify dependency pins are consistent and Agent-compatible
http Validate integrations use the HTTP wrapper correctly
imports Validate check imports do not use deprecated modules
integration-style Validate check code style conventions
jmx-metrics Validate JMX metrics definition files and config
labeler Validate PR labeler config matches integration directories
legacy-signature Validate no integration uses the legacy Agent check signature
license-headers Validate Python files have proper license headers
licenses Validate third-party license attribution list
metadata Validate metadata.csv metric definitions
models Validate configuration data models match spec.yaml
openmetrics Validate OpenMetrics integrations disable the metric limit
package Validate Python package metadata and naming
qa-label Validate the pull request declares whether it needs QA for the next Agent release
readmes Validate README files have required sections
saved-views Validate saved view JSON file structure and fields
version Validate version consistency between package and changelog

View full run

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 240e83ab24

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

return os_type == 'windows'


def shared_logs_base_dir():

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Add a return type to the new helper

The repo-level /workspace/integrations-core/AGENTS.md says that new Python code must add type hinting, but this newly added helper is unannotated even though it returns either a path string or None. Please add an explicit return annotation such as str | None so the new code follows the documented convention.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dev_package qa/skip-qa Automatically skip this PR for the next QA team/agent-integrations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant