# MasterNotDiscoveredException exception when running create queries in CrateDB

**URL:** https://community.cratedb.com/t/masternotdiscoveredexception-exception-when-running-create-queries-in-cratedb/1846
**Category:** CrateDB
**Tags:** integration
**Created:** [September 11, 2024, 9:50am UTC](https://community.cratedb.com/t/masternotdiscoveredexception-exception-when-running-create-queries-in-cratedb/1846 "2024-09-11T09:50:30Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Prudhvi\_Boyina](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/prudhvi_boyina/32/1075_2.png) [@Prudhvi\_Boyina](https://community.cratedb.com/u/Prudhvi_Boyina)
#### Post date: [September 11, 2024, 9:50am UTC](https://community.cratedb.com/t/masternotdiscoveredexception-exception-when-running-create-queries-in-cratedb/1846/1 "2024-09-11T09:50:30Z")

</div>

Hi Team,

I am getting exception when creating an user/table in CrateDB.

I was able to run the select quries.

Exception : **MasterNotDiscoveredException[org.elasticsearch.cluster.block.ClusterBlockException: blocked by: [SERVICE\_UNAVAILABLE/1/state not recovered / initialized];]**

What could be the reason, why it is blocking the create operation?

I have attached the yaml file please refer that as well.

```auto
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: crate-poc
  namespace: crate
spec:
  serviceName: "crate-set"
  replicas: 2
  selector:
    matchLabels:
      app: crate
  template:
    metadata:
      labels:
        app: crate
    spec:
      initContainers:
        - name: init-sysctl
          image: busybox
          imagePullPolicy: IfNotPresent
          command: ["sysctl", "-w", "vm.max_map_count=262144"]
          securityContext:
            privileged: true
      containers:
        - name: crate
          image: crate:5.8.1
          command:
            - /docker-entrypoint.sh
            - -Ccluster.name=${CLUSTER_NAME}
            - -Cgateway.recover_after_nodes=2
            - -Cgateway.expected_nodes=${EXPECTED_NODES}
            - -Cpath.data=/data
          volumeMounts:
            - mountPath: /data
              name: data
          resources:
            limits:
              cpu: "4"
              memory: "4Gi"
            requests:
              cpu: "2"
              memory: "4Gi"
          ports:
            - containerPort: 4300
              name: crate-internal
            - containerPort: 4200
              name: crate-web
            - containerPort: 5432
              name: postgres
          env:
            - name: CRATE_HEAP_SIZE
              value: "1024m"
            - name: EXPECTED_NODES
              value: "2"
            - name: CLUSTER_NAME
              value: "crate-poc"
            - name: NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
  volumeClaimTemplates:
    - metadata:
        name: data
      spec:
        accessModes: ["ReadWriteOnce"]
        resources:
          requests:
            storage: 30Gi

```

Thanks,  
Prudhvi Boyina

---

<div class="post-metadata">

### Author: ![hernanc](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/hernanc/32/676_2.png) [@hernanc](https://community.cratedb.com/u/hernanc)
#### Post date: [September 15, 2024, 12:11pm UTC](https://community.cratedb.com/t/masternotdiscoveredexception-exception-when-running-create-queries-in-cratedb/1846/2 "2024-09-15T12:11:51Z")

</div>

Hi,  
In this case I would look at the logs from both pods for further details, maybe you want to share those?
