Closed ng-pgill closed 9 years ago
Had this same issue hit me. An unfortunate error message.
@pgddevil @andrewgross what command/code are you running that causes this data to be passed in like this? That's true that it's defined as a proc, but varia_model is smart enough to call that proc under certain situations. I'm having trouble finding the code path to make this happen...
Hey @sethvargo, here is a rundown of the simplest way to cause the issue for me.
Berkshelf 3.1.5 (via ChefDK)
Running Berkshelf API Local Server (hooked up to my hosted Chef server)
PATH: /opt/chefdk/bin:/Users/awgross/.chefdk/gem/ruby/2.1.0/bin:/opt/chefdk/embedded/bin:/Users/awgross/.rbenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/awgross/bin
chef generate cookbook foobar
source "http://127.0.0.1:26200"
berks upload foobar
This will trigger the linked stacktrace. At the time I had this issue, I did not have any file at ~/.berkshelf/config.json
, nor did I have any knife
configuration files, or any Chef files in /etc
. As far as I can tell I had no Chef configuration files in scope.
Stacktrace: https://gist.github.com/andrewgross/95cc2fb31b20a9bd59c1
Let me know if you need more info, or you suspect I am mistaken about how I have my environment setup.
I have the same issue too.
@reset Could you please check this out?
Any progress on this one? Just started facing this one in multiple places (not sure what changed to make it start happening though).
Is the code by @pgddevil acceptable? Can we turn it into a PR and get a fix out?
@matt-richardson I've created a PR to fix this issue in #295
Ruby version: 1.9.3-p547 Ridley version: 4.1.0
gems/ridley-4.1.0/lib/ridley/client.rb:145:in `expand_path': can't convert Proc into String (TypeError)
in client.rb (line 141):
if the :client_key refers to a Proc object, the expand_path call will fail and the error will be can't convert Proc into String.
Would have expect this error: Ridley::Errors::ClientKeyFileNotFoundOrInvalid client key is invalid or not found at: '/etc/chef/client.pem'
in config.rb (line 50): we see that a Proc is defined for :client_key
I patched client.rb this way for testing: