Uploaded image for project: 'Service Orchestrator'
  1. Service Orchestrator
  2. SO-1126

Several SO pods can not start due to MariaDB table creation was denied for so_user

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Highest Highest
    • Casablanca Release
    • Casablanca Release
    • OOM on SB05

      After OOM installation, several SO pods can't be started:

      root@oom-rancher:/dockerdata-nfs/dev-so/mso# kubectl  --namespace onap get pod |grep so |grep Crash
      dev-so-so-catalog-db-adapter-6b55bc8fbc-79msh 0/1 CrashLoopBackOff 53 4h 10.42.114.245 oom-k8s-4
      dev-so-so-openstack-adapter-59955c5767-2sxbj 0/1 CrashLoopBackOff 22 1h 10.42.66.118 oom-k8s-7

       

      By looking into one of the pods log file, it indicates MariaDB table creation was denied for user so_user:

      root@oom-rancher:~# kubectl -n onap exec -it dev-so-so-openstack-adapter-59955c5767-2sxbj sh
      /app # cd logs/openstack/
      /app/logs/openstack # cat error.log
      2018-10-10T21:56:47.842Z||localhost-startStop-1|||||ERROR|||Error starting Tomcat context. Exception: org.springframework.beans.factory.UnsatisfiedDependencyException. Message: Error creating bean with name 'CXFConfiguration': Unsatisfied dependency expressed through field 'networkAdapterRest'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'networkAdapterRest': Unsatisfied dependency expressed through field 'adapter'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'msoNetworkAdapterImpl': Unsatisfied dependency expressed through field 'networkCustomRepo'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'networkResourceCustomizationRepository': Cannot create inner bean '(inner bean)#557437b5' of type [org.springframework.orm.jpa.SharedEntityManagerCreator] while setting bean property 'entityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#557437b5': Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flywayInitializer' defined in class path resource [org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class]: Invocation of init method failed; nested exception is org.flywaydb.core.internal.dbsupport.FlywaySqlScriptException:
      Script failed
      -------------
      SQL State : 42000
      Error Code : 1142
      Message : (conn:2216) CREATE command denied to user 'so_user'@'10.42.66.118' for table 'schema_version'
      Query is : CREATE TABLE `catalogdb`.`schema_version` (
      `installed_rank` INT NOT NULL,
      `version` VARCHAR(50),
      `description` VARCHAR(200) NOT NULL,
      `type` VARCHAR(20) NOT NULL,
      `script` VARCHAR(1000) NOT NULL,
      `checksum` INT,
      `installed_by` VARCHAR(100) NOT NULL,
      `installed_on` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
      `execution_time` INT NOT NULL,
      `success` BOOL NOT NULL,
      – Add the primary key as part of the CREATE TABLE statement in case `innodb_force_primary_key` is enabled
      CONSTRAINT `schema_version_pk`PRIMARY KEY (`installed_rank`)
      ) ENGINE=InnoDB
      Line : 17

       

      Further checking so_user in mysql.user table shows the user doesn't have the privilege to create table:

      MariaDB [mysql]> select * from user where User='so_user';
      ------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

      Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv Trigger_priv Create_tablespace_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections plugin authentication_string password_expired is_role default_role max_statement_time

      ------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

      % so_user *607EC31A70C4FF6B3A78409102B178D32EFCA228 N N N N N N N N N N N N N N N N N N N N N N N N N N N N N         0 0 0 0     N N   0.000000

      ------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

        

            xuyang11 xuyang11
            xuyang11 xuyang11
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: