Puppet: Found 1 dependency cycle

13,158

In puppet files have an implicit require for any parent directories that are declared.

Effectively:

File['change venv permissions'] -> File['enforce MinGW compiler']

So the parent requires the exec, the exec requires the child, and the child requires the parent, creating a loop.

Share:
13,158
Richard Knop
Author by

Richard Knop

I'm a software engineer mostly working on backend from 2011. I have used various languages but has been mostly been writing Go code since 2014. In addition, I have been involved in lot of infra work and have experience with various public cloud platforms, Kubernetes, Terraform etc. For databases I have used lot of Postgres and MySQL but also Redis and other key value or document databases. Check some of my open source projects: https://github.com/RichardKnop/machinery https://github.com/RichardKnop/go-oauth2-server https://github.com/RichardKnop

Updated on August 22, 2022

Comments

  • Richard Knop
    Richard Knop over 1 year

    I am getting this error when applying my Puppet manifest:

    Error: Could not apply complete catalog: Found 1 dependency cycle:
    (Exec[pip install requirements] => File[change venv permissions] => File[enforce MinGW compiler] => Exec[pip install requirements])
    Try the '--graph' option and opening the resulting '.dot' file in OmniGraffle or GraphViz
    

    Here is my Puppet manifest (the relevant part) and I don't see any dependency cycle there. Any ideas?

    exec {'create virtualenv':
        command => "$install_dir/Scripts/virtualenv.exe venv",
        cwd     => $project_dir,
        require => Exec['install virtualenv'],
    }
    
    file { "fix Mingw32CCompiler":
        path    => "C:/Python27/Lib/distutils/cygwinccompiler.py",
        content => template($cygwinc_template),
        ensure  => present,
        require => Exec['create virtualenv'],
    }
    
    file { "enforce MinGW compiler":
        path    => "$project_dir/venv/Lib/distutils/distutils.cfg",
        owner   => $user,
        content => $mingw,
        ensure  => present,
        require => File['fix Mingw32CCompiler'],
    }
    
    exec {'pip install requirements':
        timeout => 1200,
        command => "$project_dir/venv/Scripts/pip.exe install -r $project_dir/requirements.txt",
        require => File['enforce MinGW compiler'],
    }
    
    file {'change venv permissions':
        path    => "$project_dir/venv",
        recurse => true,
        owner   => $user,
        mode    => 0770,
        require => Exec['pip install requirements'],
    }