question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

confluent-hub install through proxy

See original GitHub issue

I’m trying to run docker-compose up -d --build according to documentation but the process gets stuck on building step:

Step 5/5 : RUN confluent-hub install --no-prompt confluentinc/kafka-connect-datagen:latest
 ---> Running in c4b8de698b86
Running in a "--no-prompt" mode
java.net.ConnectException: Connection timed out (Connection timed out)

Server that I’m running docker on doesn’t have direct Internet access and configured to use proxy server so I tried to add environment variables to Dockerfile:

ENV HTTP_PROXY="my_proxy"
ENV HTTPS_PROXY="my_proxy"

But it doesn’t help.

I’ve pulled confluentinc/cp-kafka-connect:5.2.1 docker image, run it interactively and tried to install kafka-connect-datagen:latest manually

docker pull confluentinc/cp-kafka-connect:5.2.1
docker run -it --rm confluentinc/cp-kafka-connect:5.2.1 /bin/bash
export http_proxy=MY_PROXY_ADDRESS
export https_proxy=MY_PROXY_ADDRESS
confluent-hub install --no-prompt confluentinc/kafka-connect-datagen:latest

But the image still cannot be downloaded.

curl -I https://api.hub.confluent.io/api/plugins says that connection was successful so obviously there is no proxy support for confluent-hub client. Is there any workaround for this issue?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
z3rohourcommented, May 8, 2019

As usual, I managed to fix the problem by myself right after posting 😃 Proxy parameters are taken from zulu-8-amd64 package so I simply add few lines into Dockerfile which define default proxy settings for Java:

RUN sed -i 's/# http.proxyHost=/http.proxyHost=MY_PROXY_ADDRESS/g' /usr/lib/jvm/zulu-8-amd64/jre/lib/net.properties && \
    sed -i 's/# http.proxyPort=80/http.proxyPort=MY_PROXY_PORT/g' /usr/lib/jvm/zulu-8-amd64/jre/lib/net.properties && \
    sed -i 's/# https.proxyHost=/https.proxyHost=MY_PROXY_ADDRESS/g' /usr/lib/jvm/zulu-8-amd64/jre/lib/net.properties && \
    sed -i 's/# https.proxyPort=443/https.proxyPort=MY_PROXY_PORT/g' /usr/lib/jvm/zulu-8-amd64/jre/lib/net.properties && \
    confluent-hub install --no-prompt confluentinc/kafka-connect-datagen:latest
0reactions
vielfarbigcommented, Dec 4, 2021

I use the image confluentinc/ksqldb-server:0.17.0 and installation via confluent-hub install in the docker-compose command option, as you can see in https://github.com/confluentinc/demo-scene/blob/master/ksqldb-tombstones/docker-compose.yml. In this version zulu11 is used and you have to edit /usr/lib/jvm/zulu11/conf/net.properties. This cannot be edited by the docker-compose command option, because the user has not enough permissons. So I copied the net.properties with docker cp ksqldb:/usr/lib/jvm/zulu11/conf/net.properties ., edited and mounted the net.properties by:

    volumes:
      - ./net.properties:/usr/lib/jvm/zulu11/conf/net.properties

In the net.properties it is important to not use the schema, so http:// before the hosts, as so:

http.proxyHost=proxy.example.com
http.proxyPort=80
http.nonProxyHosts=localhost|127.*|[::1]

https.proxyHost=proxy.example.com
https.proxyPort=443
Read more comments on GitHub >

github_iconTop Results From Across the Web

confluent-hub install | Confluent Platform 4.1.0
The local directory into which components are installed. Defaults to $share/confluent-hub-components when running the client in an archive ...
Read more >
Installing kafka-connect-spooldir doesn't work - Stack Overflow
I assume that you are attempting to run confluent-hub install behind a proxy. If this is the case, then the following should do...
Read more >
Proxy and HTTPS setup for Confluence
HTTPS - Proxying Confluence via Apache or Nginx over HTTPS, Use this option when you want to use a reverse proxy and enable...
Read more >
confluentinc/cp-kafka-rest - Docker Image
Confluent Docker Image for the REST Proxy. Docker image for deploying and running the REST Proxy. The source code is are currently available...
Read more >
GitHub - grepplabs/kafka-proxy
kafka -proxy. Build Status Docker Hub Docker Pulls. The Kafka Proxy is based on idea of Cloud SQL Proxy. It allows a service...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found