Anyone know if there's a way to debug this call `...
# troubleshooting
e
Anyone know if there's a way to debug this call
sudo -u ubuntu meltano config target-postgres set postgres_host $db_host
I am executing this via bash upon an LXD container .. using a tool called Juju. if I ssh into the LXD container and run this command manually with the IP Address .. as the ubuntu user.. it works but my bash script via juju doesn't seem to affect the
meltano.yml
at all.. causing me to be unable to easily update the ip address of the postgresql. I can work around this using
sed
in bash.. but wondered if this is possibly something that can be fixed? Edit: I'll try adding
--log-level=debug
and see if it reveals anything useful Here's what it looks like when I manually SSH into the image and do it myself (and I can see it does indeed update the yml)
Copy code
ubuntu@juju-2dd159-160:~/meltano_proj_repo$ meltano --log-level=debug config target-postgres set postgres_host MY_NEW_IP
[2021-09-04 15:39:36,680] [2186|MainThread|root] [DEBUG] Creating engine <meltano.core.project.Project object at 0x7ffa5a74fdc0>@sqlite:////home/ubuntu/meltano_proj_repo/.meltano/meltano.db
[2021-09-04 15:39:36,725] [2186|MainThread|urllib3.connectionpool] [DEBUG] Starting new HTTPS connection (1): <http://www.meltano.com:443|www.meltano.com:443>
[2021-09-04 15:39:37,295] [2186|MainThread|urllib3.connectionpool] [DEBUG] <https://www.meltano.com:443> "GET /discovery.yml HTTP/1.1" 200 115895
Loader 'target-postgres' setting 'postgres_host' was set in `meltano.yml`: 'MY_NEW_IP'
d
@emcp Would it be an option to use an environment variable instead?
e
sed
likely will be easier.. but for the password I know I must set that as an environment variable. I will test this idea.. the issue is, Juju utilizes bash hooks in a way that.. basically you have different states.. so I will have to test if say.. in the hook which relates meltano to my database.. if I set the environment variable there.. does it persist when I say.. go back to the start.. does it get picked up by meltano or do I have to reboot etc.. Thanks as always Douwe
an bit unsecure but.. I could lay down the password somewhere in linux.. maybe either encrypt is as a file and tighten the permissions on that file.. and once I need to restart or connect.. I open it and set it as an env var there.. unclear
i just wanted to mostly alert that... in general these commands from within LXD don't seem to perform their task at all.. but I know it's a bit of a side case in which I am playing in.. using meltano from within an LXD container
but I thought.. it's just bash so.. why wouldn't it work
Ill try to use these commands as root.. see if I can also get more output.. so far logs show nothing at all so I will hunt down a bit if I can get some more useful output
so far I have
sed
working great on everything.. my last piece is.. getting the
TAP_POSTGRES_PASSWORD
set correctly.. I am wondering do I need to reboot / restart
meltano ui
or .. is it just used somehow with the linux system at some level.. I am guessing I would need to set the env var.. then start meltano ui
ahhh I see technically it works to put the password directly in the .yml file
this is not ideal at all of course.. but since we're in a container on a private cloud.. and the ssh key used here is read only.. there's not much risk of accidently getting that password up into my version control.. I will go with that for now but.. may try to come back to this again later
seems it's maybe related to that other bug where in which I must use a venv inside an LXD container.. maybe i everytime I use meltano commands triple check I am using that venv.. never had to do that before so.. might be my ignorance with bash envs, profiles, python virtual envs etc..
b
@jo_pearson