Hello Team,
I am new to couch base and i am trying to create a bucket with java sdk 3.0.5 and couchbase server 6.5 community edition using below logic .I am getting the following error. Can you please suggest how to proceed.
Logic:
String configJson = “{“name”:”" + bucketName+"""
+ “,“controllers”:” + “{“flush”:“false”}”
+ “,“quota”:” + “{“rawRAM”:”" + lquota+""}"
+ “,“replicaNumber”:” + 0
+ “,“replicaIndex”:” + false
// + “,“maxTTL”:” + 0
// + “,“compressionMode”:“off””
+ “,“bucketType”:“membase””
// + “,“conflictResolutionType”:” ConflictResolutionType.TIMESTAMP""
+ “,“conflictResolutionType”:“seqno””
// + “,“evictionPolicy”:“EjectionPolicy.FULL””
+ “,“evictionPolicy”:“valueOnly””
+ “}”;
BucketSettings bucketSettings = new ObjectMapper().readerFor(BucketSettings.class).readValue(configJson);
CompletableFuture result = bucketManager.createBucket(bucketSettings);
ERROR:
{“errors”:{“maxTTL”:“Max TTL is supported in enterprise edition only”,“compressionMode”:“Compression mode is supported in enterprise edition only”},“summaries”:{“ramSummary”:{“total”:9492758528,“otherBuckets”:1283457024,"nodes.
Hi @kamesh_kumar, thank you for reporting this. I’ll see if I can replicate it. You should be able to create a bucket against community edition, of course, so if you can’t there could be a bug here.
Thank you so much graham.pople for quick reply!!Alternatively , i have tried with SDK version 2.7.7 with couchbase server community edition 6.5 and i am able to create successfully.
Can you please provide any alternate approach if you have to achieve it. Since i am not able to do with SDK code ,currently i used WEB UI to create bucket to further proceed
Hey @kamesh_kumar along with the UI, you can also use the REST API to programmatically create buckets:
(The Java SDK is actually just wrapping this REST API here.)
By the way, I have filed https://issues.couchbase.com/browse/JCBC-1676 for this issue, but haven’t had a chance to properly investigate yet.
Thanks for doing the needful.
I am proceeding with the suggested approach.once again thanks a lot!!
I’m seeing the same thing. I’m fairly certain that because the BucketSettings uses primitives and gives them default values that you are always sending values for features that aren’t available in the Community Edition. I think you just need to allow null and then ignore them when you generate the parameters in sendRequest.
1 Like
Apologies for the delay in fixing this one. It’s now patched and will be released in the next Java SDK, ETA is 1st June.