Couchbase
  • Why NoSQL?
  • Couchbase Server
  • Download
  • Resources
  • Careers
Home | Forums | Couchbase | Mobile

Getting an error code of 400 when trying to create database - any thoughts?

2 replies [Last post]
  • Login or register to post comments
Sun, 12/04/2011 - 16:34
stubbsi
Offline
Joined: 11/18/2011
Groups: None

if (!self.server)
{
self.server = [[CouchServer alloc] initWithURL: serverURL];
CouchDatabase *db = [self.server databaseNamed: kDatabaseName];

RESTOperation* op = [db create];
if (![op wait] && op.httpStatus != 412)
{ // 412 = Conflict; just means DB already exists
if (op.httpStatus != 0)
{ UIAlertView *alert = [[UIAlertView alloc] initWithTitle:kErrorDbCreateTitle
message:@"The database could not be created. Please email stubbsi@gmail.com with your details."
delegate:nil
cancelButtonTitle:@"Ok"
otherButtonTitles:nil];
alert.delegate = self;
[alert show];
}
}

Top
  • Login or register to post comments
Sun, 12/04/2011 - 19:22
jens
Offline
Joined: 10/04/2011
Groups: None

I suspect the database name is illegal. CouchDB allows only *lowercase* letters, numbers and hyphens.

If you look at the error property of the operation, it probably includes a text message describing what CouchDB didn't like.

--Jens

PS: You'll get more visibility on the mobile-couchbase Google group/mailing list. This forum UI here is kind of awkward :/

Top
  • Login or register to post comments
Mon, 12/05/2011 - 00:03
stubbsi
Offline
Joined: 11/18/2011
Groups: None

Thanks Jens

will move comments to the google forum.

You're right (of course) with your suggestion - have got it going again...

Iain

Top
  • Login or register to post comments
  • Login or register to post comments
  • Login
  • Register

Company

  • About Us
  • Leadership
  • Customers
  • Partners
  • Contact Us

Product

  • Couchbase Server
  • Couchbase SDKs
  • Use Cases
  • Documentation
  • Forums

Open Source

  • Couchbase Project
  • Couchbase vs. CouchDB

Commercial

  • Subscriptions & Support
  • Training & Services

News

  • Blog
  • Newsletter
  • Press Releases
  • Buzz

Follow Us

    
  • Customer Login
  • Terms of Service
  • Privacy Policy
  • Trademark Policy
  • Site Map

© 2013 COUCHBASE All rights reserved.

Sign in to Couchbase Community

close
  • Create new account
  • Request new password
You are logging into the Forums, Wiki and Issue Tracker