Giter Site home page Giter Site logo

Comments (12)

evandam avatar evandam commented on July 24, 2024 2

Thanks @pierresouchay! Just confirmed the new version of the gem works 👌

from consul.

evandam avatar evandam commented on July 24, 2024 1

I am including the consul::client_gem recipe, and can confirm that the gem is installed. I consistently get this error trying to converge in kitchen.

from consul.

pierresouchay avatar pierresouchay commented on July 24, 2024 1

Ok, so, what's the issue?

Two changes have been made:

  • increasing the minimum Ruby version to 2.5 => does not seem to be the culprit
  • increasing the minimum version of faraday => might be the issue?

Any idea?

/me hate ruby dependencies

from consul.

pierresouchay avatar pierresouchay commented on July 24, 2024

what is the ruby version running chef ? Could it be running 2.4?

from consul.

evandam avatar evandam commented on July 24, 2024

Hi @pierresouchay

Chef is using Ruby 2.6.6, still above the minimum version according to Diplomat.

# /opt/chef/embedded/bin/ruby --version
ruby 2.6.6p146 (2020-03-31 revision 67876) [x86_64-linux]

from consul.

pierresouchay avatar pierresouchay commented on July 24, 2024

Ok, so what does the line

RuntimeError
           ------------
           The diplomat gem is required; include recipe[consul::client_gem] to install.

means exactly?

=> it means the dependency to the recipe should have been included first?

from consul.

scalp42 avatar scalp42 commented on July 24, 2024

it means the dependency to the recipe should have been included first?

The line can say whatever, it's included 🤦‍♂️

from consul.

evandam avatar evandam commented on July 24, 2024

Not sure what the issue is, just reporting the behavior 😅

The gem is definitely installed and doesn't seem like any dependency issues:

       Recipe: consul::client_gem
         * chef_gem[diplomat] action install[2021-02-10T22:49:49+00:00] INFO: Processing chef_gem[diplomat] action install (consul::client_gem line 8)
       [2021-02-10T22:49:51+00:00] INFO: chef_gem[diplomat] installed diplomat at 2.5.0

           - install version 2.5.0 of package diplomat

I can also use the gem in /opt/chef/embedded/bin/pry seemingly okay 🤷‍♂️:

[1] pry(main)> require 'diplomat'
=> true
[3] pry(main)> Diplomat.configure do |config|
[3] pry(main)*   config.acl_token = 'master'
[3] pry(main)* end
=> "master"
[4] pry(main)> Diplomat::Policy.list
=> [{"ID"=>"00000000-0000-0000-0000-000000000001",
  "Name"=>"global-management",
  "Description"=>"Builtin Policy that grants unlimited access",
  "Datacenters"=>nil,
  "Hash"=>"swIQt6up+s0cV4kePfJ2aRdKCLaQyykF4Hl1Nfdeumk=",
  "CreateIndex"=>16,
  "ModifyIndex"=>16}]

In the meantime pinning the gem to 2.4.4 solves my problem

from consul.

pierresouchay avatar pierresouchay commented on July 24, 2024

@evandam Could you try to modify the cookbook, change the file libraries/consul_policy.rb and modify line 135 and 137 to:

        begin
          require 'diplomat'
        rescue LoadError => err
          raise 'The diplomat gem is required; ' \
                'include recipe[consul::client_gem] to install: #{err} / #{err.inspect}'
        end

=> then re-launch convergence (skipping the cookbook updates if necessary) to get a maybe better error message?

Still I suspect faraday to be the culprit... maybe the error message will be clearer

In your shell, could you also do:

require 'faraday'
Faraday::VERSION

from consul.

evandam avatar evandam commented on July 24, 2024

Good call, it's related to Faraday

           ================================================================================
           Error executing action `create` on resource 'consul_policy[anonymous]'
           ================================================================================

           RuntimeError
           ------------
           The diplomat gem is required; include recipe[consul::client_gem] to install: Unable to activate diplomat-2.5.0, because faraday-1.0.1 conflicts with faraday (~> 1.3) / #<Gem::ConflictError: Unable to activate diplomat-2.5.0, because faraday-1.0.1 conflicts with faraday (~> 1.3)>

           Cookbook Trace:
           ---------------
           /var/tmp/kitchen/cache/cookbooks/consul/libraries/consul_policy.rb:91:in `rescue in configure_diplomat'
           /var/tmp/kitchen/cache/cookbooks/consul/libraries/consul_policy.rb:88:in `configure_diplomat'
           /var/tmp/kitchen/cache/cookbooks/consul/libraries/consul_policy.rb:62:in `action_create'

           Resource Declaration:
           ---------------------
           suppressed sensitive resource output

           Compiled Resource:
           ------------------
           suppressed sensitive resource output

           System Info:
           ------------
           chef_version=15.15.1
           platform=ubuntu
           platform_version=18.04
           ruby=ruby 2.6.6p146 (2020-03-31 revision 67876) [x86_64-linux]
           program_name=/opt/chef/bin/chef-client
           executable=/opt/chef/bin/chef-client

       [2021-02-10T23:22:29+00:00] INFO: Running queued delayed notifications before re-raising exception

       Running handlers:
       [2021-02-10T23:22:29+00:00] ERROR: Running exception handlers
       Running handlers complete
       [2021-02-10T23:22:29+00:00] ERROR: Exception handlers complete
       Chef Infra Client failed. 7 resources updated in 34 seconds
       [2021-02-10T23:22:29+00:00] FATAL: Stacktrace dumped to /var/tmp/kitchen/cache/chef-stacktrace.out
       [2021-02-10T23:22:29+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
       [2021-02-10T23:22:29+00:00] FATAL: RuntimeError: consul_policy[anonymous] (wo-consul::acl_anonymous line 19) had an error: RuntimeError: The diplomat gem is required; include recipe[consul::client_gem] to install: Unable to activate diplomat-2.5.0, because faraday-1.0.1 conflicts with faraday (~> 1.3) / #<Gem::ConflictError: Unable to activate diplomat-2.5.0, because faraday-1.0.1 conflicts with faraday (~> 1.3)>

from consul.

pierresouchay avatar pierresouchay commented on July 24, 2024

Hello @evandam & @scalp42

I fixed the issue in diplomat... I was very suspicious about the GEM recent bump in chef-client: chef/chef@72439d4#diff-89cade48462044ee1b672dc5f4c3ec250fbd29effcd8932096a23c1283c6731fL203

And if you 10 minutes to spend, I can recommend my last article about Consul performance with Streaming: https://medium.com/criteo-engineering/consul-streaming-whats-behind-it-6f44f77a5175?source=friends_link&sk=a4cf7321bf6f9d50807c7256feee21c5 :-)

Have a good day!

from consul.

pierresouchay avatar pierresouchay commented on July 24, 2024

Still, I recommend to vote for #583 ... would have helped quite a lot the diagnostic

from consul.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.