3

I get error Chef: No candidate version available for mod_security2 while including package mod_security or package mod_security2

Here is snipped stacktrace:

       * No candidate version available for mod_security2
       ================================================================================
       Error executing action `install` on resource 'apt_package[mod_security2]'
       ================================================================================

       Chef::Exceptions::Package
       -------------------------
       No candidate version available for mod_security2

       Resource Declaration:
       ---------------------
       # In <snipped>

        13: package 'mod_security2'
        14: 

       Compiled Resource:
       ------------------
       # Declared in <snipped> `from_file'

       apt_package("mod_security2") do
         package_name "mod_security2"
         action [:install]
         default_guard_interpreter :default
         declared_type :package
         cookbook_name "mod_secure"
         recipe_name "default"
       end

       System Info:
       ------------
       chef_version=13.0.118
       platform=ubuntu
       platform_version=16.04
       ruby=ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]
       program_name=chef-client worker: ppid=16061;start=17:30:57;
       executable=/opt/chef/bin/chef-client
ducktyped
  • 4,354
  • 4
  • 26
  • 38

1 Answers1

2

This means there is no version of the package available in apt. You might be missing an apt-get update. In your base recipe or whatever the closest you have to that is add apt_update.

coderanger
  • 52,400
  • 4
  • 52
  • 75