Service Virtualization

Expand all | Collapse all

Registry not starting when configured with Mysql

  • 1.  Registry not starting when configured with Mysql

    Posted 11-01-2018 12:31 PM

    I am trying to configure external Database (mysql Ver 8.0.13 for Linux on x86_64 ) for ED and Registry.

    1.I have created two databases and have a admin user with all privileges. 

    2.dradis file is configured for mysql connection and ED is working fine.

    3.site.properties file is configured with mysql connection details

    3.While  starting the registry i am getting below error:

    [DevTest AGENT:C][INFO][8848][1][main][Nov 1, 2018 4:16:29 PM] Checking DevTest Agent schema
    [DevTest AGENT:C][INFO][8848][1][main][Nov 1, 2018 4:16:29 PM] Schema matches expected version (v9)
    DevTest Web Consoles will take a few additional moments to start up.
    Database does not contain a table HST_PERF_SUMMARY
    The database has not been initialized correctly. There is at least one missing table.
    Error occurred creating Registry:: java.lang.RuntimeException: The database has not been initialized correctly. There is at least one missing table.

     

    Few tables are being created for the same database but the registry is failing at with above error. Please let me know if someone has faced similar issue or some suggestions to resolve the same.

     

    Also: As of now, all 3 components are on same machine (DB, ED & Registry).



  • 2.  Re: Registry not starting when configured with Mysql

    Posted 11-01-2018 12:44 PM

    Hi,

     

    My guess is that, at some point, the schema was partially created (perhaps Registry was once shutdown in the middle of schema creation?).  Registry sees the expected version number and then assumes all of the tables are already there.  When one is missing, it gives up.

     

    I recommend dropping and recreating the database.  Then, allow Registry to fully come up.

     

    --Mike



  • 3.  Re: Registry not starting when configured with Mysql

    Posted 11-01-2018 12:53 PM

    Thanks Mike.

    I dropped the DB and created a new one. Still getting the same issue.

     

    My DB configuration is

    +--------------------------+--------------------------------+
    | Variable_name | Value |
    +--------------------------+--------------------------------+
    | character_set_client | utf8mb4 |
    | character_set_connection | utf8mb4 |
    | character_set_database | utf8mb4 |
    | character_set_filesystem | binary |
    | character_set_results | utf8mb4 |
    | character_set_server | utf8mb4 |
    | character_set_system | utf8 |
    | character_sets_dir | /usr/share/mysql-8.0/charsets/ |
    +--------------------------+--------------------------------+

     

    Regards,

    Vaibhav



  • 4.  Re: Registry not starting when configured with Mysql

    Posted 11-01-2018 01:14 PM

    Hi Vaibhav,

     

    Can you please do that again and attach all of registry.log?  I'm wondering if any errors get logged during the schema creation process.

     

    --Mike



  • 5.  Re: Registry not starting when configured with Mysql

    Posted 11-01-2018 01:32 PM
      |   view attached

    Hi Mike,

     

    Attaching the registry log file for reference.

     

    After this, i tried reverting the changes and pointed registry to derby again and it worked but as soon as site.properties is changed i start getting the same error.

     

    PFB the entries of site.properties:

    #lisadb.internal.enabled=true

    lisadb.pool.common.minPoolSize=0
    lisadb.pool.common.initialPoolSize=0
    lisadb.pool.common.maxPoolSize=10
    lisadb.pool.common.acquireIncrement=1
    lisadb.pool.common.maxIdleTime=45
    lisadb.pool.common.idleConnectionTestPeriod=5

    lisadb.pool.common.driverClass=com.mysql.jdbc.Driver
    lisadb.pool.common.url=jdbc:mysql://localhost:3306/SV_Server

     

    lisadb.pool.common.user=root
    lisadb.pool.common.password_enc=lf35ebc185d6e3dfddc2ee6c730623e5b8fe01e4113e508536468e489abbbe9e1074483c19ee9ec8a0fac25bb

     

     

    Kind Regards,

    Vaibhav J

    Attachment(s)

    zip
    registry.log.zip   21K 1 version


  • 6.  Re: Registry not starting when configured with Mysql

    Posted 11-01-2018 01:32 PM

    What version of DevTest are you on?

     

    You said you are using MySQL 8.0.13, we currently have only certified MySQL MySQL 5.5, 5.6, and 5.7 with DevTest, so I am not sure if this is failing due to the version of MySQL you are using.

     

    I would also create the tables with utf8_unicode_ci and not utf8mb4_unicode_ci charset/collation.  Drop the schema and create with utf8_unicode_ci.

     

    To get additional information, add these two properties in the logging.properties file before starting the Registry (delete the registry.log file before starting to get a clean log file):

     

    log4j.logger.com.mchange.v2.c3p0=DEBUG

    log4j.logger.com.mchange.v2.resourcepool=DEBUG

     

    Please post your results.

     

    If still having an issue, please open a CA Support case and we can have a webex.

     

    ~~Marcy



  • 7.  Re: Registry not starting when configured with Mysql

    Posted 11-01-2018 02:17 PM

    Hi Vaibhav,

     

    Following up Marcy's comment, DevTest is not certified on MySQL 8.0.  However, I won't give up just yet!

     

    I noticed this error in the log on line 877:

     

    Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.

     

    I also found this on the MySQL website:

     

    MySQL :: MySQL Connector/J 8.0 Developer Guide :: 4.3.1.3 Changes in the Connector/J API 

     

    It appears that, if you want try MySQL 8.0, you'll need to:

       1) Replace the jar for Connector/J with version 8.0

       2) Change the driver name in site.properties (lisadb.pool.common.driverClass).

     

    --Mike



  • 8.  Re: Registry not starting when configured with Mysql

    Posted 11-01-2018 03:16 PM

    Good catch Mike!

     

    Hope this resolves the issue.



  • 9.  Re: Registry not starting when configured with Mysql

    Posted 11-02-2018 05:36 AM
      |   view attached

    Thanks Mike & Marcy. Unfortunately, still getting same issue.

     

    Tried passing the new driver earlier and was getting the same error. I have done the configuration again and captured the registry log file for reference. However, the entry highlighted by you in the log file is also present in enterprisedashboard log and it is working fine.

     

    My DevTest version is 10.3.

    I am using the version 8 connector i.e.mysql-connector-java-8.0.13.jar

     

    Kind Regards,

    Vaibhav J

    Attachment(s)

    zip
    registry.log.zip   21K 1 version


  • 10.  Re: Registry not starting when configured with Mysql

    Posted 11-06-2018 11:14 AM

    I have configured Mysql 5.7 now and able to start Registry for it. But now I am getting an authentication error while trying to connect Registry from Workstation.

     

    I have verified all the steps and found a similar post but no resolution is not mentioned "Authentication failed for user [username=admin] "

     

    Error in Registy.log:

    2018-11-06 16:12:26,433Z (16:12) [ServerRequestResponder 3] INFO com.itko.lisa.coordinator.TestRegistryImpl - adding new live workstation: root@172.17.0.1
    2018-11-06 16:12:34,694Z (16:12) [ServerRequestResponder 3] WARN com.itko.lisa.utils.db.LisaSessionCustomizer - SQL query took a long time (126 ms) : SELECT t1.ACTIVITY_ID, t1.DESCRIPTION, t1.LICENSE_TYPE, t1.ACTIVITY_NAME, t1.PARENT_ACTIVITY_ID, t0.ROLE_ID FROM ACL_ROLES_ACTIVITIES t0, ACL_ACTIVITIES t1 WHERE ((t1.ACTIVITY_ID = t0.ACTIVITY_ID) AND (t0.ROLE_ID IN ?))
    2018-11-06 16:12:34,858Z (16:12) [ServerRequestResponder 3] ERROR com.itko.lisa.test.LisaSecurityManager - Authentication Error
    org.springframework.security.authentication.BadCredentialsException: Authentication failed for user [username=admin]
    at com.ca.dts.security.authentication.internal.NamedDelegatingAuthenticationProvider.doAuthentication(NamedDelegatingAuthenticationProvider.java:75)
    at com.ca.dts.security.authentication.AbstractDevTestAuthenticationProvider.authenticate(AbstractDevTestAuthenticationProvider.java:195)
    at org.springframework.security.authentication.ProviderManager.authenticate(ProviderManager.java:174)
    at com.itko.lisa.test.LisaSecurityManager.authenticate(LisaSecurityManager.java:821)
    at com.itko.lisa.test.LisaSecurityManager.authenticate(LisaSecurityManager.java:773)
    at com.itko.lisa.coordinator.TestRegistryImpl.authenticate(TestRegistryImpl.java:2279)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.itko.lisa.net.RemoteMethodExec.execute(RemoteMethodExec.java:57)
    at com.itko.lisa.net.ServerRequestHandler.processRMIMessage(ServerRequestHandler.java:533)
    at com.itko.lisa.net.ServerRequestHandler.access$600(ServerRequestHandler.java:70)
    at com.itko.lisa.net.ServerRequestHandler$5.run(ServerRequestHandler.java:451)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
    Caused by: org.springframework.security.authentication.BadCredentialsException: Bad credentials
    at org.springframework.security.authentication.dao.DaoAuthenticationProvider.additionalAuthenticationChecks(DaoAuthenticationProvider.java:99)
    at org.springframework.security.authentication.dao.AbstractUserDetailsAuthenticationProvider.authenticate(AbstractUserDetailsAuthenticationProvider.java:166)
    at com.ca.dts.security.authentication.internal.NamedDelegatingAuthenticationProvider.doAuthentication(NamedDelegatingAuthenticationProvider.java:70)
    ... 18 more
    2018-11-06 16:12:34,859Z (16:12) [ServerRequestResponder 3] WARN com.itko.lisa.net.RemoteMethodExec - InvocationTargetException on invoke authenticate
    java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.itko.lisa.net.RemoteMethodExec.execute(RemoteMethodExec.java:57)
    at com.itko.lisa.net.ServerRequestHandler.processRMIMessage(ServerRequestHandler.java:533)
    at com.itko.lisa.net.ServerRequestHandler.access$600(ServerRequestHandler.java:70)
    at com.itko.lisa.net.ServerRequestHandler$5.run(ServerRequestHandler.java:451)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
    Caused by: org.springframework.security.authentication.BadCredentialsException: Authentication failed for user [username=admin]
    at com.ca.dts.security.authentication.internal.NamedDelegatingAuthenticationProvider.doAuthentication(NamedDelegatingAuthenticationProvider.java:75)
    at com.ca.dts.security.authentication.AbstractDevTestAuthenticationProvider.authenticate(AbstractDevTestAuthenticationProvider.java:195)
    at org.springframework.security.authentication.ProviderManager.authenticate(ProviderManager.java:174)
    at com.itko.lisa.test.LisaSecurityManager.authenticate(LisaSecurityManager.java:821)
    at com.itko.lisa.test.LisaSecurityManager.authenticate(LisaSecurityManager.java:773)
    at com.itko.lisa.coordinator.TestRegistryImpl.authenticate(TestRegistryImpl.java:2279)
    ... 13 more
    Caused by: org.springframework.security.authentication.BadCredentialsException: Bad credentials
    at org.springframework.security.authentication.dao.DaoAuthenticationProvider.additionalAuthenticationChecks(DaoAuthenticationProvider.java:99)
    at org.springframework.security.authentication.dao.AbstractUserDetailsAuthenticationProvider.authenticate(AbstractUserDetailsAuthenticationProvider.java:166)
    at com.ca.dts.security.authentication.internal.NamedDelegatingAuthenticationProvider.doAuthentication(NamedDelegatingAuthenticationProvider.java:70)
    ... 18 more

     

    Regards,

    Vaibhav J



  • 11.  Re: Registry not starting when configured with Mysql

    Posted 11-08-2018 03:17 PM

    Vaibhav,

     

    Alot of times when we get the authentication errors with MySQL it normally has to do with the schema not being UTF8, as per an earlier post you stated

     

    My DB configuration is

    +--------------------------+--------------------------------+
    | Variable_name | Value |
    +--------------------------+--------------------------------+
    | character_set_client | utf8mb4 |
    | character_set_connection | utf8mb4 |
    | character_set_database | utf8mb4 |
    | character_set_filesystem | binary |
    | character_set_results | utf8mb4 |
    | character_set_server | utf8mb4 |
    | character_set_system | utf8 |
    | character_sets_dir | /usr/share/mysql-8.0/charsets/ |
    +--------------------------+--------------------------------+

     

    Is it still the above?

     

    Here is a Communities Post I updated earlier this year:

    Tech Tips: MySQL Cookbook for DevTest 9.1.0 and Later