schubergphilis / chef-acme

Chef cookbook to request SSL certificates at Let's Encrypt
Apache License 2.0
112 stars 74 forks source link

Test with kitchen: cannot load such file -- acme-client #118

Closed Dragsbaek closed 4 years ago

Dragsbaek commented 4 years ago

Im getting Acme library dependency 'acme-client' not loaded: cannot load such file -- acme-client when running kitchen.

How do i set up kitchen to work with chef-acme?

thoutenbos commented 4 years ago

Did you include the recipe in your runlist? This will install the required gem

Dragsbaek commented 4 years ago

Yes, i have it in my runlist. Also tried including it before everything else, like this:

suites:
  - name: default
    run_list:
      - recipe[acme]
      - recipe[webserver::default]

I also tried copying acme_server and acme_client from fixtures/cookbooks and referencing from berksfile, like this:

# Test
group :integration do
    # Self-hosted acme server
    cookbook 'acme_client', path: 'test/fixtures/cookbooks/acme_client'
    cookbook 'acme_server', path: 'test/fixtures/cookbooks/acme_server'
end
Dragsbaek commented 4 years ago

This is my output

-----> Starting Kitchen (v1.24.0)
-----> Converging <default-ubuntu-1804>...
       Preparing files for transfer
       Preparing dna.json
       Resolving cookbook dependencies with Berkshelf 7.0.7...
       Removing non-cookbook files before transfer
       Preparing data_bags
       Preparing environments
       Preparing validation.pem
       Preparing client.rb
-----> Chef installation detected (install only if missing)
       Transferring files to <default-ubuntu-1804>
       Starting Chef Infra Client, version 15.4.45
       resolving cookbooks for run list: ["acme", "webserver::default"]
       Synchronizing Cookbooks:
         - webserver (0.1.0)
         - users (5.4.0)
         - newrelic-infra (0.9.0)
         - chef-vault (3.1.1)
         - redisio (3.0.0)
         - nodejs (6.0.0)
         - logrotate (2.2.2)
         - acme (4.1.1)
         - hostsfile (3.0.1)
         - r1337-certmanage (0.1.3)
         - motd_chef_status (1.0.3)
         - cron (6.2.2)
         - chef_run_recorder (1.0.1)
         - poise-service (1.5.2)
         - elasticsearch (4.0.6)
         - build-essential (8.2.1)
         - chef-client (11.0.5)
         - yum-epel (3.3.0)
         - ulimit (1.0.0)
         - selinux_policy (2.3.4)
         - apt (7.2.0)
         - chef-sugar (5.0.4)
         - ohai (5.3.0)
         - windows (6.0.1)
         - managed_directory (0.3.1)
         - nginx (9.0.0)
         - yarn (0.4.2)
         - seven_zip (3.1.2)
         - ark (4.0.0)
         - homebrew (5.0.8)
         - java (4.1.0)
         - postgresql (7.1.4)
         - rvm (0.9.4)
         - poise-archive (1.5.0)
         - yum (5.1.0)
         - chef_gem (0.1.0)
         - mingw (2.1.0)
         - poise (2.8.2)
       Installing Cookbook Gems:
       Compiling Cookbooks...
       [2019-11-12T19:16:34+00:00] WARN: Acme library dependency 'acme-client' not loaded: cannot load such file -- acme-client

       ================================================================================
       Recipe Compile Error in /tmp/kitchen/cache/cookbooks/rvm/libraries/chef_rvm_string_cache.rb
       ================================================================================

       LoadError
       ---------
       cannot load such file -- chef/mixin/command

       Cookbook Trace:
       ---------------
         /tmp/kitchen/cache/cookbooks/rvm/libraries/chef_rvm_string_cache.rb:22:in `<top (required)>'

       Relevant File Content:
       ----------------------
       /tmp/kitchen/cache/cookbooks/rvm/libraries/chef_rvm_string_cache.rb:

        15:  # Unless required by applicable law or agreed to in writing, software
        16:  # distributed under the License is distributed on an "AS IS" BASIS,
        17:  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
        18:  # See the License for the specific language governing permissions and
        19:  # limitations under the License.
        20:  #
        21:
        22>> require 'chef/mixin/command'
        23:
        24:  class Chef
        25:    module RVM
        26:      module ShellHelpers
        27:        # stub to satisfy StringCache (library load order not guarenteed)
        28:      end
        29:
        30:      class StringCache
        31:        class << self

       System Info:
       ------------
       chef_version=15.4.45
       platform=ubuntu
       platform_version=18.04
       ruby=ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-linux]
       program_name=/opt/chef/bin/chef-client
       executable=/opt/chef/bin/chef-client

       Running handlers:
       [2019-11-12T19:16:34+00:00] ERROR: Running exception handlers
       Running handlers complete
       [2019-11-12T19:16:34+00:00] ERROR: Exception handlers complete
       Chef Infra Client failed. 0 resources updated in 05 seconds
       [2019-11-12T19:16:34+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
       [2019-11-12T19:16:34+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
       [2019-11-12T19:16:34+00:00] FATAL: LoadError: cannot load such file -- chef/mixin/command
thoutenbos commented 4 years ago

Looks like your error is in the rvm cookbook