You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Wordit Ltd <wo...@googlemail.com> on 2010/11/03 17:57:36 UTC
Correct db name but receiving 400 response
Can anyone help with this strange error. I am trying to connect to a
db with jquery like this:
var $db = $.couch.db("fruit");
The name is written correctly. And get the error:
"400 reason:Only lowercase characters (a-z), digits (0-9), and any of
the characters _, $, (, ), +, -, and / are allowed. Must begin with a
letter."
Checking the json output, CouchDB shows this:
{"db_name":"fruit","doc_count":4,...
The name is correct, no illegal chars, so why the error?
I'm using couchone hosting, so it can't be my installation.
Many Thanks,
Marcus
Re: Correct db name but receiving 400 response
Posted by Marcus <ma...@wordit.com>.
On Thu, Nov 4, 2010 at 1:40 AM, Chad George <ch...@mgproducts.com> wrote:
> this looks suspect to me:
> $.couch.db($db).allDocs({ ... });
>
> try this:
> $db.allDocs( { ... });
Thanks Chad, that works. Odd though, I copied the code from tutorial.
I discovered this also works:
$.couch.db("dbname").allDocs({ ... });
Marcus
Re: Correct db name but receiving 400 response
Posted by Chad George <ch...@mgproducts.com>.
this looks suspect to me:
$.couch.db($db).allDocs({ ... });
try this:
$db.allDocs( { ... });
On Wed, Nov 3, 2010 at 6:36 PM, Wordit Ltd <wo...@googlemail.com> wrote:
> On Wed, Nov 3, 2010 at 11:00 PM, Paul Davis <pa...@gmail.com>
> wrote:
> >
> > You should be able to get logs from a URL like:
> >
> > http://127.0.0.1:5984/_log
>
> Thanks Paul. This is the URL, which wrongly uses "[object Object]"
> instead of the db name. Log message:
>
> 'GET' /%5Bobject%20Object%5D/_all_docs 400
>
> This is my jquery code:
>
> var $db = $.couch.db("fruit");
>
> $.couch.db($db).allDocs({
> error:function(status,id,reason) {
> alert (status+" reason:"+reason);
> },
>
> success:function(resp) {
> alert (resp);
> }
> });
>
> Any ideas what the cause is?
>
> Thanks,
>
> Marcus
>
Re: Correct db name but receiving 400 response
Posted by Paul Davis <pa...@gmail.com>.
On Wed, Nov 3, 2010 at 6:36 PM, Wordit Ltd <wo...@googlemail.com> wrote:
> On Wed, Nov 3, 2010 at 11:00 PM, Paul Davis <pa...@gmail.com> wrote:
>>
>> You should be able to get logs from a URL like:
>>
>> http://127.0.0.1:5984/_log
>
> Thanks Paul. This is the URL, which wrongly uses "[object Object]"
> instead of the db name. Log message:
>
> 'GET' /%5Bobject%20Object%5D/_all_docs 400
>
> This is my jquery code:
>
> var $db = $.couch.db("fruit");
>
> $.couch.db($db).allDocs({
> error:function(status,id,reason) {
> alert (status+" reason:"+reason);
> },
>
> success:function(resp) {
> alert (resp);
> }
> });
>
> Any ideas what the cause is?
>
> Thanks,
>
> Marcus
>
Couldn't say. I'm not too familiar with the jquery plugin. You might
try looking through the Futon sources to see how its used there.
Paul
Re: Correct db name but receiving 400 response
Posted by Wordit Ltd <wo...@googlemail.com>.
On Wed, Nov 3, 2010 at 11:00 PM, Paul Davis <pa...@gmail.com> wrote:
>
> You should be able to get logs from a URL like:
>
> http://127.0.0.1:5984/_log
Thanks Paul. This is the URL, which wrongly uses "[object Object]"
instead of the db name. Log message:
'GET' /%5Bobject%20Object%5D/_all_docs 400
This is my jquery code:
var $db = $.couch.db("fruit");
$.couch.db($db).allDocs({
error:function(status,id,reason) {
alert (status+" reason:"+reason);
},
success:function(resp) {
alert (resp);
}
});
Any ideas what the cause is?
Thanks,
Marcus
Re: Correct db name but receiving 400 response
Posted by Paul Davis <pa...@gmail.com>.
On Wed, Nov 3, 2010 at 5:38 PM, Marcus <ma...@wordit.com> wrote:
> On Wed, Nov 3, 2010 at 6:17 PM, Paul Davis <pa...@gmail.com> wrote:
>>
>> Can you check the logs to see what the URL was that was requested?
>
> Do you mean web server logs? I'm using couchone hosting and don't have
> access to server logs. Does CouchDB keep request logs accessible via
> Futon?
>
> Thanks,
>
> Marcus
>
You should be able to get logs from a URL like:
http://127.0.0.1:5984/_log
Paul
Re: Correct db name but receiving 400 response
Posted by Marcus <ma...@wordit.com>.
On Wed, Nov 3, 2010 at 6:17 PM, Paul Davis <pa...@gmail.com> wrote:
>
> Can you check the logs to see what the URL was that was requested?
Do you mean web server logs? I'm using couchone hosting and don't have
access to server logs. Does CouchDB keep request logs accessible via
Futon?
Thanks,
Marcus
Re: Correct db name but receiving 400 response
Posted by Paul Davis <pa...@gmail.com>.
On Wed, Nov 3, 2010 at 12:57 PM, Wordit Ltd <wo...@googlemail.com> wrote:
> Can anyone help with this strange error. I am trying to connect to a
> db with jquery like this:
>
> var $db = $.couch.db("fruit");
>
> The name is written correctly. And get the error:
>
> "400 reason:Only lowercase characters (a-z), digits (0-9), and any of
> the characters _, $, (, ), +, -, and / are allowed. Must begin with a
> letter."
>
> Checking the json output, CouchDB shows this:
> {"db_name":"fruit","doc_count":4,...
>
> The name is correct, no illegal chars, so why the error?
> I'm using couchone hosting, so it can't be my installation.
>
> Many Thanks,
>
> Marcus
>
Can you check the logs to see what the URL was that was requested?
Paul