oracle / oracle-database-operator

The Oracle Database Operator for Kubernetes (a.k.a. OraOperator) helps developers, DBAs, DevOps and GitOps teams reduce the time and complexity of deploying and managing Oracle Databases. It eliminates the dependency on a human operator or administrator for the majority of database operations.
Universal Permissive License v1.0
140 stars 45 forks source link

free and xe DB is running but operator reports Unhealthy #115

Closed rbaumgar closed 4 months ago

rbaumgar commented 4 months ago

I created a free or xe DB. DBs are working, but operator still reports

$ kubectl get singleinstancedatabase freedb -o "jsonpath={.status.status}"
Unhealthy

free.yaml

apiVersion: database.oracle.com/v1alpha1
kind: SingleInstanceDatabase
metadata:
  name: freedb
  namespace: default
spec:
  sid: FREE
  edition: free
  adminPassword:
    secretName: freedb-admin-secret
  image:
    pullFrom: container-registry.oracle.com/database/free:latest
    prebuiltDB: true
  persistence:
    size: 5Gi
    storageClass: nfs-csi-storage
    setWritePermissions: false
    accessMode: "ReadWriteOnce"
  replicas: 1

free.log

SQL> Disconnected from Oracle Database 23ai Free Release 23.0.0.0.0 - Develop, Learn, and Run for Free
Version 23.4.0.24.05
The Oracle base remains unchanged with value /opt/oracle
#########################
DATABASE IS READY TO USE!
#########################
The following output is now a tail of the alert.log:
Dumping current patch information
===========================================================
No patches have been applied
===========================================================
2024-07-04T06:26:24.145867+00:00
FREEPDB1(3):Opening pdb with Resource Manager plan: DEFAULT_PLAN
Completed: Pluggable database FREEPDB1 opened read write
Completed: ALTER DATABASE OPEN
2024-07-04T06:26:26.495197+00:00
FREEPDB1(3):TABLE AUDSYS.AUD$UNIFIED: ADDED INTERVAL PARTITION SYS_P304 (3657) VALUES LESS THAN (TIMESTAMP' 2024-07-05 00:00:00')
2024-07-04T06:27:13.390256+00:00
TABLE SYS.WRP$_REPORTS: ADDED AUTOLIST FRAGMENT SYS_P373 (3) VALUES (( 1439224760, TO_DATE(' 2024-07-01 00:00:00', 'syyyy-mm-dd hh24:mi:ss', 'nls_calendar=gregorian') ))
TABLE SYS.WRP$_REPORTS_DETAILS: ADDED AUTOLIST FRAGMENT SYS_P374 (3) VALUES (( 1439224760, TO_DATE(' 2024-07-01 00:00:00', 'syyyy-mm-dd hh24:mi:ss', 'nls_calendar=gregorian') ))
TABLE SYS.WRP$_REPORTS_TIME_BANDS: ADDED AUTOLIST FRAGMENT SYS_P377 (3) VALUES (( 1439224760, TO_DATE(' 2024-07-01 00:00:00', 'syyyy-mm-dd hh24:mi:ss', 'nls_calendar=gregorian') ))
2024-07-04T06:36:13.309053+00:00
Resize operation completed for file# 3, fname /opt/oracle/oradata/FREE/sysaux01.dbf, old size 624640K, new size 655360K
2024-07-04T06:46:15.543328+00:00
FREEPDB1(3):Resize operation completed for file# 13, fname /opt/oracle/oradata/FREE/FREEPDB1/sysaux01.dbf, old size 409600K, new size 430080K

operator.log

2024-07-04T06:26:44Z    INFO    controllers.database.SingleInstanceDatabase Found Existing PVC  {"createPVC Datafiles-Vol": {"name":"freedb","namespace":"default"}, "Name": "freedb"}
2024-07-04T06:26:44Z    INFO    Ready Pod   {"controller": "singleinstancedatabase", "controllerGroup": "database.oracle.com", "controllerKind": "SingleInstanceDatabase", "SingleInstanceDatabase": {"name":"freedb","namespace":"default"}, "namespace": "default", "name": "freedb", "reconcileID": "71732ad4-c3cd-441b-a98e-ed429e12b7a6", "FindPods": {"name":"freedb","namespace":"default"}, "Name :": "freedb-4kpix"}
2024-07-04T06:26:44Z    INFO    freedb Pods Available ( Other Than Ready Pod )  {"controller": "singleinstancedatabase", "controllerGroup": "database.oracle.com", "controllerKind": "SingleInstanceDatabase", "SingleInstanceDatabase": {"name":"freedb","namespace":"default"}, "namespace": "default", "name": "freedb", "reconcileID": "71732ad4-c3cd-441b-a98e-ed429e12b7a6", "FindPods": {"name":"freedb","namespace":"default"}, " Names :": []}
2024-07-04T06:26:44Z    INFO    Total No Of freedb PODS {"controller": "singleinstancedatabase", "controllerGroup": "database.oracle.com", "controllerKind": "SingleInstanceDatabase", "SingleInstanceDatabase": {"name":"freedb","namespace":"default"}, "namespace": "default", "name": "freedb", "reconcileID": "71732ad4-c3cd-441b-a98e-ed429e12b7a6", "FindPods": {"name":"freedb","namespace":"default"}, "Count": 1}
2024-07-04T06:26:44Z    INFO    controllers.database.SingleInstanceDatabase Initiliazing database sid, pdb, edition for prebuilt database
2024-07-04T06:26:44Z    INFO    Ready Pod   {"controller": "singleinstancedatabase", "controllerGroup": "database.oracle.com", "controllerKind": "SingleInstanceDatabase", "SingleInstanceDatabase": {"name":"freedb","namespace":"default"}, "namespace": "default", "name": "freedb", "reconcileID": "71732ad4-c3cd-441b-a98e-ed429e12b7a6", "FindPods": {"name":"freedb","namespace":"default"}, "Name :": "freedb-4kpix"}
2024-07-04T06:26:44Z    INFO    freedb Pods Available ( Other Than Ready Pod )  {"controller": "singleinstancedatabase", "controllerGroup": "database.oracle.com", "controllerKind": "SingleInstanceDatabase", "SingleInstanceDatabase": {"name":"freedb","namespace":"default"}, "namespace": "default", "name": "freedb", "reconcileID": "71732ad4-c3cd-441b-a98e-ed429e12b7a6", "FindPods": {"name":"freedb","namespace":"default"}, " Names :": []}
2024-07-04T06:26:44Z    INFO    Total No Of freedb PODS {"controller": "singleinstancedatabase", "controllerGroup": "database.oracle.com", "controllerKind": "SingleInstanceDatabase", "SingleInstanceDatabase": {"name":"freedb","namespace":"default"}, "namespace": "default", "name": "freedb", "reconcileID": "71732ad4-c3cd-441b-a98e-ed429e12b7a6", "FindPods": {"name":"freedb","namespace":"default"}, "Count": 1}
2024-07-04T06:26:44Z    INFO    Executing Command : {"controller": "singleinstancedatabase", "controllerGroup": "database.oracle.com", "controllerKind": "SingleInstanceDatabase", "SingleInstanceDatabase": {"name":"freedb","namespace":"default"}, "namespace": "default", "name": "freedb", "reconcileID": "71732ad4-c3cd-441b-a98e-ed429e12b7a6", "ExecCommand": {"name":"freedb","namespace":"default"}}
2024-07-04T06:26:44Z    INFO    bash -c echo $ORACLE_SID,$ORACLE_PDB,$ORACLE_EDITION;   {"controller": "singleinstancedatabase", "controllerGroup": "database.oracle.com", "controllerKind": "SingleInstanceDatabase", "SingleInstanceDatabase": {"name":"freedb","namespace":"default"}, "namespace": "default", "name": "freedb", "reconcileID": "71732ad4-c3cd-441b-a98e-ed429e12b7a6", "ExecCommand": {"name":"freedb","namespace":"default"}}
2024-07-04T06:26:44Z    INFO    GetSidPdbEditionCMD output 
FREE,,free
    {"controller": "singleinstancedatabase", "controllerGroup": "database.oracle.com", "controllerKind": "SingleInstanceDatabase", "SingleInstanceDatabase": {"name":"freedb","namespace":"default"}, "namespace": "default", "name": "freedb", "reconcileID": "71732ad4-c3cd-441b-a98e-ed429e12b7a6", "GetSidbPdbEdition": {"name":"freedb","namespace":"default"}}
2024-07-04T06:26:44Z    INFO    controllers.database.SingleInstanceDatabase Prebuilt database: freedb has SID : FREE, PDB : , EDITION: free
IshaanDesai45 commented 4 months ago

@rbaumgar can you attach all the deployment files and the sequence you applied them in + plus export the operator logs and attach here as well. If the database is up and the operator is showing unhealthy that means you could have missed some rbac files or there might be some other problem

rbaumgar commented 4 months ago

@IshaanDesai45 I did not apply anything! I just created the secret/password and applied the free.yaml. no SQLPlus! only connected within the container with 'SQLplus system/@free' or from a JDBC sample container.

rbaumgar commented 4 months ago

fixed, typo when appling role/default-ns-role-binding.yaml.