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

Attachments due to invalid_key

4 replies [Last post]
  • Login or register to post comments
Tue, 11/15/2011 - 16:31
zortness
Offline
Joined: 11/09/2011
Groups: None

For some reason a lot of documents I'm transferring over from another DB are being inserted as attachments with the reason specified as "invalid_key". Yet, when I pull up the document, the _id is actually the one I specified, so it's obviously being saved. Does anyone have any idea why this might be happening?

Top
  • Login or register to post comments
Tue, 11/15/2011 - 17:04
zortness
Offline
Joined: 11/09/2011
Groups: None

An example JSON dump that is being rejected:

{"internalId":"4e8f6594ebf76f76f9b00426","version":1318022333557,"network":1,"networkId":"100001416","email":"franz@test.com","name":"Franz Hoenheim","firstName":"Franz","lastName":"Hoenheim","birthday":"01/04/1982","picUrl":"","timezone":"-4","locale":"en_US","gender":"male","hometown":null,"location":null,"createdAt":1318020500562,"lastLogin":1318022333553,"credits":0,"password":null,"verified":true,"verificationHash":"da41dd7178aa49c6305e23975e1d7edf","admin":false,"newsletter":true,"hash":"4bcebc3ddbb67f043dab7dd91a320175","_id":"4e8f6594ebf76f76f9b00426","_rev":null}

Results in:

{
	"_id": "4e8f6594ebf76f76f9b00426",
	"_rev": "4-05abed9e66e5987a50c68728be0dc060",
	"$flags": 0,
	"$expiration": 0,
	"$att_reason": "invalid_key",
	"_attachments": {
		"value": {
			"content_type": "application/content-stream",
			"revpos": 1,
			"digest": "md5-0cu4nOLgSfOGtq4Y+hCgmA==",
			"length": 642,
			"stub": true
		}
	}
}

Top
  • Login or register to post comments
Tue, 11/15/2011 - 17:23
zortness
Offline
Joined: 11/09/2011
Groups: None

Also, inserting the records via the ektorp driver on the raw CouchDB api works fine (but takes forever). This only seems to happen with the CouchbaseClient.

Top
  • Login or register to post comments
Tue, 11/15/2011 - 18:06
zortness
Offline
Joined: 11/09/2011
Groups: None

Played with it some more. It looks like this happens when using the set method. I also tried switching to using MemcachedClient and connecting over the port and calling set, which resulted in the same issue.

ObjectMapper mapper = new ObjectMapper();
InetSocketAddress a = new InetSocketAddress("localhost", 10000);
MemcachedClient mc = new MemcachedClient(a);
mc.set(myObj._id, 0,  mapper.writeValueAsString(myObj));

yields the same as

ObjectMapper mapper = new ObjectMapper();
List<URI> hosts = new ArrayList<URI>();
hosts.add(new URI("http://localhost:8091/pools"));
CouchbaseClient cc = new CouchbaseClient(hosts, "default", "default", "");
OperationFuture<Boolean> result = cc.set(myObj._id, 0,  mapper.writeValueAsString(myObj));
result.get();

With the bucket on port 10000 with no auth.

Using the ektorp driver, the insert succeeds, but very slowly.

Top
  • Login or register to post comments
Wed, 11/16/2011 - 09:53
zortness
Offline
Joined: 11/09/2011
Groups: None

Bug report with test case here:
http://couchbase.org/issues/browse/SPY-65

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