Skip to content

simple document creation works on couchdb, but not on mobile #237

Closed
@djc

Description

@djc

From mich...@hinespot.com on June 05, 2014 05:29:30

What steps will reproduce the problem? 1. Start a couchbase-mobile database on Android and pull-replicate the data from a remote couchdb server to the phone.
2. pip install couchdb 0.9
3. Try create a simple document (no attachments) What is the expected output? What do you see instead? mrhines@mrhinesdev:~/mica$ python
Python 2.7.5+ (default, Feb 27 2014, 19:39:55)
[GCC 4.8.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.

from couchdb import Server
s = Server("http://admin:super_secret_password@localhost:5984/"
db = s["mica"]
db["foo"] = { "bar" : "hello" }
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python2.7/dist-packages/couchdb/client.py", line 344, in setitem
status, headers, data = resource.put_json(body=content)
File "/usr/local/lib/python2.7/dist-packages/couchdb/http.py", line 531, in put_json
**params)
File "/usr/local/lib/python2.7/dist-packages/couchdb/http.py", line 547, in _request_json
if 'application/json' in headers.get('content-type'):
TypeError: argument of type 'NoneType' is not iterable

This does work with couchdbkit (but I don't want to use couchdbkit!, I want to use couchdb-python!):

mrhines@mrhinesdev:~/mica$ python
Python 2.7.5+ (default, Feb 27 2014, 19:39:55)
[GCC 4.8.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.

from couchdbkit import Server
s = Server("http://admin:super_secret_password@localhost:5984/"
db = s["mica"]
db["foo"] = { "bar" : "hello" }
What version of the product are you using? On what operating system? $ sudo pip install couchdb (gets 0.9) Please provide any additional information below. If it helps, here's the output from my debugger showing the contents of the HTTP response of the document creation. I'm more than happy to get you anymore debug information that you like. Just let me know.

The Response code was: 200

content-type: application/json
mime-version: 1.0
server: D. Rogatkin's TJWS with Android support (aka Acme.Serve)/Version 1.105, $Revision: 1.267 $,Couchbase Lite devbuild-0
date: Thu, 05 Jun 2014 03:25:47 GMT
transfer-encoding: chunked
connection: keep-alive
keep-alive: timeout=30, max=100

Original issue: http://code.google.com/p/couchdb-python/issues/detail?id=237

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions