InvalidDataBagItemID when editing data bags in the webui

Hi everyone.

I am currently setting up my first chef environment and must say I am already
sold. However I have a minor issue and I did not find any answer on google:

In the chef server webui I can create data bags and I can edit them using
knife, but I can not edit them using the webui. Whenever I try to save an
edited data bag I get an Error and an InvalidDataBagItemID Exception is logged
to the chef/server.log like the following:

merb : chef-server (api) : worker (port 4000) ~ Data Bag items must have an id
matching /^[-[:alnum:]_]+$/, you gave: data_bag_item[“users”, “test”,
{“comment”=>“asdf”, “id”=>“test”}] - (Chef::Exceptions::InvalidDataBagItemID)

I have copied the full stack trace here: http://nopaste.info/9644f416d6.html

In the ruby code in data_bag_item.rb I have seen that after the "you gave:"
part it should only log the id, not the whole item. Is it a misconfiguration
on my side or is it a bug? What can I do to find out?

Thanks for your help
Silvan

Hi there,

sorry, I forgot to mention that I am running debian squeeze. Both
chef-server and chef-server-webui (and all the other chef packages) are
version 0.10.0-1 from the opscode apt repository for squeeze.
Could you give me any hint where I could start digging for the problem?

Thanks
Silvan

On Wed, Jul 6, 2011 at 17:19, silvan@golega.de wrote:

Hi everyone.

I am currently setting up my first chef environment and must say I am
already
sold. However I have a minor issue and I did not find any answer on google:

In the chef server webui I can create data bags and I can edit them using
knife, but I can not edit them using the webui. Whenever I try to save an
edited data bag I get an Error and an InvalidDataBagItemID Exception is
logged
to the chef/server.log like the following:

merb : chef-server (api) : worker (port 4000) ~ Data Bag items must have an
id
matching /[1]+$/, you gave: data_bag_item["users", "test",
{"comment"=>"asdf", "id"=>"test"}] -
(Chef::Exceptions::InvalidDataBagItemID)

I have copied the full stack trace here:
http://nopaste.info/9644f416d6.html

In the ruby code in data_bag_item.rb I have seen that after the "you gave:"
part it should only log the id, not the whole item. Is it a
misconfiguration
on my side or is it a bug? What can I do to find out?

Thanks for your help
Silvan

--
Silvan T. Golega
Pidoco GmbH
Warschauer Str 58a
10243 Berlin
Tel. +49 30 4881 6385
silvan.golega@pidoco.com

Pidoco GmbH
Sitz der Gesellschaft: Berlin
Registergericht Berlin-Charlottenburg, HRB 115010
Geschäftsführer: Philipp Huy


  1. -[:alnum:]_ ↩︎

On 07/08/2011 11:56 AM, Silvan T. Golega wrote:

t where I could start digging for the problem?

Hi there was problem with saving data bags I ran into it as well. It was
fixed in 0.10.2 bugs fix release.

On Jul 8, 2011 2:03 AM, "Denis Barishev" denis.barishev@gmail.com wrote:

Hi there was problem with saving data bags I ran into it as well. It was
fixed in 0.10.2 bugs fix release.

0.10.0 -> 0.10.2 only contained a security did related to cookbook
permissions.

On 07/09/2011 08:08 AM, Bryan McLellan wrote:

On Jul 8, 2011 2:03 AM, "Denis Barishev" <denis.barishev@gmail.com
mailto:denis.barishev@gmail.com> wrote:

Hi there was problem with saving data bags I ran into it as well. It
was fixed in 0.10.2 bugs fix release.

0.10.0 -> 0.10.2 only contained a security did related to cookbook
permissions.

Yes you are absolutely right. I thought they would have merged that into
0.10.2. But it turned out that the resolution will be only merged into
0.10.4...
Look here http://tickets.opscode.com/browse/CHEF-2416
There's Nuo Yan's commit fixing that
Fix CHEF-2416 Data Bag Item edit error in WebUI · chef/chef@3805853 · GitHub

Hope this will work for you.

Thanks for your help. The linked patch looks exactly as it would fix the
problem. I guess I'll wait for 0.10.4 and use knife until then unless it
helps you If I test the patch.

Best
Silvan

On Sat, Jul 9, 2011 at 11:46, Denis Barishev denis.barishev@gmail.comwrote:

On 07/09/2011 08:08 AM, Bryan McLellan wrote:

On Jul 8, 2011 2:03 AM, "Denis Barishev" denis.barishev@gmail.com wrote:

Hi there was problem with saving data bags I ran into it as well. It was
fixed in 0.10.2 bugs fix release.

0.10.0 -> 0.10.2 only contained a security did related to cookbook
permissions.

Yes you are absolutely right. I thought they would have merged that into
0.10.2. But it turned out that the resolution will be only merged into
0.10.4...
Look here http://tickets.opscode.com/browse/CHEF-2416
There's Nuo Yan's commit fixing that
Fix CHEF-2416 Data Bag Item edit error in WebUI · chef/chef@3805853 · GitHub

Hope this will work for you.

--
Silvan T. Golega
Pidoco GmbH
Warschauer Str 58a
10243 Berlin
Tel. +49 30 4881 6385
silvan.golega@pidoco.com

Pidoco GmbH
Sitz der Gesellschaft: Berlin
Registergericht Berlin-Charlottenburg, HRB 115010
Geschäftsführer: Philipp Huy

Thanks Silvan!
I've already tested the patch and it works. It occurred for me that
editing data bags with the WebUI isn't that useful. I only use this
feature when debugging recipes that work with data bags...

Best regards,
Denis

On 07/11/2011 01:36 PM, Silvan T. Golega wrote:

Thanks for your help. The linked patch looks exactly as it would fix
the problem. I guess I'll wait for 0.10.4 and use knife until then
unless it helps you If I test the patch.

Best
Silvan

On Sat, Jul 9, 2011 at 11:46, Denis Barishev <denis.barishev@gmail.com
mailto:denis.barishev@gmail.com> wrote:

On 07/09/2011 08:08 AM, Bryan McLellan wrote:
On Jul 8, 2011 2:03 AM, "Denis Barishev"
<denis.barishev@gmail.com <mailto:denis.barishev@gmail.com>> wrote:
> Hi there was problem with saving data bags I ran into it as
well. It was fixed in 0.10.2 bugs fix release.

0.10.0 -> 0.10.2 only contained a security did related to
cookbook permissions.
Yes you are absolutely right. I thought they would have merged
that into 0.10.2. But it turned out that the resolution will be
only merged into 0.10.4...
Look here http://tickets.opscode.com/browse/CHEF-2416
There's Nuo Yan's commit fixing that
https://github.com/opscode/chef/commit/3805853fd39e6e742304505e91d9c4134c6a59e4

Hope this will work for you.

--
Silvan T. Golega
Pidoco GmbH
Warschauer Str 58a
10243 Berlin
Tel. +49 30 4881 6385
silvan.golega@pidoco.com mailto:silvan.golega@pidoco.com

www.pidoco.com http://www.pidoco.com

Pidoco GmbH
Sitz der Gesellschaft: Berlin
Registergericht Berlin-Charlottenburg, HRB 115010
Geschäftsführer: Philipp Huy