Bug #108378 mysql-operator deploy failed
Submitted: 5 Sep 2022 7:33 Modified: 6 Sep 2022 4:22
Reporter: rui li Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Operator Severity:S3 (Non-critical)
Version:8.0.30 OS:Any
Assigned to: CPU Architecture:Any

[5 Sep 2022 7:33] rui li
Description:
when I use yaml below:
```
kind: StatefulSet
apiVersion: apps/v1
metadata:
  name: mycluster
  labels:
    mysql.oracle.com/cluster: mycluster
    tier: mysql
spec:
  replicas: 3
  selector:
    matchLabels:
      component: mysqld
      mysql.oracle.com/cluster: mycluster
      tier: mysql
  template:
    metadata:
      creationTimestamp: null
      labels:
        component: mysqld
        mysql.oracle.com/cluster: mycluster
        tier: mysql
```

How to repeat:
total 0
/mnt:
total 0
drwxrwsrwx 3 root mysql 243 Sep 2 09:52 initconf
drwxrwsrwx 2 root mysql 6 Sep 2 09:52 mycnfdata
/mnt/initconf:
total 0
lrwxrwxrwx 1 root root 19 Sep 2 09:52 00-basic.cnf -> ..data/00-basic.cnf
lrwxrwxrwx 1 root root 31 Sep 2 09:52 01-group_replication.cnf -> ..data/01-group_replication.cnf
lrwxrwxrwx 1 root root 17 Sep 2 09:52 02-ssl.cnf -> ..data/02-ssl.cnf
lrwxrwxrwx 1 root root 19 Sep 2 09:52 99-extra.cnf -> ..data/99-extra.cnf
lrwxrwxrwx 1 root root 27 Sep 2 09:52 initdb-localroot.sql -> ..data/initdb-localroot.sql
lrwxrwxrwx 1 root root 23 Sep 2 09:52 livenessprobe.sh -> ..data/livenessprobe.sh
lrwxrwxrwx 1 root root 16 Sep 2 09:52 my.cnf.in -> ..data/my.cnf.in
lrwxrwxrwx 1 root root 24 Sep 2 09:52 readinessprobe.sh -> ..data/readinessprobe.sh
/mnt/mycnfdata:
total 0
Could not get cluster gdmp/mycluster: (404)
Reason: Not Found
HTTP response headers: HTTPHeaderDict({'Audit-Id': '4f93f37f-892c-4f87-8f59-7c6b6e12f07b', 'Cache-Control': 'no-cache, private', 'Content-Type': 'application/json', 'X-Kubernetes-Pf-Flowschema-Uid': 'aa34953d-a73f-4b84-819f-85c28fb2a138', 'X-Kubernetes-Pf-Prioritylevel-Uid': 'f380c5cc-e82c-490b-81a7-224b7cfe21f8', 'Date': 'Mon, 05 Sep 2022 07:21:41 GMT', 'Content-Length': '250'})
HTTP response body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"innodbclusters.mysql.oracle.com \"mycluster\" not found","reason":"NotFound","details":{"name":"mycluster","group":"mysql.oracle.com","kind":"innodbclusters"},"code":404}
Traceback (most recent call last):
File "/usr/lib/mysqlsh/python-packages/mysqloperator/init_main.py", line 90, in main
init_conf(datadir, pod, cluster, logger)
File "/usr/lib/mysqlsh/python-packages/mysqloperator/init_main.py", line 32, in init_conf
server_id = pod.index + cluster.parsed_spec.baseServerId
AttributeError: 'NoneType' object has no attribute 'parsed_spec'
2022-09-05T07:21:41 - [CRITICAL] [initmysql] Unhandled exception while bootstrapping MySQL: 'NoneType' object has no attribute 'parsed_spec'
[5 Sep 2022 7:34] rui li
mysql-operator.yaml

Attachment: mysql-ha-official.yml (application/octet-stream, text), 20.62 KiB.

[6 Sep 2022 4:22] MySQL Verification Team
Hi,

Thanks for the report