Couchbase cluster upgrade to 2.3 failing

Hi,

I am trying to upgrade our couchbase clusters to 2.3 from 2.1 and keep on seeing the error:
spec.version in body cannot be updated

I have tried to copy as much the same yaml configs as we used to deploy 2.1.

My sample Yaml:

cluster:
image: “couchbase/couchbase-server:7.0.3”
recoveryPolicy: PrioritizeDataIntegrity
security:
adminSecret: auth-dev-cluster-couchbase-cluster
rbac:
selector:
matchLabels:
cluster: dev-cluster-couchbase-cluster
securityContext:
fsGroup: 1000
runAsNonRoot: true
runAsUser: 1000
networking:
exposeAdminConsole: true
adminConsoleServices:
- data
exposedFeatures:
- client
- xdcr
exposedFeatureTrafficPolicy: Local
exposedFeatureServiceType: NodePort
networkPlatform: Istio
adminConsoleServiceType: NodePort
xdcr: {}
monitoring:
prometheus:
image: “couchbase/couchbase-exporter:1.0.3”
enabled: true
backup:
managed: true
image: couchbase/operator-backup:1.2.0
serviceAccountName: backup-dev-cluster-couchbase-cluster
logging:
logRetentionCount: 20
logRetentionTime: 604800s
cluster:
autoFailoverMaxCount: 3
autoFailoverOnDataDiskIssues: true
autoFailoverOnDataDiskIssuesTimePeriod: 2m0s
autoFailoverTimeout: 2m0s
dataServiceMemoryQuota: 5Gi
indexServiceMemoryQuota: 1Gi
searchServiceMemoryQuota: 1Gi
eventingServiceMemoryQuota: 256Mi
analyticsServiceMemoryQuota: 1Gi
indexStorageSetting: plasma
indexer:
storageMode: plasma
autoCompaction:
databaseFragmentationThreshold:
percent: 25
size: 1Gi
viewFragmentationThreshold:
percent: 25
size: 1Gi
tombstonePurgeInterval: 48h0m0s
timeWindow: {}
buckets:
selector:
matchLabels:
cluster: dev-cluster-couchbase-cluster
enablePreviewScaling: true
hibernationStrategy: Immediate
servers:
data:
autoscaleEnabled: true
pod:
metadata: {}
spec:
containers:
resources:
limits:
cpu: “2”
memory: 6Gi
requests:
memory: 2Gi
services:
- data
size: 5
volumeMounts:
default: default
data: data
index_query:
autoscaleEnabled: true
pod:
metadata: {}
spec:
containers:
resources:
limits:
cpu: “2”
memory: 2Gi
requests:
memory: 500Mi
services:
- index
- query
size: 2
volumeMounts:
default: default
index: index
default:
autoscaleEnabled: true
pod:
metadata: {}
spec:
containers:
env:
envFrom: null
resources:
limits:
cpu: “2”
memory: 2Gi
requests:
memory: 500Mi
size: 1
services:
- search
- eventing
volumeMounts:
default: default
volumeClaimTemplates:

  • metadata:
    name: data
    spec:
    accessModes:
    • ReadWriteOnce
      resources:
      requests:
      storage: 5Gi
      storageClassName: pure-block
  • metadata:
    name: index
    spec:
    accessModes:
    • ReadWriteOnce
      resources:
      requests:
      storage: 5Gi
      storageClassName: pure-block
  • metadata:
    name: default
    spec:
    accessModes:
    • ReadWriteOnce
      resources:
      requests:
      storage: 5Gi
      storageClassName: pure-block

Hello!

How are you attempting to upgrade operator? Is it via Helm?

Thanks,

Justin Ashworth

yes… operator and DAC upgraded fine but cluster is what is throwing error

That’s weird, we don’t have a spec.version field. Are you sure it is the DAC or Operator that is rejecting your yaml?

This is the full error:

Error: UPGRADE FAILED: cannot patch “dev-cluster-couchbase-cluster” with kind CouchbaseCluster: admission webhook “couchbase-admission-controller-couchbase-admission-controller.default.svc” denied the request: validation failure list:
spec.version in body cannot be updated

Let me know if you want me to run it with debug

Can you do helm show chart couchbase/couchbase-operator and let me know the output?

apiVersion: v2
appVersion: 2.5.0
description: A Helm chart to deploy the Couchbase Autonomous Operator for easily deploying,
managing, and maintaining Couchbase Clusters. Couchbase Server is a NoSQL document
database with a distributed architecture for performance, scalability, and availability.
It enables developers to build applications easier and faster by leveraging the
power of SQL with the flexibility of JSON.
home: https://couchbase.com
icon: https://couchbase-partners.github.io/helm-charts/assets/img/CB_Logomark_220.png
keywords:

And this is what is currently deployed:

list
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
dev-cluster cb 78 2023-09-07 16:24:03.4779279 -0400 EDT failed couchbase-operator-2.3.002 2.3.0
operator cb 1 2023-09-06 17:07:21.5719857 -0400 EDT deployed couchbase-operator-2.3.002 2.3.0

Did you perform a helm upgrade on the dev-cluster release?

Thats what we keep getting error on:

helm -n cb upgrade dev-cluster couchbase/couchbase-operator --version 2.3.002 -f dev-cluster.yaml --set cluster.security.password=<>

Error: UPGRADE FAILED: cannot patch “dev-cluster-couchbase-cluster” with kind CouchbaseCluster: admission webhook “couchbase-admission-controller-couchbase-admission-controller.default.svc” denied the request: validation failure list:
spec.version in body cannot be updated

Did you update the crds via:

helm pull couchbase/couchbase-operator
tar -xf couchbase-operator-2.3.002.tbz
kubectl apply -f couchbase-operator/crds/couchbase.crds.yaml

Nope… Do I need to?

And if yes, what needs to be updated?

You can find the documentation for updating a release here
https://docs.couchbase.com/operator/2.3/helm-managing-guide.html#upgrading-the-autonomous-operator

The issue appears to be a 2.1 CRD with a 2.3 Operator/DAC, which would cause issues.

1 Like

That did the trick. I updated the crds and cluster upgraded.
Thanks for your help

Great! Thanks for reaching out!