toluaina / pgsync

Postgres to Elasticsearch/OpenSearch sync
https://pgsync.com
MIT License
1.11k stars 174 forks source link

`docker-compose up` fails to create `airbnb` tables/schemas. pgsync.exc.TableNotFoundError: 'Table "public.user" not found in registry' #400

Closed nazihkalo closed 1 year ago

nazihkalo commented 1 year ago

PGSync version: 2.4.0

Postgres version: debezium/postgres:15

Elasticsearch version: 7.17.7

Redis version: 7.0

Python version: 3.7

Problem Description: I'm attempting to run the getting started example with docker-compose up and not altering anything from the current state of the repo. All the containers start up successfully except for pgsync which fails due to the airbnb postgres db not properly being seeded with the schemas/data from the examples/airbnb folder.

Error Message (if any):

pgsync-pgsync-1         | Traceback (most recent call last):
pgsync-pgsync-1         |   File "examples/airbnb/schema.py", line 117, in <module>
pgsync-pgsync-1         |     main()
pgsync-pgsync-1         |   File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1130, in __call__
pgsync-pgsync-1         |     return self.main(*args, **kwargs)
pgsync-pgsync-1         |   File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1055, in main
pgsync-pgsync-1         |     rv = self.invoke(ctx)
pgsync-pgsync-1         |   File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1404, in invoke
pgsync-pgsync-1         |     return ctx.invoke(self.callback, **ctx.params)
pgsync-pgsync-1         |   File "/usr/local/lib/python3.7/site-packages/click/core.py", line 760, in invoke
pgsync-pgsync-1         |     return __callback(*args, **kwargs)
pgsync-pgsync-1         |   File "examples/airbnb/schema.py", line 112, in main
pgsync-pgsync-1         |     teardown(config=config)
pgsync-pgsync-1         |   File "/usr/local/lib/python3.7/site-packages/pgsync/helper.py", line 33, in teardown
pgsync-pgsync-1         |     sync: Sync = Sync(document, validate=validate)
pgsync-pgsync-1         |   File "/usr/local/lib/python3.7/site-packages/pgsync/singleton.py", line 18, in __call__
pgsync-pgsync-1         |     *args, **kwargs
pgsync-pgsync-1         |   File "/usr/local/lib/python3.7/site-packages/pgsync/sync.py", line 97, in __init__
pgsync-pgsync-1         |     self.tree.build(self.nodes)
pgsync-pgsync-1         |   File "/usr/local/lib/python3.7/site-packages/pgsync/node.py", line 303, in build
pgsync-pgsync-1         |     base_tables=data.get("base_tables", []),
pgsync-pgsync-1         |   File "<string>", line 13, in __init__
pgsync-pgsync-1         |   File "/usr/local/lib/python3.7/site-packages/pgsync/node.py", line 116, in __post_init__
pgsync-pgsync-1         |     self.model: sa.sql.Alias = self.models(self.table, self.schema)
pgsync-pgsync-1         |   File "/usr/local/lib/python3.7/site-packages/pgsync/base.py", line 179, in models
pgsync-pgsync-1         |     f'Table "{name}" not found in registry'
pgsync-pgsync-1         | pgsync.exc.TableNotFoundError: 'Table "public.user" not found in registry'
toluaina commented 1 year ago

this has now been resolved thanks for reporting.

nazihkalo commented 1 year ago

can confirms its working now 🎉 thanks @toluaina !