[chef] Re: Chef Web Manager Data Bag Output Not Matching Knife Data Bag Output


Chronological Thread 
  • From: Noah Kantrowitz < >
  • To:
  • Subject: [chef] Re: Chef Web Manager Data Bag Output Not Matching Knife Data Bag Output
  • Date: Fri, 27 Feb 2015 16:03:28 -0800

knife download uses the /data list and get APIs, while Manage uses a search. Does `knife search users '*:*'` show the correct number of results?

--Noah

On Feb 27, 2015, at 5:44 AM, Mark Mzyk < "> > wrote:

Thanks for this thorough investigation. I don't know off the top of my head how Chef Manage is fetching those data bags, but I'm going to start with the assumption that this is a bug. Could you open this as an issue on the chef-manage-issues repository[1]? That's a public GitHub repository we've setup for tracking issues with and providing public information about Chef Manage. Having an issue opened there will allow us to more easily follow up and gather any other relevant information.

Thanks,

Mark Mzyk
Chef Software Engineer

1. https://github.com/chef/chef-manage-issues 

" type="cite"> " photoname="Jimmy Huang" name="postbox-contact.jpg" height="25px" width="25px" apple-inline="yes" id="2DBAEFDF-F0C9-423A-80C5-6E2FB7729193" src="jpgc54T6cP81C.jpg"> Jimmy Huang February 26, 2015 at 2:30 AM
Our users data bag on the web manager is out of sync with what we see from this command:

$ knife data bag show users 

Whereas I see 75 users listed when I use the knife command, I only see 15 on the web manager.  When I ran `knife download .` on my laptop, I am able to download all 75 user json files under the data_bags/users folder.  We are currently running Chef server at API version 12.0.0 on a private subnet on AWS.

If I were to "edit" a users data bag item and close the file without making any change, the missing users data bag item would reappear on the web manager upon refresh.  For example:

1.  User "aaron" is currently missing from the users data bag on the web manager;

2.  knife data bag edit users aaron

3.  Simply close the text editor without making any change.  The update will be committed on the Chef server;

4.  Refresh the browser, and I can see user "aaron" on the web manager.

On my end I can fix the web console view by uploading the json files:

$ knife data bag from file users /path/to/user.json
There are two likely suspects that may be the cause.  One is that the web manager is somehow getting the users data bag from a corrupted cached version.  The other is that the web manager display may be a little buggy.

To get past the issue I just described, I reuploaded all the missing users to our data bag.  I verified all 75 users are present by doing a manual search on each user.  I had to do that, because I found the default display behavior to be unreliable, as I had just alluded.  When I went to the Data Bags section and selected the users data bag, I noticed that the browser only showed a fraction of the total users under the Items tab.  When I scrolled down, I saw the page fetched more users but not all.  Also the fetching only happens once consistently on Firefox, Chrome, and Safari.  I was also able to replicate the behavior upon multiple browser refreshes.

Unfortunately I do not know enough about Chef servers to know how I'd even go about testing my hypothesis.  Any insight on what could have caused the apparent mismatch between the web manager and knife output would be greatly appreciated.  Thank you so much for your help.


Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail




Archive powered by MHonArc 2.6.16.

§