Comments (12)
Thanks @pierresouchay! Just confirmed the new version of the gem works 👌
from consul.
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.
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.
what is the ruby version running chef ? Could it be running 2.4?
from consul.
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.
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.
it means the dependency to the recipe should have been included first?
The line can say whatever, it's included 🤦♂️
from consul.
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.
@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.
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.
I fixed the issue in diplomat... I was very suspicious about the GEM recent bump in chef-client: chef/chef@72439d4#diff-89cade48462044ee1b672dc5f4c3ec250fbd29effcd8932096a23c1283c6731fL203
- I created a new 2.5.1 version of diplomat that release the constraint on the GEM faraday, it should work now: https://rubygems.org/gems/diplomat/versions/2.5.1
- I also created #583 to have clear error messages (please vote for it)
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.
Still, I recommend to vote for #583 ... would have helped quite a lot the diagnostic
from consul.
Related Issues (20)
- Dangerfile should use failure instead of fail
- Remove .rubocop.yml with Dangerfile HOT 1
- Update Changelog HOT 2
- Run latest cookstyle HOT 2
- Update builds to be parallel HOT 1
- undefined method `join_path' for PoiseArchive::Resources::PoiseArchive::Resource HOT 6
- Segment part of the config is wrong type HOT 1
- Poise dependency is abandoned HOT 3
- Rewrite Consul cookbook to use custom resources HOT 5
- `services` definition throws "no implicit conversion of Symbol into Integer" HOT 3
- Support arm64 on linux
- Diplomat gem fails on Chef 16.9.29+ HOT 4
- Chef 17 - Poise no longer works HOT 2
- Consul 1.9.x - ui/ui_dir deprecated HOT 1
- Why are unit tests disabled? Any plans to return them back? HOT 1
- consul_service ignores program property HOT 1
- Dependency Dashboard
- Consul 1.12.x deprecated fields
- Consul client install latest packages missing checksums
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from consul.