Skip to content
This repository was archived by the owner on Dec 30, 2020. It is now read-only.
This repository was archived by the owner on Dec 30, 2020. It is now read-only.

HTTP 500 Error while uploading data bag item from file #13

Open
@ageron

Description

@ageron

I get HTTP 500 Errors when trying to upload a data bag item from a file:

$ knife --version
Chef: 11.4.0

$ ruby --version
ruby 1.9.3p286 (2012-10-12 revision 37165) [x86_64-darwin11.4.2]

$ knife data bag from file users data_bags/users/django.json
ERROR: Server returned error for http://54.246.162.231:8000/api/data/users/django, retrying 1/5 in 4s
ERROR: Server returned error for http://54.246.162.231:8000/api/data/users/django, retrying 2/5 in 5s
ERROR: Server returned error for http://54.246.162.231:8000/api/data/users/django, retrying 3/5 in 11s
ERROR: Server returned error for http://54.246.162.231:8000/api/data/users/django, retrying 4/5 in 19s
ERROR: Server returned error for http://54.246.162.231:8000/api/data/users/django, retrying 5/5 in 51s
ERROR: internal server error
Response: Name mismatch in data bag item

Here's the error on the server side:

[18/Apr/2013 04:38:17] "PUT /api/data/users/django HTTP/1.0" 500 641
DEBUG Traceback (most recent call last):
File "/var/django/current/commis/utils/chef_api.py", line 101, in execute_request
data = view(request, _args, *_kwargs)
File "/var/django/current/commis/generic_views/api.py", line 62, in wrapper_view
return view(self.instance, request, _args, *_kwargs)
File "/var/django/current/commis/generic_views/api.py", line 22, in inner
return fn(_args, *_kwargs)
File "/var/django/current/commis/data_bags/views.py", line 53, in item_update
raise ChefAPIError(500, 'Name mismatch in data bag item')
ChefAPIError

DEBUG {
"error": "Name mismatch in data bag item"
}

After debugging a bit, I found that the server is looking for the item json data directly in the raw post data, but in fact knife is sending it within a larger json document, in the raw_data attribute.

Did the knife client change recently ?

Thanks for your help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions