incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Cottlehuber <d...@muse.net.nz>
Subject Re: Got an exception when I creating the document
Date Mon, 11 Jul 2011 08:49:15 GMT
On 11 July 2011 14:55, Eranda Sooriyabandara <070468d@gmail.com> wrote:
> Hi Dave,
> The log says,
>
> [Mon, 11 Jul 2011 02:44:50 GMT] [info] [<0.688.0>] 127.0.0.1 - - 'PUT'
> /Twitapp/_design%2Ftwits 500
>
> thanks
>
> Eranda
>

Hi Eranda,


You can clearly see above that your DB name has uppercase in it; I'm
not familiar with jcouch so you'll need to work through why your
library is converting the DB name to Uppercase first. I can't
replicate CouchDB returning a 500 from this but let's deal with the
simple bits first.

Re the couchdb logs, you should see more than just what you posted
above incl all the headers. For example, here's the contents of
couch.log clearly showing the URL I tried and the headers passed
through:

[Mon, 11 Jul 2011 08:03:33 GMT] [debug] [<0.31803.54>] 'PUT'
/Newdb/_design/ddoc {1,1} from "127.0.0.1"
Headers: [{'Accept',"*/*"},
          {'Authorization',"Basic YWRtaW34675834gfdhsfdsffdsfdshj="},
          {'Content-Length',"18"},
          {'Content-Type',"application/json"},
          {'Host',"localhost:5984"},
          {'User-Agent',"curl/7.19.7 (universal-apple-darwin10.0)
libcurl/7.19.7 OpenSSL/0.9.8r zlib/1.2.3"}]
[Mon, 11 Jul 2011 08:03:33 GMT] [debug] [<0.31803.54>] OAuth Params: []
[Mon, 11 Jul 2011 08:03:33 GMT] [debug] [<0.31803.54>] Minor error in
HTTP request: {error,
                                                     illegal_database_name}
[Mon, 11 Jul 2011 08:03:33 GMT] [debug] [<0.31803.54>] Stacktrace:
[{io_lib_pretty,cind_tag_tuple,7},
                                    {io_lib_pretty,while_fail,3},
                                    {io_lib_pretty,print,6},
                                    {io_lib_format,build,3},
                                    {io_lib_format,build,3},
                                    {io_lib_format,build,3},
                                    {io_lib_format,build,3},
                                    {io_lib_format,build,3}]
[Mon, 11 Jul 2011 08:03:33 GMT] [info] [<0.31803.54>] 127.0.0.1 - -
'PUT' /Newdb/_design/ddoc 400
[Mon, 11 Jul 2011 08:03:33 GMT] [debug] [<0.31803.54>] httpd 400 error response:
 {"error":"illegal_database_name","reason":"Only lowercase characters
(a-z), digits (0-9), and any of the characters _, $, (, ), +, -, and /
are allowed. Must begin with a letter."}


& here's the curl I used to generate it:

dave@akai /tmp % curl -H "Content-Type: application/json" -vX PUT
http://admin:password@localhost:5984/Newdb/_design/ddoc -d '{"butt"
:"kicked"}'
* About to connect() to localhost port 5984 (#0)
*   Trying 127.0.0.1... connected
* Connected to localhost (127.0.0.1) port 5984 (#0)
* Server auth using Basic with user 'admin'
> PUT /Newdb/_design/ddoc HTTP/1.1
> Authorization: Basic YWRtaW34675834gfdhsfdsffdsfdshj=
> User-Agent: curl/7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7 OpenSSL/0.9.8r zlib/1.2.3
> Host: localhost:5984
> Accept: */*
> Content-Type: application/json
> Content-Length: 18
>

< HTTP/1.1 400 Bad Request
< Server: CouchDB/1.1.0 (Erlang OTP/R14B03)
< Date: Mon, 11 Jul 2011 08:03:33 GMT
< Content-Type: text/plain;charset=utf-8
< Content-Length: 181
< Cache-Control: must-revalidate
<
{"error":"illegal_database_name","reason":"Only lowercase characters
(a-z), digits (0-9), and any of the characters _, $, (, ), +, -, and /
are allowed. Must begin with a letter."}
* Connection #0 to host localhost left intact
* Closing connection #0

- can you recreate the issue with curl, or is this only with jcouchdb?
- have you tried a simple example like the ones at
http://code.google.com/p/jcouchdb/wiki/Tutorial ?
- how about posting a short segment of your code & changing the
subject to indicate that jcouch is involved?

A+
Dave

Mime
View raw message