Hello today I am switching to my own MySQL instanc...
# all-things-deployment
m
Hello today I am switching to my own MySQL instance and see an error Here is the diff
Copy code
git diff
diff --git a/docker/quickstart/docker-compose-without-neo4j.quickstart.yml b/docker/quickstart/docker-compose-without-neo4j.quickstart.yml
index a3614d602..7a13a1fef 100644
--- a/docker/quickstart/docker-compose-without-neo4j.quickstart.yml
+++ b/docker/quickstart/docker-compose-without-neo4j.quickstart.yml
@@ -59,14 +59,14 @@ services:
     - ${HOME}/.datahub/plugins:/etc/datahub/plugins
   datahub-gms:
     container_name: datahub-gms
-    depends_on:
-    - mysql
     environment:
     - DATASET_ENABLE_SCSI=false
-    - EBEAN_DATASOURCE_USERNAME=datahub
-    - EBEAN_DATASOURCE_PASSWORD=datahub
-    - EBEAN_DATASOURCE_HOST=mysql:3306
-    - EBEAN_DATASOURCE_URL=jdbc:<mysql://mysql:3306/datahub?verifyServerCertificate=false&useSSL=true&useUnicode=yes&characterEncoding=UTF-8>
+    - EBEAN_DATASOURCE_USERNAME=xxx
+    - EBEAN_DATASOURCE_PASSWORD=xxx
+    - EBEAN_DATASOURCE_HOST=<http://schemaregistrydevdb.proxysql.pinadmin.com:3306|schemaregistrydevdb.proxysql.pinadmin.com:3306>
+    - EBEAN_DATASOURCE_URL=jdbc:<mysql://schemaregistrydevdb.proxysql.pinadmin.com:3306/datahub?verifyServerCertificate=false&useSSL=true&useUnicode=yes&characterEncoding=UTF-8>
     - EBEAN_DATASOURCE_DRIVER=com.mysql.jdbc.Driver
     - KAFKA_BOOTSTRAP_SERVER=broker:29092
     - KAFKA_SCHEMAREGISTRY_URL=<http://schema-registry:8081>
@@ -125,30 +125,30 @@ services:
     - KAFKA_BOOTSTRAP_SERVER=broker:29092
     hostname: kafka-setup
     image: linkedin/datahub-kafka-setup:${DATAHUB_VERSION:-head}
-  mysql:
-    command: --character-set-server=utf8mb4 --collation-server=utf8mb4_bin
-    container_name: mysql
-    environment:
-    - MYSQL_DATABASE=datahub
-    - MYSQL_USER=datahub
-    - MYSQL_PASSWORD=datahub
-    - MYSQL_ROOT_PASSWORD=datahub
-    hostname: mysql
-    image: mysql:5.7
-    ports:
-    - 3306:3306
-    volumes:
-    - ../mysql/init.sql:/docker-entrypoint-initdb.d/init.sql
-    - mysqldata:/var/lib/mysql
   mysql-setup:
     container_name: mysql-setup
-    depends_on:
-    - mysql
     environment:
-    - MYSQL_HOST=mysql
+    - MYSQL_HOST=<http://schemaregistrydevdb.proxysql.pinadmin.com|schemaregistrydevdb.proxysql.pinadmin.com>
     - MYSQL_PORT=3306
-    - MYSQL_USERNAME=datahub
-    - MYSQL_PASSWORD=datahub
+    - MYSQL_USERNAME=xxx
+    - MYSQL_PASSWORD=xxx
     - DATAHUB_DB_NAME=datahub
     hostname: mysql-setup
     image: acryldata/datahub-mysql-setup:head
diff --git a/metadata-ingestion/src/datahub/cli/docker_check.py b/metadata-ingestion/src/datahub/cli/docker_check.py
index ea3944c10..003aa87ca 100644
--- a/metadata-ingestion/src/datahub/cli/docker_check.py
+++ b/metadata-ingestion/src/datahub/cli/docker_check.py
@@ -11,7 +11,7 @@ REQUIRED_CONTAINERS = [
     "kafka-setup",
     "schema-registry",
     "broker",
-    "mysql",
     "zookeeper",
     # These two containers are not necessary - only helpful in debugging.
     # "kafka-topics-ui",
It works when I use mysql image However, after I switched to my MySQL instance and nuke and restart the quickstart, I saw error like
Copy code
18:06:08.571 [main] ERROR o.s.web.context.ContextLoader:313 - Context initialization failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'recommendationServiceFactory': Unsatisfied dependency expressed through field 'topPlatformsCandidateSource'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'topPlatformsCandidateSourceFactory': Unsatisfied dependency expressed through field 'entityService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ebeanAspectDao' defined in com.linkedin.gms.factory.entity.EbeanAspectDaoFactory: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.linkedin.metadata.entity.ebean.EbeanAspectDao]: Factory method 'createInstance' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ebeanServer' defined in com.linkedin.gms.factory.entity.EbeanServerFactory: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [io.ebean.EbeanServer]: Factory method 'createServer' threw exception; nested exception is java.lang.NullPointerException
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:659)
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:639)
	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119)
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1431)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:619)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:953)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
	at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:401)
	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:292)
	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:103)
	at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:921)
	at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:554)
	at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:888)
	at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:357)
	at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1443)
	at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1407)
	at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:821)
	at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:276)
	at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:524)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:117)
	at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:106)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:117)
	at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:106)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169)
	at org.eclipse.jetty.server.Server.start(Server.java:407)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:110)
	at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:106)
	at org.eclipse.jetty.server.Server.doStart(Server.java:371)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72)
	at org.eclipse.jetty.runner.Runner.run(Runner.java:520)
	at org.eclipse.jetty.runner.Runner.main(Runner.java:565)
Do you know what was going on? Thanks!
g
One diff I notice with our setup is that we have our username/password in the URL string
Copy code
EBEAN_DATASOURCE_URL=jdbc:mysql://<username>:<password>@schemaregistrydevdb.proxysql.pinadmin.com:3306/datahub?verifyServerCertificate=false&useSSL=true&useUnicode=yes&characterEncoding=UTF
Maybe try that?
thank you 1
l
Hi @mysterious-lamp-91034! Gentle reminder to please post large blocks of code/logs in Threads - it’s SUPER helpful for us to keep track of all open/unanswered questions across our various support channels! teamwork
👍 1
m
@gorgeous-dinner-4055 Thank you The problem still exists.
I did A/B test the good one and bad one's log diverge from this line Does anybody help me to find what is the possible reason? When we need to "Reseting DataSourcePool"? What does free[0] mean?
Copy code
21:51:13.789 [main] INFO  i.e.d.pool.PooledConnectionQueue:405 - Reseting DataSourcePool [gmsEbeanServiceConfig] min[2] max[50] free[0] busy[0] waiting[0] highWaterMark[0] waitCount[0] hitCount[0]
21:51:13.790 [main] INFO  i.e.d.pool.PooledConnectionQueue:411 - Busy Connections:

21:51:13.792 [main] WARN  o.s.w.c.s.XmlWebApplicationContext:591 - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'recommendationServiceFactory': Unsatisfied dependency expressed through field 'topPlatformsCandidateSource'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'topPlatformsCandidateSourceFactory': Unsatisfied dependency expressed through field 'entityService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ebeanAspectDao' defined in com.linkedin.gms.factory.entity.EbeanAspectDaoFactory: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.linkedin.metadata.entity.ebean.EbeanAspectDao]: Factory method 'createInstance' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ebeanServer' defined in com.linkedin.gms.factory.entity.EbeanServerFactory: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [io.ebean.EbeanServer]: Factory method 'createServer' threw exception; nested exception is java.lang.NullPointerException
21:51:13.798 [main] ERROR o.s.web.context.ContextLoader:313 - Context initialization failed
Thanks!
e
Hey. Sorry about the late reply. Was out sick most of today 😞 when theres npe there it means that mysql is not set up correctly. Two things to test a) is mysql setup job running or did you manually run the init sql https://github.com/datahub-project/datahub/blob/master/docker/mysql-setup/init.sql to create the metadata_aspect_v2 in the db specified? b) are all references to db parameters correct? If a) is not a problem can you share your settings for setting up mysql? (all env variables that starts with EBEAN)
ah didn’t see the diff there. so it seems like you have mysql-setup running? Can you check the logs?
Copy code
docker logs mysql-setup
you could also directly check if metadata_aspect_v2 has been created
m
Thanks @early-lamp-41924
Copy code
zxu@dev-zxu:~$ docker logs -f mysql-setup
2022/03/17 04:09:25 Waiting for: <tcp://schemaregistrydevdb.proxysql.pinadmin.com:3306>
2022/03/17 04:09:25 Connected to <tcp://schemaregistrydevdb.proxysql.pinadmin.com:3306>
-- create datahub database
CREATE DATABASE IF NOT EXISTS datahub CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
USE datahub;

-- create metadata aspect table
create table if not exists metadata_aspect_v2 (
  urn                           varchar(500) not null,
  aspect                        varchar(200) not null,
  version                       bigint(20) not null,
  metadata                      longtext not null,
  systemmetadata                longtext,
  createdon                     datetime(6) not null,
  createdby                     varchar(255) not null,
  createdfor                    varchar(255),
  constraint pk_metadata_aspect_v2 primary key (urn,aspect,version)
);

-- create default records for datahub user if not exists
CREATE TABLE temp_metadata_aspect_v2 LIKE metadata_aspect_v2;
INSERT INTO temp_metadata_aspect_v2 (urn, aspect, version, metadata, createdon, createdby) VALUES(
  'urn:li:corpuser:datahub',
  'corpUserInfo',
  0,
  '{"displayName":"Data Hub","active":true,"fullName":"Data Hub","email":"<mailto:datahub@linkedin.com|datahub@linkedin.com>"}',
  now(),
  'urn:li:corpuser:__datahub_system'
), (
  'urn:li:corpuser:datahub',
  'corpUserEditableInfo',
  0,
  '{"skills":[],"teams":[],"pictureLink":"<https://raw.githubusercontent.com/linkedin/datahub/master/datahub-web-react/src/images/default_avatar.png>"}',
  now(),
  'urn:li:corpuser:__datahub_system'
);
-- only add default records if metadata_aspect is empty
INSERT INTO metadata_aspect_v2
SELECT * FROM temp_metadata_aspect_v2
WHERE NOT EXISTS (SELECT * from metadata_aspect_v2);
DROP TABLE temp_metadata_aspect_v2;

-- create metadata index table
CREATE TABLE IF NOT EXISTS metadata_index (
 `id` BIGINT NOT NULL AUTO_INCREMENT,
 `urn` VARCHAR(200) NOT NULL,
 `aspect` VARCHAR(150) NOT NULL,
 `path` VARCHAR(150) NOT NULL,
 `longVal` BIGINT,
 `stringVal` VARCHAR(200),
 `doubleVal` DOUBLE,
 CONSTRAINT id_pk PRIMARY KEY (id),
 INDEX longIndex (`urn`,`aspect`,`path`,`longVal`),
 INDEX stringIndex (`urn`,`aspect`,`path`,`stringVal`),
 INDEX doubleIndex (`urn`,`aspect`,`path`,`doubleVal`)
);
2022/03/17 04:09:25 Command finished successfully.
I also looked at mysql directly
Copy code
zxu@dev-zxu:~$ mysql -h <http://schemaregistrydevdb.proxysql.pinadmin.com|schemaregistrydevdb.proxysql.pinadmin.com>  -u kxschregdev202201 -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 978480
Server version: 5.5.30 (ProxySQL)

Copyright (c) 2000, 2021, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use datahub
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show tables;
+--------------------+
| Tables_in_datahub  |
+--------------------+
| metadata_aspect_v2 |
| metadata_index     |
+--------------------+
2 rows in set (0.00 sec)

mysql> select count(*) from metadata_aspect_v2;
+----------+
| count(*) |
+----------+
|        2 |
+----------+
1 row in set (0.00 sec)

mysql>
Was out sick most of today
Sorry to hear that. Hope you get better soon
thank you 1
e
Could you try adding “&enabledTLSProtocols=TLSv1.2” to the end of the EBEAN_DATASOURCE_URL? We saw that this solved this issue in the past for another community member.
m
Just tried. Still the same 🥲
FYI, it was successful yesterday. Today it failed suddenly. I guess there are some stateful things
Is there any systematic way that we can understand why my mysql cluster does not work? Set breakpoint? See logs?
e
The place to add break points would be in the factory you mentioned above. There are not much helpful logs here unfortunately
thank you 1
m
It worked now. The root cause is I had the wrong password... I cmd+v twice 😭
homer 1
🚀 1
g
LOL. I've been there
e
Glad it worked out!
p
@mysterious-lamp-91034 I also have the same issue, can you please share the format of the my sql url you are using? Where did you use the wrong password you mentioned above?
@prehistoric-salesclerk-23462 Which mysql version are you using?