Enterprise Dashboard log throws the error ORA-01031: insufficient privileges

Document ID : KB000127890
Last Modified Date : 22/02/2019
Show Technical Document Details
Issue:
Configured dradis.properties with external Oracle DB and User has full access to DB. Started the ED and it started fine. Then changed user details who has less permissionsand restarted ED and getting the below error:
---- 
019-02-07 16:07:39,984Z (17:07) [main] WARN org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dradisInitBean': Invocation of init method failed; nested exception is org.flywaydb.core.internal.dbsupport.FlywaySqlScriptException: 
Script failed 
------------- 
SQL State : 42000 
Error Code : 1031 
Message : ORA-01031: insufficient privileges 

Line : 17 
Statement : CREATE TABLE "TEST3_USR"."schema_version" ( 
"version_rank" INT NOT NULL, 
"installed_rank" INT NOT NULL, 
"version" VARCHAR2(50) NOT NULL, 
"description" VARCHAR2(200) NOT NULL, 
"type" VARCHAR2(20) NOT NULL, 
"script" VARCHAR2(1000) NOT NULL, 
"checksum" INT, 
"installed_by" VARCHAR2(100) NOT NULL, 
"installed_on" TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, 
"execution_time" INT NOT NULL, 
"success" NUMBER(1) NOT NULL 
-----------------------
Environment:
DevTest 10.3
Cause:
User try to start ED, don't have create permissions which caused the issue.
For example:
. If the USER1 initially started ED with full DB permission then USER1 can start/restart ED with less permissions also.
. If USER2 try to start/restart ED with less permissions then the issue happens again.
Resolution:
Give USER1 full permissions to the Oracle DB and start ED first then change the USER1 to have less permissions. When USER1 start/restart ED, it should start fine.
Additional Information:
This issue happens with Oracle DB and only for the Enterprise Dashboard.

In ED when the service starts it checks if the schema is in place corresponding to the ED version. When ED starts for the first time, it looks for necessary tables and data in the tables to identify any DB updates to be done. 

On a fresh installation or when ED is pointed to a fresh database, when it fails to find the necessary tables it tried to create tables. In case of Oracle it is using the configured username as SCHEMA name.. 
For example the log message below show the schema name 

SQL State : 42000 
Error Code : 1031 
Message : ORA-01031: insufficient privileges 

Line : 17 
Statement : CREATE TABLE "TEST3_USR"."schema_version" ( 
"version_rank" INT NOT NULL, 
"installed_rank" INT NOT NULL, 
"version" VARCHAR2(50) NOT NULL, 
"description" VARCHAR2(200) NOT NULL, 
"type" VARCHAR2(20) NOT NULL, 
"script" VARCHAR2(1000) NOT NULL, 
"checksum" INT, 
"installed_by" VARCHAR2(100) NOT NULL, 
"installed_on" TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, 
"execution_time" INT NOT NULL, 
"success" NUMBER(1) NOT NULL 

So if ED is configured with another user (with create table privileges), it will be able to create tables. But when the user permissions are changed (without create table privileges) as it looks for tables with the updated user, it wont find. So, it tries to create tables and it fails because of insufficient privileges. 

In a ORACLE DB expert can find a way to create tables with a user (without CREATE table permissions), after tables created and loaded with data, if ED is configured with that user ED should work fine as the tables and data already exists.