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
141 stars 45 forks source link

unable to create PDB: ORA-65001 #150

Closed rbaumgar closed 1 month ago

rbaumgar commented 1 month ago

when creating pdb ORA-65001: missing or invalid administrative user name ORA-06512: at line 3

ORDSVERSION=23.4.0-8

pdb.yaml:

apiVersion: database.oracle.com/v1alpha1
kind: PDB
metadata:
  name: pdbnew
  namespace: oracle
spec:
  cdbResName: "cdb-dev"
  cdbName: "devcdb"
  pdbName: "pdbnew"
  adminName:
    secret:
      secretName: "pdb1-secret"
      key: "sysadmin_user"
  adminPwd:
    secret:
      secretName: "pdb1-secret"
      key: "sysadmin_pwd"
  fileNameConversions: "NONE"
  totalSize: "1G"
  tempSize: "100M"
  action: "Create"
  ### added
  cdbNamespace: oracle  
  pdbTlsKey:
    secret:
      key: tls.key
      secretName: db-tls
  pdbTlsCrt:
    secret:
      key: tls.crt
      secretName: db-tls
  pdbTlsCat:
    secret:
      key: ca.crt
      secretName: db-ca 
  webServerUser:
    secret:
      key: webserver_user
      secretName: pdb1-secret
  webServerPwd:
    secret:
      key: webserver_pwd
      secretName: pdb1-secret
$ oc get secret pdb1-secret
NAME          TYPE     DATA   AGE
pdb1-secret   Opaque   4      40d

Operatorlog:

2024-09-30T14:48:22Z INFO controllers.PDB ORDS Error - HTTP Status Code :404 {"callAPI": {"name":"pdbnew","namespace":"oracle"}, "Err": "{\n \"code\": \"NotFound\",\n \"message\": \"Not Found\",\n \"type\": \"tag:oracle.com,2020:error/NotFound\",\n \"instance\": \"tag:oracle.com,2020:ecid/iynfrZza5XJYvokuFpDYlg\"\n}"}
2024-09-30T14:48:22Z DEBUG events cdb-dev {"type": "Warning", "object": {"kind":"PDB","namespace":"oracle","name":"pdbnew","uid":"16cba7bb-51e1-4364-a84a-0fffc43f43c4","apiVersion":"database.oracle.com/v1alpha1","resourceVersion":"2615414313"}, "reason": "Done"}
2024-09-30T14:48:22Z DEBUG events Failed: Not Found {"type": "Warning", "object": {"kind":"PDB","namespace":"oracle","name":"pdbnew","uid":"16cba7bb-51e1-4364-a84a-0fffc43f43c4","apiVersion":"database.oracle.com/v1alpha1","resourceVersion":"2615414313"}, "reason": "ORDSError"}
2024-09-30T14:48:22Z INFO controllers.PDB Issuing REST call {"callAPI": {"name":"pdbnew","namespace":"oracle"}, "URL": "https://cdb-dev-ords.oracle:8888/ords/_/db-api/latest/database/pdbs/", "Action": "POST"}
2024-09-30T14:48:22Z DEBUG events cdb-dev {"type": "Warning", "object": {"kind":"PDB","namespace":"oracle","name":"pdbnew","uid":"16cba7bb-51e1-4364-a84a-0fffc43f43c4","apiVersion":"database.oracle.com/v1alpha1","resourceVersion":"2615414325"}, "reason": "Done"}
2024-09-30T14:48:22Z INFO controllers.PDB ORDS Error - Oracle Error Code :65001 {"callAPI": {"name":"pdbnew","namespace":"oracle"}}
2024-09-30T14:48:22Z INFO controllers.PDB ORDS Error - Oracle Error Code :65011 {"callAPI": {"name":"pdbnew","namespace":"oracle"}}
2024-09-30T14:48:22Z DEBUG events ORA-65001: missing or invalid administrative user name
ORA-06512: at line 3 {"type": "Warning", "object": {"kind":"PDB","namespace":"oracle","name":"pdbnew","uid":"16cba7bb-51e1-4364-a84a-0fffc43f43c4","apiVersion":"database.oracle.com/v1alpha1","resourceVersion":"2615414325"}, "reason": "OraError"}
2024-09-30T14:48:22Z ERROR controllers.PDB callAPI error {"createPDB": {"name":"pdbnew","namespace":"oracle"}, "err": "Oracle Error", "error": "Oracle Error"}
mmalvezz commented 1 month ago

how did you create the secret ? please give us more details

rbaumgar commented 1 month ago
$ oc get secret pdb1-secret -o yaml
apiVersion: v1
data:
  sysadmin_pwd: xyz..
  sysadmin_user: xyz..
  webserver_pwd: xyz..
  webserver_user: xyz..
kind: Secret
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"v1","data": ...
  creationTimestamp: "2024-08-20T15:10:23Z"
  name: pdb1-secret
  namespace: oracle
  resourceVersion: "2615366039"
  uid: 9c7656a4-f6ec-4283-9c07-75a5b80408cb
type: Opaque
mmalvezz commented 1 month ago

What it the value of xyx for sysadmin_user?

rbaumgar commented 1 month ago

base64 encryption for the sysadmin_user

mmalvezz commented 1 month ago

Be careful this is not encrypted ... it's encoded given that, please provide the decoded value . It looks like you are using a reserved word.

rbaumgar commented 1 month ago

sorry, typo: base64

mmalvezz commented 1 month ago

please verify the credential you have specified in the pdb secret ..... this is not an operator issue E.G. SQL> CREATE PLUGGABLE DATABASE pdb1 ADMIN USER SYS IDENTIFIED BY chageme; CREATE PLUGGABLE DATABASE pdb1 ADMIN USER SYS IDENTIFIED BY chageme * ERROR at line 1: ORA-65001: missing or invalid administrative user name