Comments (17)
Hmm, I haven't got a repro here. I have hashie-2.0.5 too. Can you try this quick to rule out an environment difference?
- git clone chef-zero && cd playground
- chef-zero -p 4000
- knife upload nodes
- knife search node name:blah
Expected results: 1 items found
Can you tell me what happens if you do this? (3+4 are from the same directory)
I tried the procedure with a downloaded node too, with no issue, but this will at least confirm that it's the node itself that is triggering the bug. If that's the case, it will help me a lot if you can send me a (possibly sanitized version of) the node json. Thanks!
from chef-zero.
Will do, was poking around Chef-Pedant and my issue should be covered, I'll dig in to see if I can find where it is wrong.
from chef-zero.
p.s. you need the latest knife-essentials for the above to work:
gem uninstall -a knife-essentials; gem install knife-essentials
from chef-zero.
Using Knife (or cURL) seems to work properly with the steps you gave. I will play around a bit more with Ridley and my data to see if I can pin it down.
from chef-zero.
Definitely something related to the data being put in place, but somehow just for search.
I uploaded my custom node info to the same server I had already verified was working.
Works with a proper response:
/search
/nodes
/nodes/my_custom_node
Fails:
/search/node
I will see if I can upload the data using knife
instead of ridley
to different effect, otherwise ill start diving in to the node data itself to see if I can pinpoint the issue.
from chef-zero.
Just ruled out ridley
, going to dissect node data.
from chef-zero.
Thanks! I will also be happy to help debug if you can send me node data (though I'm in and out tonight). The node data I've uploaded doesn't do it.
It's entirely possible for something about your node data to be special. Given the error you're getting, I'm wondering if your data contains a data type that isn't in usual files. Maybe a number? A null? A boolean?
from chef-zero.
I just tried those and it didn't work. BTW, looking at the code this has something to do with a "normal" attribute (an attribute under the "normal" key). Possibly one that conflicts with a "default" attribute, but I'm guessing not. If you get rid of all automatic and override attributes from the node file, this should still repro. Then maybe try getting rid of default attributes from the node file, and see if it still repros.
Or send it to me and I'll happily slice and dice. I can understand not wanting to if there is sensitive data though!
Thanks tons for filing a bug, hopefully we can smash through this so you can continue with life :)
from chef-zero.
It works if I strip out the "normal" section of the node info. Here is the normal and default data (sanitized, but it still fails even after sanitization).
Normal Data: https://gist.github.com/andrewgross/aeaf3d0ef138b2565a40
Default Data: https://gist.github.com/andrewgross/9ae5104d6a6f8cd1d419
from chef-zero.
Yep, it only fails if you have BOTH the default and normal. Something is weird in the deep merge. Minimizing.
from chef-zero.
Here's the minimal repro:
{
"chef_type": "node",
"json_class": "Chef::Node",
"name": "blah",
"chef_environment": "_default",
"run_list": [],
"default": {
"expected_nodes": 1
},
"normal": {
"expected_nodes": 1
}
}
from chef-zero.
Appears to be a bug in Hashie. I can repro with this:
require 'hashie'
class Hash
include Hashie::Extensions::DeepMerge
end
{ x: 1 }.deep_merge({ x: 1})
from chef-zero.
Nice. Here is 'why'
In Hashie they are dumping the Hashie Deep Merge class in to the Hash that is passed in:
https://github.com/intridea/hashie/blob/master/lib/hashie/extensions/deep_merge.rb
However, it look's like the logic is failing and trying to dump this in to a Fixnum when they use the notation
(class << (tv = self[k]); self; end).send :include, Hashie::Extensions::DeepMerge
from chef-zero.
Yep. I've filed a bug against Hashie (hashie/hashie#99), but I've just copied Chef's deep_merge into chef-zero and will check in a fix shortly. Thanks tons :)
from chef-zero.
Awesome, thanks!
from chef-zero.
Version 1.2.1 released with fix. Let me know if it resolves!
from chef-zero.
Works like a charm, thanks @jkeiser
from chef-zero.
Related Issues (20)
- kitchen and chef-zero 404ing on data bag HOT 3
- check if a data_bag exists HOT 1
- chef-zero should make data available on save HOT 4
- Exception when file has #2 at the end of name HOT 1
- Chef zero outputs too much information for info log level HOT 3
- Chef encountered an error attempting to load the node data HOT 2
- Should do a release HOT 7
- Uploading cookbooks to chef-zero using berks often crashes when Request timeout is 300 HOT 3
- Improper require of Hashie causing error (NameError: uninitialized constant Hashie::Extensions::Array) HOT 5
- Unable to connect to chef-zero HOT 1
- Chef 13 vs Chef 12 ip address resolution HOT 1
- Completely arbitrary ruby version requirement HOT 2
- Need a mode of operation where chef-zero runs in-memory but populates from the disk cache
- Do not format the node definition JSON file after converging HOT 1
- Could chef-zero please support fetching inspec profiles?
- Re-raising exception: URI::InvalidURIError - bad URI(is not URI?)
- missing webrick makes chef-zero fail
- Add unique email contraint while creating user
- Configuring the chef-zero-automate reporter for the compliance phase 404s in TK against chef-zero
- Policy Groups in the policy file details (chef-zero) HOT 2
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 chef-zero.