Skip to content

Compose file changes lost when DoSync updates image tag (cached file content) #4

@localrivet

Description

@localrivet

Description

When DoSync updates a service's image tag, it overwrites manual changes made to compose.yaml since DoSync started. This appears to be a caching issue where DoSync uses stale file content when modifying the compose file.

Steps to Reproduce

  1. Start DoSync with a compose.yaml that has 2 volume mounts for a service
  2. While DoSync is running, add a new volume mount to compose.yaml manually
  3. Verify the compose.yaml on disk has 3 volume mounts
  4. Wait for DoSync to detect a new image tag and update the container
  5. Check the container - it only has 2 volume mounts (the new one is missing)
  6. Check compose.yaml - the new volume mount line has been removed

Expected Behavior

DoSync should read the current compose.yaml content immediately before modifying the image tag, preserving any manual changes made to the file since DoSync started.

Actual Behavior

DoSync appears to cache the compose file content (possibly at startup or first read) and uses this cached version when updating the image tag. This overwrites any manual changes made to the file.

Environment

  • DoSync version: v0.3.27
  • Docker version: Latest
  • OS: Ubuntu (DigitalOcean droplet)

Workaround

After making manual changes to compose.yaml, run a full restart to refresh DoSync's cache:

docker compose down && docker compose up -d

Suggested Fix

In the UpdateDockerComposeAndRestart function (or wherever the compose file is modified), always read the current file content from disk immediately before making modifications, rather than using any cached version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions