Chef Web Manager Data Bag Output Not Matching Knife Data Bag Output


#1

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.


#2

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

Jimmy Huang mailto:jimmy.huang@duragility.com
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.


#3

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 mmzyk@chef.io 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

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.


#4

This sounds very much like the search index on your Chef Server was out of date or somehow corrupt. Like Noah mentioned, the Manage Console uses search to populate the list views, where knife list * uses the list APIs. This is done to reduce the number of requests to the backend for displaying information on the Manage Console.

When you save or update data on the Chef Server, the objects then get sent to the search service for indexing, so your resolution also makes sense here.

Do you have any inclination of why the search index might have become out of date? The internal that are involved in having a functioning and updated search service are:

rabbitmq

opscode-expander

opscode-solr4

Cheers!


Stephen Delano - Engineering Lead, Chef

On Fri, Feb 27, 2015 at 4:03 PM, Noah Kantrowitz noah@coderanger.net
wrote:

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 mmzyk@chef.io 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

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.


#5

Hi Stephen and Noah,

The command knife search users '*:*' does return the right number of
users as expected, while “items” subtab for the same users data bag on the
Policy tab returns roughly half that number consistently upon multiple
refreshes and different browsers. The knife download command as always
yielded the correct number of users for me…that is how I was able to
recover, but for some reason the web manager is just not getting the full
list. Would an unintended server restart cause the search index to get out
of sync? If there are things I may do to get the web manager back to being
fully operational, please let me know. I will wait to file this issue on
GitHub until I hear from you. Thank you.

Jimmy

On Fri, Feb 27, 2015 at 4:19 PM, Stephen Delano stephen@opscode.com wrote:

This sounds very much like the search index on your Chef Server was out of
date or somehow corrupt. Like Noah mentioned, the Manage Console uses
search to populate the list views, where knife list * uses the list APIs.
This is done to reduce the number of requests to the backend for displaying
information on the Manage Console.

When you save or update data on the Chef Server, the objects then get sent
to the search service for indexing, so your resolution also makes sense
here.

Do you have any inclination of why the search index might have become out
of date? The internal that are involved in having a functioning and updated
search service are:

  • rabbitmq
  • opscode-expander
  • opscode-solr4

Cheers!


Stephen Delano - Engineering Lead, Chef

On Fri, Feb 27, 2015 at 4:03 PM, Noah Kantrowitz noah@coderanger.net
wrote:

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 mmzyk@chef.io 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

<postbox-contact.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.

<signature.asc>