Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Metabase to use a http(s)-Proxy for outgoing connections #3236

Open
steinex opened this issue Aug 18, 2016 · 16 comments

Comments

@steinex
Copy link

commented Aug 18, 2016

Hi, we are running Metabase v0.19.2.

To use the Slack integration, we must allow traffic from the Host running Metabase to Slack. As Slack is running on AWS and IP-Adresses always change, this is a real pain.

If Metabase would allow to use a proxy for outgoing connections, that would solve our problem, as we could use URL-Regexes in the Proxy to allow outgoing connections.

Would this feature feasible to implement?

Thanks in advance,
Frank

@salsakran

This comment has been minimized.

Copy link
Contributor

commented Aug 18, 2016

Have you talked with Slack about this at all?

I've got to assume that other people are having this issue if they're also locking down outbound connections.

@tlrobinson

This comment has been minimized.

Copy link
Member

commented Aug 19, 2016

@salsakran I assume @steinex means his firewall doesn't allow outbound connections unless the IP address is whitelisted, but Slack API's IP addresses occasionally change. I don't think that's particularly Slack's fault.

@longtian

This comment has been minimized.

Copy link

commented Dec 9, 2016

👍 We also need this feature for Google Analytics driver to work, because we run metabase behind a firewall.

The HTTPS_PROXY HTTP_PROXY and NO_PROXY environment variable should be respected in order to send outboud connections

@m30m

This comment has been minimized.

Copy link

commented Dec 9, 2016

We have this problem with google analytics too.

@tlrobinson

This comment has been minimized.

Copy link
Member

commented Dec 9, 2016

@wyvernnot @m30m @steinex Could you try setting these JVM flags? https://stackoverflow.com/questions/120797/how-do-i-set-the-proxy-to-be-used-by-the-jvm

(note that the Docker image doesn't currently pass along JAVA_OPTS #3884)

@alex-mohemian

This comment has been minimized.

Copy link

commented Jan 19, 2018

Can probably be closed. Since #3884 was closed, proxy options can be set like this:

docker run --rm -d -e JAVA_OPTS="-Dhttp.proxyHost=http://web.proxy.internal -Dhttp.proxyPort=80 -Dhttps.proxyHost=http://web.proxy.internal -Dhttps.proxyPort=80" -p 3000:3000 --name metabase metabase/metabase

For Slack integration, you need the HTTPS proxy.

@vrivellino

This comment has been minimized.

Copy link

commented May 14, 2018

The Slack plugin does not appear to be honoring the proxy options. We're running v0.29.0, with the following command line:

java \
    -Dhttps.proxyHost=my-proxy-host.local -Dhttps.proxyPort=3128 -Dhttps.nonProxyHosts=169.254.169.254|localhost|127.0.0.1|localaddress|.localdomain.com \
    -Dhttp.proxyHost=my-proxy-host.local -Dhttp.proxyPort=3128 -Dhttp.nonProxyHosts=169.254.169.254|localhost|127.0.0.1|localaddress|.localdomain.com \
    -Xms512m -Xmx4g -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC \
-server -jar /var/www/metabase.jar

We see the following in our logs:

05-14 13:21:41 ERROR metabase.metabot :: Error connecting websocket: connection timed out: cerberus-xxxx.lb.slack-msgs.com/35.171.23.165:443
05-14 13:22:12 ERROR metabase.metabot :: Error connecting websocket: connection timed out: cerberus-xxxx.lb.slack-msgs.com/54.227.182.130:443
05-14 13:22:42 ERROR metabase.metabot :: Error connecting websocket: connection timed out: cerberus-xxxx.lb.slack-msgs.com/54.237.144.5:443
05-14 13:23:12 ERROR metabase.metabot :: Error connecting websocket: connection timed out: cerberus-xxxx.lb.slack-msgs.com/34.235.153.216:443
05-14 13:23:42 ERROR metabase.metabot :: Error connecting websocket: connection timed out: cerberus-xxxx.lb.slack-msgs.com/54.172.214.6:443
05-14 13:24:13 ERROR metabase.metabot :: Error connecting websocket: connection timed out: cerberus-xxxx.lb.slack-msgs.com/52.55.108.49:443

However, Google Authentication appears to be working correctly with the proxy settings.

@alex-mohemian

This comment has been minimized.

Copy link

commented May 14, 2018

@vrivellino agreed, Slack does not honor the proxy options!

@asolera

This comment has been minimized.

Copy link

commented Oct 31, 2018

These set of docker run options worked for me:

docker run -d -e JAVA_OPTS="-Dhttp.proxyHost=10.10.193.25 -Dhttp.proxyPort=3128 -Dhttps.proxyHost=10.10.193.25 -Dhttps.proxyPort=3128" -e "MB_DB_TYPE=postgres" -e "MB_DB_DBNAME=metabase" -e "MB_DB_PORT=5432" -e "MB_DB_USER=metabase" -e "MB_DB_PASS=password" -e "MB_DB_HOST=metabase_db" -e "MB_DB_FILE=/metabase-data/metabase.db" -p 3000:3000 --net=metabase --name metabase metabase/metabase
@oBoMBaYo

This comment has been minimized.

Copy link

commented Nov 28, 2018

These set of java run options worked only Metabase send pulse to Slack but doesn't work when using Metabot on Slack. https://metabase.com/docs/latest/users-guide/11-metabot.html

java
-Dhttps.proxyHost=[proxyhost]
-Dhttps.proxyPort=3128
-Dhttp.proxyHost=[ProxyHost]
-Dhttp.proxyPort=3128 -jar $PATH_TO_JAR

Got the same error like @vrivellino.
@asolera Could you help to test Metabot? Is it work in your environment?

11-26 17:50:40 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 17:53:05 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 18:19:45 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 18:22:04 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 18:26:41 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 18:29:00 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 18:31:19 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 18:54:22 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 18:56:42 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 19:48:01 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 19:50:26 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 19:52:52 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 19:55:11 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 19:59:48 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 20:02:07 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 20:04:26 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 20:48:38 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 20:50:57 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 20:55:34 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 20:57:54 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 21:02:31 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 21:35:10 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 21:49:40 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 21:54:17 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 21:56:36 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 22:01:13 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 22:03:32 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 22:10:30 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 22:22:40 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 22:25:13 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 22:30:18 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 22:32:52 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 22:35:11 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 22:40:02 ERROR metabase.metabot :: Error connecting websocket: Read timed out
@asolera

This comment has been minimized.

Copy link

commented Nov 28, 2018

@asolera Could you help to test Metabot? Is it work in your environment?

@oBoMBaYo Metabot won't work here because my metabase installation is unaccessible from outside/internet, it is running on my company's intranet

@oBoMBaYo

This comment has been minimized.

Copy link

commented Nov 28, 2018

@asolera Metabase configure Metabot to use websocket which is a computer communications protocol, providing full-duplex communication channels over a single TCP connection.

So, websocket secure (wss) should honor the proxy options.

@asolera

This comment has been minimized.

Copy link

commented Nov 28, 2018

@asolera Metabase configure Metabot to use websocket which is a computer communications protocol, providing full-duplex communication channels over a single TCP connection.

So, websocket secure (wss) should honor the proxy options.

It didn't work here, maybe because of some firewall configuration.

@oBoMBaYo

This comment has been minimized.

Copy link

commented Nov 29, 2018

@asolera Thank you for the answer.

@patok28

This comment has been minimized.

Copy link

commented Jun 23, 2019

These set of java run options worked only Metabase send pulse to Slack but doesn't work when using Metabot on Slack. https://metabase.com/docs/latest/users-guide/11-metabot.html

java
-Dhttps.proxyHost=[proxyhost]
-Dhttps.proxyPort=3128
-Dhttp.proxyHost=[ProxyHost]
-Dhttp.proxyPort=3128 -jar $PATH_TO_JAR

Got the same error like @vrivellino.
@asolera Could you help to test Metabot? Is it work in your environment?

11-26 17:50:40 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 17:53:05 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 18:19:45 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 18:22:04 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 18:26:41 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 18:29:00 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 18:31:19 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 18:54:22 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 18:56:42 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 19:48:01 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 19:50:26 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 19:52:52 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 19:55:11 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 19:59:48 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 20:02:07 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 20:04:26 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 20:48:38 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 20:50:57 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 20:55:34 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 20:57:54 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 21:02:31 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 21:35:10 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 21:49:40 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 21:54:17 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 21:56:36 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 22:01:13 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 22:03:32 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 22:10:30 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 22:22:40 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 22:25:13 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 22:30:18 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 22:32:52 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 22:35:11 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 22:40:02 ERROR metabase.metabot :: Error connecting websocket: Read timed out

I have the same problem, I can send pulse to Slack but doesn't work when using Metabot on Slack.
I have metabase running on my company's intranet with the proxy settings.
@oBoMBaYo could you resolved this?
Does anyone know if it is an open port issue that can be resolved asking to the networking area of my company to open this port?.
Thank you!

@razer96

This comment has been minimized.

Copy link

commented Aug 15, 2019

These set of java run options worked only Metabase send pulse to Slack but doesn't work when using Metabot on Slack. https://metabase.com/docs/latest/users-guide/11-metabot.html

java
-Dhttps.proxyHost=[proxyhost]
-Dhttps.proxyPort=3128
-Dhttp.proxyHost=[ProxyHost]
-Dhttp.proxyPort=3128 -jar $PATH_TO_JAR

Got the same error like @vrivellino.
@asolera Could you help to test Metabot? Is it work in your environment?

11-26 17:50:40 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 17:53:05 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 18:19:45 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 18:22:04 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 18:26:41 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 18:29:00 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 18:31:19 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 18:54:22 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 18:56:42 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 19:48:01 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 19:50:26 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 19:52:52 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 19:55:11 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 19:59:48 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 20:02:07 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 20:04:26 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 20:48:38 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 20:50:57 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 20:55:34 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 20:57:54 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 21:02:31 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 21:35:10 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 21:49:40 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 21:54:17 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 21:56:36 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 22:01:13 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 22:03:32 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 22:10:30 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 22:22:40 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 22:25:13 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 22:30:18 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 22:32:52 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 22:35:11 ERROR metabase.metabot :: Error connecting websocket: Read timed out
11-26 22:40:02 ERROR metabase.metabot :: Error connecting websocket: Read timed out

I have the same problem, I can send pulse to Slack but doesn't work when using Metabot on Slack.
I have metabase running on my company's intranet with the proxy settings.
@oBoMBaYo could you resolved this?
Does anyone know if it is an open port issue that can be resolved asking to the networking area of my company to open this port?.
Thank you!

I have asked security department in my company to give an access to all ports and all domains used by slack. It doen't make sense. The connection is still timed out...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.