简体   繁体   中英

Puppet: Found 1 dependency cycle

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'],
}

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.

What was your last change (that's probably the moment you added the cycle).

Try the suggestion to generate the graph. Post the generated dot file as gist so that we can investigate further.

Take a look at Debugging cycle or missing dependency .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM