puppetlabs / puppetlabs/puppetlabs-docker

Dependency cycle

Open
#894 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug community
Dominant language
Ruby
Stars
94
Forks
337
Avg merge
11d 15h
Merged PRs (30d)
2

Description

Describe the Bug

I've recently upgraded from v4.1.2 to v6.0.2 and ever since my server has been failing to run puppet.

A clear and concise description of what the bug is.
There are two or more profiles being applied to the host. Each of the two include a docker_compose and docker::image, but the two are unique. This configuration was working in version 4.1.2.

We are now getting the following error:
Error: Found 1 dependency cycle:
(Docker_compose[elasticsearch] => Class[Profiles::elasticsearch] => Class[Profiles::traefik] => Docker::Image[traefik] => Exec[/usr/local/bin/update_docker_image.sh traefik:latest] => Docker::Image[traefik] => Docker_compose[elasticsearch])\nCycle graph written to /opt/puppetlabs/puppet/cache/state/graphs/cycles.dot.
Error: Failed to apply catalog: One or more resource dependency cycles detected in graph

Expected Behavior

Puppet should check the image and compose and proceed with changes, but probably not do anything since no changes are required.

Steps to Reproduce

#Traefik profile
class profiles::traefik (
  $traefik_image_tag = 'latest'
){
  docker::image { 'traefik':
    image_tag => $traefik_image_tag,
  }

  docker_compose { 'traefik':
    ensure        => present,
    compose_files => ['/docker/traefik/docker-compose.yml'],
    subscribe     => File['/docker/traefik/docker-compose.yml'],
    require       => [File['/docker/traefik/docker-compose.yml'],File['/docker/traefik/traefik.yml'],File['/docker/traefik/traefik-dynamic.yml']],
  }
}

#ElasticSearch Profile
class profiles::elasticsearch (
  $elasticsearch_image_tag                  = '8.6.1',
){

  docker::image { 'elasticsearch':
    image_tag => $elasticsearch_image_tag,
  }

  docker_compose { 'elasticsearch':
    ensure        => present,
    compose_files => ['/docker/elasticsearch/docker-compose.yml'],
    subscribe     => File['/docker/elasticsearch/docker-compose.yml'],
  }
}

Environment

  • Module Version: 6.0.2
  • Puppet agent: 7.21.0
  • Platform: Ubuntu 22.04.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the catalog failure with the two profile examples and inspect /opt/puppetlabs/puppet/cache/state/graphs/cycles.dot, focusing on the docker_compose and docker::image resources named in the cycle. Compare behavior between module versions 4.1.2 and 6.0.2; done means Puppet can apply the catalog without reporting a dependency cycle.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker
Domain
devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.