Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting a version conflict error when the version of a dependent module is within range. #12

Open
rychannel opened this issue May 13, 2024 · 1 comment
Labels
bug Something isn't working feature

Comments

@rychannel
Copy link

Describe the Bug

I believe that the unusual versioning of the DSC modules is confusing the depedency version check as I am getting the follwowing error with the SCE_Windows module.

/opt/puppetlabs/puppet/lib/ruby/gems/2.7.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:317:in `raise_error_unless_state': Unable to satisfy the following requirements: (Molinillo::VersionConflict)

  • dsc-networkingdsc =9.0.0-0-7 required by Puppetfile

  • dsc-networkingdsc >= 8.1.0-0-1 < 10.0.0 required by Forge puppetlabs-sce_windows-2.0.0

Expected Behavior

Check should pass

Steps to Reproduce

Steps to reproduce the behavior:
Add sce_windows module and its dependencies to a Puppetfile

Environment

  • Running the check on a RHEL 9 server

Additional Context

Add any other context about the problem here.

@rychannel rychannel added the bug Something isn't working label May 13, 2024
@rychannel
Copy link
Author

Here is the script I'm using, this is setup for CD4PE

#!/opt/puppetlabs/puppet/bin/ruby
  
repo_dir = ENV['REPO_DIR']
puppetfile_path = "#{repo_dir}/Puppetfile"

# Parse the Puppetfile into an object model
content = File.open(puppetfile_path, 'rb') { |f| f.read }
require 'puppetfile-resolver'
require 'puppetfile-resolver/puppetfile/parser/r10k_eval'
puppetfile = ::PuppetfileResolver::Puppetfile::Parser::R10KEval.parse(content)

# Make sure the Puppetfile is valid
unless puppetfile.valid?
  puts 'Puppetfile is not valid'
  puppetfile.validation_errors.each { |err| puts err }
  exit 1
end

# Create the resolver
# - Use the document we just parsed (puppetfile)
# - Don't restrict by Puppet version (nil)
resolver = PuppetfileResolver::Resolver.new(puppetfile, nil)

# Configure the resolver
cache                 = nil  # Use the default inmemory cache
ui                    = nil  # Don't output any information
module_paths          = []   # List of paths to search for modules on the local filesystem
allow_missing_modules = true # Allow missing dependencies to be resolved
opts = { cache: cache, ui: ui, module_paths: module_paths, allow_missing_modules: allow_missing_modules }

# Resolve
result = resolver.resolve(opts)

# Output resolution validation errors
result.validation_errors.each { |err| puts "Resolution Validation Error: #{err}\n"}

@pmcmaw pmcmaw added the feature label Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feature
Projects
None yet
Development

No branches or pull requests

2 participants