I'm trying to run Meltano behind a load balancer i...
# troubleshooting
c
I'm trying to run Meltano behind a load balancer in GCP that does TLS termination. Everything is in place, except for the fact that I'm getting a "mixed content" error on the client that's preventing pages from fully loading. The source of the insecure, HTTP requests is a bunch of XHR requests. From what I gather, this is a server-configuration problem. Some solutions I've found call for setting ProxyFix in Flask (https://gitlab.com/meltano/meltano/-/issues/1668). Am I on the right track in terms of troubleshooting?
d
See also https://meltano.com/docs/production.html#meltano-ui:
If you will be running Meltano UI behind a front-end (reverse) proxy that will be responsible for SSL termination (HTTPS), it is recommended that you enable the `ui.session_cookie_secure` setting so that session cookies used for authentication are only sent along with secure requests.
You may also need to change the `ui.forwarded_allow_ips` setting to get Meltano UI to realize it should use the
https
URL scheme rather than
http
in the URLs it builds.
c
Hi @douwe_maan. Yes, I did. It's a wildcard.
d
Is your load balancer setting the
X-Forwarded-Proto: https
header?
c
Let me check and get back to you.
Hi Douwe. Yes,
tcpdump
in the container shows what the GCP docs state: that the GCP load balancer adds that header:
Copy code
X-Forwarded-For: 198.133.8.30, 35.208.200.11
X-Forwarded-Proto: https
d
Hmm, all right
I wonder if the
ui.forwarded_allow_ips
setting isn't sticking for some reason
c
Sorry, I keep hitting return before I've composed something worth reading.
Here's what I'm currently setting, in terms of env vars:
Copy code
"MELTANO_PROJECT_READONLY",                  
"MELTANO_DISABLE_TRACKING",              
"MELTANO_DATABASE_URI",                  
"MELTANO_UI_SESSION_COOKIE_SECURE" 
"MELTANO_UI_SERVER_NAME"
"MELTANO_UI_FORWARDED_ALLOW_IPS"
d
Can you verify that
meltano config meltano
shows
ui.forwarded_allow_ips
as
*
?
c
I think you're onto something. From the container, it reports locatlhost:
"forwarded_allow_ips": "127.0.0.1",
even though, in
meltano.yml
, it's an asterisk:
Copy code
root@ledp-vm:/project# grep forwarded meltano.yml 
forwarded_allow_ips: '*'
Should I not be quoting the asterisk?
d
No, the quotes are actually necessary for YAML to pick it up as a string value
Is that
forwarded_allow_ips
at the top level of
meltano.yml
, or nested under
ui:
?
It should be nested under
ui:
, or with
ui.
as the prefix on that line
c
oof
d
😅
c
it's at the top. Let me prefix it with
ui
d
If you run
meltano config meltano list
, I think it'll show up under "Custom" settings at the bottom
which implies it's not actually a known setting 😬
c
odd... it shows up as
ui...
Copy code
ui.workers [env: MELTANO_UI_WORKERS, WORKERS, WEB_CONCURRENCY] current value: 4 (default)
ui.forwarded_allow_ips [env: MELTANO_UI_FORWARDED_ALLOW_IPS, FORWARDED_ALLOW_IPS] current value: '127.0.0.1' (default)
ui.readonly [env: MELTANO_UI_READONLY, MELTANO_READONLY] current value: False (default)
But I'll correct it in the meltano.yml file and redeploy nonetheless.
d
OK
c
Yes! That was it. Thank you for a great start to the weekend.
d
Glad we figured it out! Enjoy your weekend