bassel
06/30/2023, 2:22 PMmeltano.yaml
file to read from a local db server .. and worked perfectly, but the issue is when I'm running the same meltano config (but targeting a deployed db instance - using tap-mysql
- 100% sure of the db connection string, I'm getting this error:
[2m2023-06-30T14:12:20.550169Z[0m [[32m[1minfo [0m] [1mEnvironment 'dev' is active[0m
Need help fixing this problem? Visit <http://melta.no/> for troubleshooting steps, or to
join our friendly Slack community.
Plugin configuration is invalid
No RECORD message received
Here's the yaml file:
version: 1
default_environment: dev
project_id: 31c666cb-33b9-43a3-884f-88af7ea504e4
environments:
- name: dev
config:
plugins:
extractors:
- name: tap-mysql
config:
host: host
port: 3306
user: user
database: sampledb
password: password
- name: staging
- name: prod
plugins:
extractors:
- name: tap-mysql
variant: transferwise
pip_url: pipelinewise-tap-mysql
select:
- sampledb-table1.*
metadata:
sampledb-table1:
replication-method: INCREMENTAL
replication-key: id
loaders:
- name: target-jsonl
variant: andyh1203
pip_url: target-jsonl
Here's the command I was running:
meltano --environment=dev config tap-mysql test
Note: I tried also this select and it worked locally 😄 but not agains the real db I've got on aws
select:
- '*-house_battles.*'
Also, The way I'm running it remotely .. I built a docker image of the meltano project and pushed it to ECR and then ran it on an EC2 instance ..
Tested another command meltano environment list
and it worked .. thinkspinuser
06/30/2023, 2:31 PMNo RECORD message received
is probably the culprit. The test command you're running is basically starting a sync then stopping once it receives the first record i.e. successfully connected. If you had no access it would probably have raised an exception saying so. To me that means the reason its not passing the test is because its not getting data and not getting data could be due to bad selection criteria. I'd double check your prod db to make sure the db/schema/table name are as expected and mess with the select config, maybe make it less restrictive to start out.janis_puris
06/30/2023, 2:31 PMtable1
in schemasampledb
sampledb.table1
sampledb
?select:
- sampledb-table1.*
metadata:
sampledb-table1:
replication-method: INCREMENTAL
replication-key: id
SELECT * FROM sampledb.table1 LIMIT 5
edit: nevermind.. I had not used mysql in years and had forgotten it does not have schema i.e. like in postgresqlbassel
06/30/2023, 2:33 PMjanis_puris
06/30/2023, 2:39 PMjanis_puris
06/30/2023, 3:03 PMdocker run --rm --name some-mysql -p '127.0.0.1:3306:3306' -e MYSQL_ROOT_PASSWORD=password mysql:8 -d
new meltano project
mkdir tmp && cd $_
python -m venv venv && activate
pip install meltano
meltano init project && cd project
vim meltano.yml
# Paste the config the OP has provided
# Replace host value with 127.0.0.1
# Replace database value with mysql
# Replace user value with root
# Replace str "sampledb-table1" with "mysql-table1"
create a test table in mysql db
docker exec -it some-mysql mysql -e "CREATE TABLE mysql.table1 (id int);" -p
docker exec -it some-mysql mysql -e "INSERT INTO mysql.table1 VALUES (1), (2), (3);" -p
❯ docker exec -it some-mysql mysql -e "SELECT * FROM mysql.table1;" -p
Enter password:
+------+
| id |
+------+
| 1 |
| 2 |
| 3 |
+------+
run meltano cmd
❯ meltano --environment=dev config tap-mysql test
2023-06-30T14:56:00.382842Z [info ] Environment 'dev' is active
Need help fixing this problem? Visit <http://melta.no/> for troubleshooting steps, or to
join our friendly Slack community.
Plugin configuration is invalid
No RECORD message received
janis_puris
06/30/2023, 3:17 PMbassel
06/30/2023, 3:27 PMbassel
06/30/2023, 3:28 PMjanis_puris
06/30/2023, 3:30 PMpat_nadolny
06/30/2023, 3:31 PM--log-level=debug
to the config/test command to see if it tells you anything elsebassel
06/30/2023, 3:31 PMbassel
06/30/2023, 3:31 PMjanis_puris
06/30/2023, 3:33 PMmysql
schema.. woops
SELECT table_schema,
table_name,
table_type,
table_rows
FROM information_schema.tables
WHERE table_schema NOT IN (
'information_schema',
'performance_schema',
'mysql',
'sys'
)
bassel
06/30/2023, 3:35 PMif dbs:
filter_dbs_clause = ",".join([f"'{db_name}'" for db_name in dbs.split(",")])
table_schema_clause = f"WHERE table_schema IN ({filter_dbs_clause})"
else:
table_schema_clause = """
WHERE table_schema NOT IN (
'information_schema',
'performance_schema',
'mysql',
'sys'
)"""
should it be changed?janis_puris
06/30/2023, 3:36 PMmysql
. You are using user created db.bassel
06/30/2023, 3:43 PM2023-06-30T11:38:46.719-04:00 [31m│[0m [31m❱ [0m393 [2m│ │ [0m[94mraise[0m CliError([33m"[0m[33m\n[0m[33m"[0m.join(([33m"[0m[33mPlugin configuration is invalid[0m[33m"[0m, d [31m│[0m
the logs are a bit messed up because I'm running an aws batch job (single node ec2) targeting the docker image in ECRjanis_puris
06/30/2023, 3:43 PM❯ meltano --environment=dev config tap-mysql test
2023-06-30T15:43:30.283839Z [info ] Environment 'dev' is active
Plugin configuration is valid
❯ meltano --environment=dev select --list --all tap-mysql
2023-06-30T15:44:03.795120Z [info ] Environment 'dev' is active
Legend:
SelectionType.SELECTED
SelectionType.EXCLUDED
SelectionType.AUTOMATIC
Enabled patterns:
test_db-table1.*
Selected attributes:
[SelectionType.SELECTED] test_db-table1.id
bassel
06/30/2023, 3:45 PMmeltano --environment=dev config tap-mysql test
and see what error it shows 🤞janis_puris
06/30/2023, 3:52 PMselect:
- sampledb-table1.*
metadata:
sampledb-table1:
replication-method: INCREMENTAL
replication-key: id
to the dev environment. Same place you've got the config of the extractor.bassel
06/30/2023, 3:53 PMjanis_puris
06/30/2023, 3:55 PMjanis_puris
06/30/2023, 3:56 PMbassel
06/30/2023, 3:56 PMjanis_puris
06/30/2023, 3:57 PMbassel
06/30/2023, 3:57 PMbassel
06/30/2023, 5:49 PMroot@7c22418a67ed:/project# meltano --environment=dev config tap-mysql test
2023-06-30T17:48:16.399915Z [info ] Environment 'dev' is active
Need help fixing this problem? Visit <http://melta.no/> for troubleshooting steps, or to
join our friendly Slack community.
Plugin configuration is invalid
No RECORD message received
root@7c22418a67ed:/project#
janis_puris
06/30/2023, 7:17 PMmeltano --environment=dev --log-level=debug config tap-mysql test
janis_puris
06/30/2023, 7:52 PMdocker run --rm --name some-mysql -p '127.0.0.1:3306:3306' -e MYSQL_ROOT_PASSWORD=password mysql:8
docker exec -it some-mysql mysql -e "CREATE DATABASE somedb; CREATE TABLE somedb.table1 (id int); INSERT INTO somedb.table1 VALUES (1), (2), (3); SELECT * FROM somedb.table1;" -p
password is password
create meltano project
mkdir tmp && $_
python3 -m venv venv && source venv/bin/activate
pip install meltano
meltano init project
vim meltano.yml # Replace contents with the sample
meltano install
test the tap
❯ meltano --environment=dev config tap-mysql test
2023-06-30T19:49:38.258688Z [info ] Environment 'dev' is active
Plugin configuration is valid
🤷