Attachments due to invalid_key
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?
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.
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.
Bug report with test case here:
http://couchbase.org/issues/browse/SPY-65
An example JSON dump that is being rejected:
Results in: