Alexander Shabunevich
09/06/2024, 5:58 AMpip install meltano[postgres]==3.5.1
5. Set corresponding env variable in .env
file: MELTANO_STATE_BACKEND_URI='postgresql+psycopg://<username>:<password>@<host>:<port>/<database>'
6. Executed meltano install
Having the following output after running "run" command meltano run tap-mockrestapi--node1 target-jsonl
:
(venv) vscode ➜ /workspaces/Meltano $ meltano run tap-mockrestapi--node1 target-jsonl
2024-09-06T05:32:21.225314Z [info ] Environment 'dev' is active
2024-09-06T05:32:22.253005Z [info ] Installing extractor 'tap-mockrestapi--node1'
2024-09-06T05:32:49.881601Z [info ] Installed extractor 'tap-mockrestapi--node1'
2024-09-06T05:32:49.882191Z [info ] Installed 1/2 plugins
2024-09-06T05:32:49.882405Z [info ] Skipped installing 1/2 plugins
2024-09-06T05:32:50.106098Z [error ] Cannot start plugin tap-mockrestapi--node1: 'postgresql+psycopg' is not a valid StateBackend
2024-09-06T05:32:50.111278Z [error ] Block run completed. block_type=ExtractLoadBlocks err=RunnerError("Cannot start plugin tap-mockrestapi--node1: 'postgresql+psycopg' is not a valid StateBackend") exit_codes={} set_number=0 success=False
Has anyone seen similar issue?Alexander Shabunevich
09/06/2024, 7:00 AMmeltano state --database-uri postgresql+psycopg://<username>:<password>@<host>:<port>/<database> list
I see message regarding import failure for "psycopg_c"
2024-09-06T06:56:31.931720Z [debug ] meltano 3.5.1, Linux
2024-09-06T06:56:31.934940Z [debug ] /etc/timezone found, contents:
Etc/UTC
2024-09-06T06:56:31.935512Z [debug ] /etc/localtime found
2024-09-06T06:56:31.944184Z [debug ] 2 found:
{'/etc/timezone': 'Etc/UTC', '/etc/localtime is a symlink to': 'Etc/UTC'}
2024-09-06T06:56:32.005874Z [info ] Environment 'dev' is active
2024-09-06T06:56:32.115164Z [debug ] Creating DB engine for project at '/workspaces/Meltano' with DB URI '<postgresql+psycopg://postgres>:********@host.docker.internal/meltano'
2024-09-06T06:56:32.195054Z [debug ] couldn't import psycopg 'c' implementation: No module named 'psycopg_c'
2024-09-06T06:56:33.879346Z [debug ] Need help fixing this problem? Visit <http://melta.no/> for troubleshooting steps, or to
join our friendly Slack community.
'postgresql+psycopg' is not a valid StateBackend
But installing psycopg[c] didn't help. The only difference that this line disappeared from the logs but overall result is the same.Andy Carter
09/06/2024, 7:37 AMAlexander Shabunevich
09/06/2024, 7:45 AMMELTANO_STATE_BACKEND_URI
I'm facing this issue, but when I switched to MELTANO_DATABASE_URI
everything works fine.
It is weird.Alexander Shabunevich
09/06/2024, 7:59 AMpip install "psycopg[binary,pool,c]"
it didn't help, MELTANO_STATE_BACKEND_URI
still doesn't work, but MELTANO_DATABASE_URI
works as expected.Alexander Shabunevich
09/06/2024, 8:12 AMMELTANO_DATABASE_URI
even if you don't install psycopg[c]
dependency it works but in logs you still can see message:
couldn't import psycopg 'c' implementation: No module named 'psycopg_c'
Andy Carter
09/06/2024, 8:31 AMCharles Feduke
09/06/2024, 1:30 PMAndy Carter
09/06/2024, 1:31 PMCharles Feduke
09/06/2024, 1:37 PMEdgar Ramírez (Arch.dev)
09/06/2024, 2:42 PMMELTANO_STATE_BACKEND_URI=systemdb
or just unset it completely since that's the default value anyway, and set MELTANO_DATABASE_URI=postgresql+psycopg//...
.
We can probably make the documentation clearer as to how to use Postgres or any supported database as the state backend, and also add details to that error message, like which backends are available.