1
0
-1

vid.api.simpledemo.openecomp.org is not coming due to DB connectivity issue.

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSourceMap' defined in class path resource [org/openecomp/portalsdk/core/conf/HibernateConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [java.util.Map]: Factory method 'dataSourceMap' threw exception; nested exception is java.sql.SQLException: Connections could not be acquired from the underlying database! org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1123) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1018) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:305) org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:301) org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:196) org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772) org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:834) org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:537) org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:667) org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:539) org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:493) org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136) javax.servlet.GenericServlet.init(GenericServlet.java:158) org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:502) org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1132) org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684) org.apache.tomcat.util.net.AprEndpoint$SocketWithOptionsProcessor.run(AprEndpoint.java:2458) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) java.lang.Thread.run(Thread.java:748)


As per vid_vm_init.sh, /opt/vid/lf_config/vid-pre-init.sql has to be executed. Looks like that process didn't complete.

How to get inside nexus3.onap.org:10001/openecomp/vid:1.0-STAGING-latest VM and create TABLE as per /opt/vid/lf_config/vid-pre-init.sql ?


  1. Viswanath KSP

    Marco Platania - Could you please help me with this issue?

  2. Marco Platania

    James Forsyth, any clue why this happens?

  3. Marco Platania

    Also, Viswanath KSP, could you please add more details (e.g. what you are trying to do, your OpenStack environment, etc.).

    Thanks!

  4. James Forsyth

    Is the mariadb docker image running?  that's the container where the table gets created

  5. Viswanath KSP

    James Forsyth - Yes the container is running. I guess vid-pre-init.sql didn't execute correctly. That's the reason, I wanna know how to get inside mariadb to execute SQL manually.

  6. Viswanath KSP

    Marco Platania - I'm from Verizon and I'm trying to bring up ONAP environment in our cloud, which is based on RHEL openstack. Intention is to go through demo use-cases and to explore ONAP.

  7. Dusan Rozman

    Hi Viswanath KSP,

    vid-pre-init.sql should be executed by one of the startup scripts. If it hasn't executed then you can manually go into the container and start it. To get inside the running container (vid-mariadb) use the following docker command: 'docker exec -it <container id> bash'. This should take you inside the container. 

    Once inside the container you can do a simple 'mysql -u vidadmin -p < /opt/vid/lf_config/vid-pre-init.sql' command to create the table. 

  8. Viswanath KSP

    Could you provide me password for vidadmin ? Even if I skip password based login, I'm getting access denied

    root@81d85bd615d8:/# mysql -u vidadmin -p < ./docker-entrypoint-initdb.d/vid-pre-init.sql
    Enter password:
    ERROR 1045 (28000): Access denied for user 'vidadmin'@'localhost' (using password: YES)
    root@81d85bd615d8:/# mysql -u vidadmin < ./docker-entrypoint-initdb.d/vid-pre-init.sql
    ERROR 1045 (28000): Access denied for user 'vidadmin'@'localhost' (using password: NO)
    root@81d85bd615d8:/# mysql -u vidadmin -p < ./docker-entrypoint-initdb.d/vid-pre-init.sql
    Enter password:
    ERROR 1045 (28000): Access denied for user 'vidadmin'@'localhost' (using password: NO)
    root@81d85bd615d8:/#
  9. Josef Reisinger

    I think the password is generated individually. If you

    cat /opt/vid_vm_init.sh

    you see the line to start the database container like

    docker run --name vid-mariadb -e MYSQL_DATABASE=vid_openecomp_epsdk -e MYSQL_USER=vidadmin -e MYSQL_PASSWORD=<a-very-long-password> -e MYSQL_ROOT_PASSWORD=<a-shorter-password> -v /opt/vid/lf_config/vid-my.cnf:/etc/mysql/my.cnf -v /opt/vid/lf_config/vid-pre-init.sql:/docker-entrypoint-initdb.d/vid-pre-init.sql -v /var/lib/mysql -d mariadb:10

    You may access the database either with

    mysql -u root -p<a-shorter-password>

    or

    mysql -u vidadmin -p<a-very-long-password>

    (be carefull not to have a space after -p)

  10. Viswanath KSP

    Josef Reisinger - If I use vidadmin am getting below error :

    ERROR 1142 (42000) at line 20: CREATE command denied to user 'vidadmin'@'localhost' for table 'schema_info'

    In case of root, below one

    ERROR 1049 (42000) at line 20: Unknown database 'vid_openecomp'

    Pls advise!

  11. Josef Reisinger

    Well, I saw some mails floating by which mentioned the database should be called 'vid_openecomp_epsdk'' by now and there is a de-sync between the script (and even more) if you use the 1.0-STAGING-latest docker version. You cat the same CREATE denied error when trying to  open the VID-tab in the portal.

    This symptom went away when I used 1.1-STAGING-latest for docker-version.

    If you want experiment with 1.1, you don't need to to re-create the stack, just change the value in /opt/config/docker-version.txt and run /opt/vid_install.sh. This will download the 1.1 containers.

CommentAdd your comment...

1 answer

  1.  
    2
    1
    0

    I had resolved this issue manually.

    1. In vid-pre-init.sql, the database name was vid_openecomp, but VID was trying to create table under vid_openecomp_epsdk. So manually logged in as root and then granted privileges to vidadmin to do changes in vid_openecomp_epsdk database.
    2. Next, create table was supposed to be performed in vid_openecomp database. So I gave all privileges for user vidadmin@% and then created vid_openecomp database.



    root@36dc23c061fc:/# mysql -u root -p<rootpass>
    Welcome to the MariaDB monitor. Commands end with ; or \g.
    Your MariaDB connection id is 49
    Server version: 10.1.23-MariaDB-1~jessie mariadb.org binary distribution
    Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.
    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
    MariaDB [(none)]> GRANT ALL PRIVILEGES ON * . * TO 'vidadmin'@'%';
    Query OK, 0 rows affected (0.00 sec)
    MariaDB [(none)]> quit
    Bye
    root@36dc23c061fc:/# mysql -u vidadmin -p<VID pass>
    Welcome to the MariaDB monitor. Commands end with ; or \g.
    Your MariaDB connection id is 50
    Server version: 10.1.23-MariaDB-1~jessie mariadb.org binary distribution
    Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.
    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
    MariaDB [(none)]> create database vid_openecomp;
    Query OK, 1 row affected (0.00 sec)
    MariaDB [(none)]>


    Could someone else confirm same issue with their environment? I had to change SQL for this to work in our environment.

    Thanks Josef Reisinger

    1. Josef Reisinger

      I ran into the same issue today and instead of giving rights to vidadmin I tried to change the database name in the script /opt/vid_vm_init.sh (removing _epsdk two times(!)). Worked too.

    CommentAdd your comment...