Troubleshooting DataHub Deployment Error with MySQL Enabled: Access Denied for User 'root'@'10.200.93.41'

Original Slack Thread

Hey everyone, i tried to deploy a datahub version (0.12.0) and im getting this error when i put mysql enabled: false and tried to use one RDS. OBS: I changed in the log the url from my rds

2024/02/05 19:33:34 Waiting for: tcp://myrds:3306
2024/02/05 19:33:34 Connected to tcp://myrds: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),
INDEX timeIndex (createdon)
);
– create default records for datahub user if not exists
DROP TABLE if exists temp_metadata_aspect_v2;
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/datahub-project/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;

DROP TABLE IF EXISTS metadata_index;
ERROR 1045 (28000): Access denied for user ‘root’@‘10.200.93.41’ (using password: YES)
2024/02/05 19:33:34 Command exited with error: exit status 1
{“application”:“datahub-in-stg”,“hotpoint”:“v1.0.28”,“level”:“fatal”,“message”:“exit status 1”,“timestamp”:“2024-02-05T19:33:34Z”}

Hey there! :wave: Make sure your message includes the following information if relevant, so we can help more effectively!

  1. Which DataHub version are you using? (e.g. 0.12.0)
  2. Please post any relevant error logs on the thread!

are you switching your datahub db backend to RDS from unmanaged MySQL?

Yes when i tried to use the backend mysql work ok. When i try to change to RDS im getting this error

Access denied for user 'root'@'10.200.93.41' (using password: YES)
there’s a lot of things that could be going on- you might need to allow list the IPs you’re working from, double checking the root password, etc.
you should be able to replicate your error outside of datahub, i would test there

by default in RDS or any other dbaas offering it’s locked down by deafult

And here:
sql:
datasource:
host: “<<rds-endpoint>>:3306”
hostForMysqlClient: “<<rds-endpoint>>”
port: “3306”
url: “jdbc:mysql://<<rds-endpoint>>:3306/datahub?verifyServerCertificate=false&useSSL=true&useUnicode=yes&characterEncoding=UTF-8”
driver: “com.mysql.jdbc.Driver”
username: “root”
password:
secretRef: mysql-secrets
secretKey: mysql-root-password

Can i use a Environment Variable for username and password ?

you can use env vars in this kind of syntax '${sqldbTestSecret}'
again, be sure to fully test connectivity to your RDS instance to make sure you’ve got everything allow listed properly