weixin_39710660
weixin_39710660
2020-12-04 20:39

/api/kafka-rest-proxy CONNECTIVITY ERROR

I am not able to get the Topics UI working. When I visit the URL, the page loads but under the Kafka Rest card the UI outputs "/api/kafka-rest-proxy CONNECTIVITY ERROR". The appropriate configuration properties are already set based on the Common Issues.

The docker-compose.yml file content:


---
version: '2'
services:
  zookeeper:
    image: confluentinc/cp-zookeeper
    hostname: zookeeper
    ports:
      - "2181:2181"
    environment:
      ZOOKEEPER_CLIENT_PORT: 2181
      ZOOKEEPER_TICK_TIME: 2000

  broker:
    image: confluentinc/cp-enterprise-kafka
    hostname: broker
    depends_on:
      - zookeeper
    ports:
      - "9092:9092"
    environment:
      KAFKA_BROKER_ID: 1
      KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
      KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://broker:9092
      KAFKA_METRIC_REPORTERS: io.confluent.metrics.reporter.ConfluentMetricsReporter
      KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
      KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
      CONFLUENT_METRICS_REPORTER_BOOTSTRAP_SERVERS: broker:9092
      CONFLUENT_METRICS_REPORTER_ZOOKEEPER_CONNECT: zookeeper:2181
      CONFLUENT_METRICS_REPORTER_TOPIC_REPLICAS: 1
      CONFLUENT_METRICS_ENABLE: 'true'
      CONFLUENT_SUPPORT_CUSTOMER_ID: 'anonymous'

  schema_registry:
    image: confluentinc/cp-schema-registry
    hostname: schema_registry
    depends_on:
      - zookeeper
      - broker
    ports:
      - "8081:8081"
    environment:
      SCHEMA_REGISTRY_HOST_NAME: schema_registry
      SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL: zookeeper:2181

  schema_registry_ui:
    image: landoop/schema-registry-ui:0.9.4
    hostname: schema_registry_ui
    ports:
      - "8001:8000"
    environment:
      SCHEMAREGISTRY_URL: http://schema_registry:8081
      PROXY: 'true'
    depends_on:
      - schema_registry

  rest_proxy:
    image: confluentinc/cp-kafka-rest:latest
    hostname: rest_proxy
    depends_on:
      - zookeeper
      - broker
      - schema_registry
    ports:
      - "8082:8082"
    environment:
      KAFKA_REST_ZOOKEEPER_CONNECT: zookeeper:2181
      KAFKA_REST_LISTENERS: http://localhost:8082
      KAFKA_REST_SCHEMA_REGISTRY_URL: http://schema_registry:8081
      KAFKA_REST_HOST_NAME: rest_proxy
      KAFKA_REST_BOOTSTRAP_SERVERS: PLAINTEXT://broker:9092
      KAFKA_REST_CONSUMER_REQUEST_TIMEOUT_MS: 30000
      KAFKA_REST_ACCESS_CONTROL_ALLOW_METHODS: 'GET,POST,PUT,DELETE,OPTIONS'
      KAFKA_REST_ACCESS_CONTROL_ALLOW_ORIGN: '*'

  topics_ui:
    image: landoop/kafka-topics-ui:0.9.3
    hostname: topics_ui
    ports:
      - "8000:8000"
    environment:
      KAFKA_REST_PROXY_URL: http://rest_proxy:8082
      SCHEMAREGISTRY_UI_URL: http://schema_registry:8081
      PROXY: 'true'
    depends_on:
      - zookeeper
      - broker
      - schema_registry
      - rest_proxy

The kafka-rest.properties file content:


access.control.allow.orign=*
access.control.allow.methods=GET,POST,PUT,DELETE,OPTIONS
zookeeper.connect=zookeeper:2181
bootstrap.servers=PLAINTEXT://broker:9092
listeners=http://localhost:8082
consumer.request.timeout.ms=30000
schema.registry.url=http://schema_registry:8081
host.name=rest_proxy

The logs from docker after performing a hard refresh within the UI:


topics_ui_1           | 172.19.0.1 - [10/Jun/2018:00:06:06 +0000] "GET / HTTP/1.1" 200 4130
topics_ui_1           | 172.19.0.1 - [10/Jun/2018:00:06:06 +0000] "GET /bower_components/handsontable/dist/handsontable.full.css HTTP/1.1" 200 28577
topics_ui_1           | 172.19.0.1 - [10/Jun/2018:00:06:06 +0000] "GET /bower_components/font-awesome/css/font-awesome.min.css HTTP/1.1" 200 31000
topics_ui_1           | 172.19.0.1 - [10/Jun/2018:00:06:06 +0000] "GET /bower_components/angular-material-data-table/dist/md-data-table.min.css HTTP/1.1" 200 9605
topics_ui_1           | 172.19.0.1 - [10/Jun/2018:00:06:06 +0000] "GET /bower_components/angular-json-tree/dist/angular-json-tree.css HTTP/1.1" 200 1331
topics_ui_1           | 172.19.0.1 - [10/Jun/2018:00:06:06 +0000] "GET /bower_components/angular-material/angular-material.min.css HTTP/1.1" 200 444680
topics_ui_1           | 172.19.0.1 - [10/Jun/2018:00:06:06 +0000] "GET /src/assets/css/styles.css HTTP/1.1" 200 10268
topics_ui_1           | 172.19.0.1 - [10/Jun/2018:00:06:06 +0000] "GET /bower_components/spin.js/spin.min.js HTTP/1.1" 200 4277
topics_ui_1           | 172.19.0.1 - [10/Jun/2018:00:06:06 +0000] "GET /bower_components/angular-ui-ace/ui-ace.min.js HTTP/1.1" 200 3282
topics_ui_1           | 172.19.0.1 - [10/Jun/2018:00:06:06 +0000] "GET /bower_components/ace-builds/src-min-noconflict/ace.js HTTP/1.1" 200 373191
topics_ui_1           | 172.19.0.1 - [10/Jun/2018:00:06:06 +0000] "GET /bower_components/angular-spinner/angular-spinner.min.js HTTP/1.1" 200 1520
topics_ui_1           | 172.19.0.1 - [10/Jun/2018:00:06:06 +0000] "GET /bower_components/angular/angular.min.js HTTP/1.1" 200 167131
topics_ui_1           | 172.19.0.1 - [10/Jun/2018:00:06:06 +0000] "GET /bower_components/angular-route/angular-route.min.js HTTP/1.1" 200 5611
topics_ui_1           | 172.19.0.1 - [10/Jun/2018:00:06:06 +0000] "GET /bower_components/angular-animate/angular-animate.min.js HTTP/1.1" 200 25673
topics_ui_1           | 172.19.0.1 - [10/Jun/2018:00:06:06 +0000] "GET /bower_components/angular-material/angular-material.min.js HTTP/1.1" 200 316540
topics_ui_1           | 172.19.0.1 - [10/Jun/2018:00:06:06 +0000] "GET /bower_components/angular-aria/angular-aria.min.js HTTP/1.1" 200 3924
topics_ui_1           | 172.19.0.1 - [10/Jun/2018:00:06:06 +0000] "GET /bower_components/angular-material-data-table/dist/md-data-table.min.js HTTP/1.1" 200 21381
topics_ui_1           | 172.19.0.1 - [10/Jun/2018:00:06:06 +0000] "GET /bower_components/angular-json-tree/dist/angular-json-tree.min.js HTTP/1.1" 200 2327
topics_ui_1           | 172.19.0.1 - [10/Jun/2018:00:06:06 +0000] "GET /bower_components/angular-cookies/angular-cookies.min.js HTTP/1.1" 200 1478
topics_ui_1           | 172.19.0.1 - [10/Jun/2018:00:06:06 +0000] "GET /bower_components/ngHandsontable/dist/ngHandsontable.js HTTP/1.1" 200 19071
topics_ui_1           | 172.19.0.1 - [10/Jun/2018:00:06:06 +0000] "GET /bower_components/angular-base64/angular-base64.js HTTP/1.1" 200 5844
topics_ui_1           | 172.19.0.1 - [10/Jun/2018:00:06:06 +0000] "GET /bower_components/handsontable/dist/handsontable.full.js HTTP/1.1" 200 1266214
topics_ui_1           | 172.19.0.1 - [10/Jun/2018:00:06:06 +0000] "GET /combined.js?rel=f82cba0347 HTTP/1.1" 200 92430
topics_ui_1           | 172.19.0.1 - [10/Jun/2018:00:06:06 +0000] "GET /env.js HTTP/1.1" 200 181
topics_ui_1           | 172.19.0.1 - [10/Jun/2018:00:06:07 +0000] "GET /bower_components/angular-cookies/angular-cookies.min.js.map HTTP/1.1" 404 14
topics_ui_1           | 172.19.0.1 - [10/Jun/2018:00:06:07 +0000] "GET /src/assets/icons/landoop-dark.svg HTTP/1.1" 200 1676
topics_ui_1           | 172.19.0.1 - [10/Jun/2018:00:06:07 +0000] "GET /src/kafka-topics/list/topics-list.html HTTP/1.1" 200 2454
topics_ui_1           | 172.19.0.1 - [10/Jun/2018:00:06:07 +0000] "GET /src/kafka-topics/dashboard-components/select-cluster/select-cluster.html HTTP/1.1" 200 670
topics_ui_1           | 172.19.0.1 - [10/Jun/2018:00:06:07 +0000] "GET /src/kafka-topics/dashboard-components/missing-env/missing-env.html HTTP/1.1" 200 1028
topics_ui_1           | 172.19.0.1 - [10/Jun/2018:00:06:07 +0000] "GET /src/kafka-topics/home/home.html HTTP/1.1" 200 437
topics_ui_1           | 172.19.0.1 - [10/Jun/2018:00:06:07 +0000] "GET /src/kafka-topics/dashboard-components/total-topics/total-topics.html HTTP/1.1" 200 583
topics_ui_1           | 172.19.0.1 - [10/Jun/2018:00:06:07 +0000] "GET /src/kafka-topics/dashboard-components/total-brokers/total-brokers.html HTTP/1.1" 200 614
topics_ui_1           | 172.19.0.1 - [10/Jun/2018:00:06:07 +0000] "GET /topics HTTP/1.1" 502 16
topics_ui_1           | 172.19.0.1 - [10/Jun/2018:00:06:07 +0000] "POST /consumers/kafka_topics_ui_json_2018-06-09-08-06-03-705 HTTP/1.1" 502 16
topics_ui_1           | 172.19.0.1 - [10/Jun/2018:00:06:07 +0000] "GET /src/kafka-topics/dashboard-components/config/config.html HTTP/1.1" 200 369
topics_ui_1           | 172.19.0.1 - [10/Jun/2018:00:06:07 +0000] "GET /src/kafka-topics/dashboard-components/version/project-version.html HTTP/1.1" 200 279
topics_ui_1           | 172.19.0.1 - [10/Jun/2018:00:06:07 +0000] "GET /bower_components/font-awesome/fonts/fontawesome-webfont.woff2?v=4.7.0 HTTP/1.1" 200 77160
topics_ui_1           | 172.19.0.1 - [10/Jun/2018:00:06:07 +0000] "GET /topics HTTP/1.1" 502 16
topics_ui_1           | 172.19.0.1 - [10/Jun/2018:00:06:07 +0000] "GET /brokers HTTP/1.1" 502 16

The error within the Chrome Inspect Console:


angular.js:12587 POST http://0.0.0.0:8000/api/kafka-rest-proxy/consumers/kafka_topics_ui_json_2018-06-09-08-06-03-705 502 (Bad Gateway)
(anonymous) @ angular.js:12587
p @ angular.js:12332
(anonymous) @ angular.js:12084
(anonymous) @ angular.js:16832
$digest @ angular.js:17971
$apply @ angular.js:18269
l @ angular.js:12387
A.onload @ angular.js:12541
load (async)
(anonymous) @ angular.js:12524
p @ angular.js:12332
(anonymous) @ angular.js:12084
(anonymous) @ angular.js:16832
$digest @ angular.js:17971
$apply @ angular.js:18269
(anonymous) @ angular.js:1917
invoke @ angular.js:5003
c @ angular.js:1915
Sc @ angular.js:1935
ue @ angular.js:1820
(anonymous) @ angular.js:33367
b @ angular.js:3431

angular.js:14525 HTTP ERROR:  Failed at method [POST] [/api/kafka-rest-proxy/consumers/kafka_topics_ui_json_2018-06-09-08-06-03-705] with error: 
{"data":"502 Bad Gateway\n","status":502,"config":{"method":"POST","transformRequest":[null],"transformResponse":[null],"jsonpCallbackParam":"callback","url":"/api/kafka-rest-proxy/consumers/kafka_topics_ui_json_2018-06-09-08-06-03-705","data":"{\"name\": \"kafka-topics-ui-json\", \"format\": \"json\", \"auto.offset.reset\": \"earliest\", \"auto.commit.enable\": \"false\"}","dataType":"json","headers":{"Content-Type":"application/vnd.kafka.v2+json","Accept":""}},"statusText":"Bad Gateway"} 
DATA SENT: {"name": "kafka-topics-ui-json", "format": "json", "auto.offset.reset": "earliest", "auto.commit.enable": "false"}
(anonymous) @ angular.js:14525
(anonymous) @ combined.js?rel=f82cba0347:640
(anonymous) @ angular.js:16832
$digest @ angular.js:17971
$apply @ angular.js:18269
l @ angular.js:12387
A.onload @ angular.js:12541
load (async)
(anonymous) @ angular.js:12524
p @ angular.js:12332
(anonymous) @ angular.js:12084
(anonymous) @ angular.js:16832
$digest @ angular.js:17971
$apply @ angular.js:18269
l @ angular.js:12387
A.onload @ angular.js:12541
load (async)
(anonymous) @ angular.js:12524
p @ angular.js:12332
(anonymous) @ angular.js:12084
(anonymous) @ angular.js:16832
$digest @ angular.js:17971
$apply @ angular.js:18269
(anonymous) @ angular.js:1917
invoke @ angular.js:5003
c @ angular.js:1915
Sc @ angular.js:1935
ue @ angular.js:1820
(anonymous) @ angular.js:33367
b @ angular.js:3431

angular.js:14525 Possibly unhandled rejection: Failed at method [POST] [/api/kafka-rest-proxy/consumers/kafka_topics_ui_json_2018-06-09-08-06-03-705] with error: 
{"data":"502 Bad Gateway\n","status":502,"config":{"method":"POST","transformRequest":[null],"transformResponse":[null],"jsonpCallbackParam":"callback","url":"/api/kafka-rest-proxy/consumers/kafka_topics_ui_json_2018-06-09-08-06-03-705","data":"{\"name\": \"kafka-topics-ui-json\", \"format\": \"json\", \"auto.offset.reset\": \"earliest\", \"auto.commit.enable\": \"false\"}","dataType":"json","headers":{"Content-Type":"application/vnd.kafka.v2+json","Accept":""}},"statusText":"Bad Gateway"}
(anonymous) @ angular.js:14525
(anonymous) @ angular.js:11008
g @ angular.js:16860
$digest @ angular.js:17971
$apply @ angular.js:18269
l @ angular.js:12387
A.onload @ angular.js:12541
load (async)
(anonymous) @ angular.js:12524
p @ angular.js:12332
(anonymous) @ angular.js:12084
(anonymous) @ angular.js:16832
$digest @ angular.js:17971
$apply @ angular.js:18269
l @ angular.js:12387
A.onload @ angular.js:12541
load (async)
(anonymous) @ angular.js:12524
p @ angular.js:12332
(anonymous) @ angular.js:12084
(anonymous) @ angular.js:16832
$digest @ angular.js:17971
$apply @ angular.js:18269
(anonymous) @ angular.js:1917
invoke @ angular.js:5003
c @ angular.js:1915
Sc @ angular.js:1935
ue @ angular.js:1820
(anonymous) @ angular.js:33367
b @ angular.js:3431

angular.js:12587 GET http://0.0.0.0:8000/api/kafka-rest-proxy/topics 502 (Bad Gateway)
(anonymous) @ angular.js:12587
p @ angular.js:12332
(anonymous) @ angular.js:12084
(anonymous) @ angular.js:16832
$digest @ angular.js:17971
$apply @ angular.js:18269
l @ angular.js:12387
A.onload @ angular.js:12541
load (async)
(anonymous) @ angular.js:12524
p @ angular.js:12332
(anonymous) @ angular.js:12084
(anonymous) @ angular.js:16832
$digest @ angular.js:17971
$apply @ angular.js:18269
(anonymous) @ angular.js:1917
invoke @ angular.js:5003
c @ angular.js:1915
Sc @ angular.js:1935
ue @ angular.js:1820
(anonymous) @ angular.js:33367
b @ angular.js:3431

angular.js:14525 HTTP ERROR:  Failed at method [GET] [/api/kafka-rest-proxy/topics] with error: 
{"data":"502 Bad Gateway\n","status":502,"config":{"method":"GET","transformRequest":[null],"transformResponse":[null],"jsonpCallbackParam":"callback","url":"/api/kafka-rest-proxy/topics","dataType":"json","headers":{}},"statusText":"Bad Gateway"} 
DATA SENT: undefined
(anonymous) @ angular.js:14525
(anonymous) @ combined.js?rel=f82cba0347:640
(anonymous) @ angular.js:16832
$digest @ angular.js:17971
$apply @ angular.js:18269
l @ angular.js:12387
A.onload @ angular.js:12541
load (async)
(anonymous) @ angular.js:12524
p @ angular.js:12332
(anonymous) @ angular.js:12084
(anonymous) @ angular.js:16832
$digest @ angular.js:17971
$apply @ angular.js:18269
l @ angular.js:12387
A.onload @ angular.js:12541
load (async)
(anonymous) @ angular.js:12524
p @ angular.js:12332
(anonymous) @ angular.js:12084
(anonymous) @ angular.js:16832
$digest @ angular.js:17971
$apply @ angular.js:18269
(anonymous) @ angular.js:1917
invoke @ angular.js:5003
c @ angular.js:1915
Sc @ angular.js:1935
ue @ angular.js:1820
(anonymous) @ angular.js:33367
b @ angular.js:3431

angular.js:14525 Possibly unhandled rejection: Failed at method [GET] [/api/kafka-rest-proxy/topics] with error: 
{"data":"502 Bad Gateway\n","status":502,"config":{"method":"GET","transformRequest":[null],"transformResponse":[null],"jsonpCallbackParam":"callback","url":"/api/kafka-rest-proxy/topics","dataType":"json","headers":{}},"statusText":"Bad Gateway"}
(anonymous) @ angular.js:14525
(anonymous) @ angular.js:11008
g @ angular.js:16860
$digest @ angular.js:17971
$apply @ angular.js:18269
l @ angular.js:12387
A.onload @ angular.js:12541
load (async)
(anonymous) @ angular.js:12524
p @ angular.js:12332
(anonymous) @ angular.js:12084
(anonymous) @ angular.js:16832
$digest @ angular.js:17971
$apply @ angular.js:18269
l @ angular.js:12387
A.onload @ angular.js:12541
load (async)
(anonymous) @ angular.js:12524
p @ angular.js:12332
(anonymous) @ angular.js:12084
(anonymous) @ angular.js:16832
$digest @ angular.js:17971
$apply @ angular.js:18269
(anonymous) @ angular.js:1917
invoke @ angular.js:5003
c @ angular.js:1915
Sc @ angular.js:1935
ue @ angular.js:1820
(anonymous) @ angular.js:33367
b @ angular.js:3431

angular.js:12587 GET http://0.0.0.0:8000/api/kafka-rest-proxy/topics 502 (Bad Gateway)
(anonymous) @ angular.js:12587
p @ angular.js:12332
(anonymous) @ angular.js:12084
(anonymous) @ angular.js:16832
$digest @ angular.js:17971
$apply @ angular.js:18269
l @ angular.js:12387
A.onload @ angular.js:12541
load (async)
(anonymous) @ angular.js:12524
p @ angular.js:12332
(anonymous) @ angular.js:12084
(anonymous) @ angular.js:16832
$digest @ angular.js:17971
$apply @ angular.js:18269
l @ angular.js:12387
A.onload @ angular.js:12541
load (async)
(anonymous) @ angular.js:12524
p @ angular.js:12332
(anonymous) @ angular.js:12084
(anonymous) @ angular.js:16832
$digest @ angular.js:17971
$apply @ angular.js:18269
(anonymous) @ angular.js:1917
invoke @ angular.js:5003
c @ angular.js:1915
Sc @ angular.js:1935
ue @ angular.js:1820
(anonymous) @ angular.js:33367
b @ angular.js:3431

angular.js:14525 HTTP ERROR:  Failed at method [GET] [/api/kafka-rest-proxy/topics] with error: 
{"data":"502 Bad Gateway\n","status":502,"config":{"method":"GET","transformRequest":[null],"transformResponse":[null],"jsonpCallbackParam":"callback","url":"/api/kafka-rest-proxy/topics","dataType":"json","headers":{}},"statusText":"Bad Gateway"} 
DATA SENT: undefined
(anonymous) @ angular.js:14525
(anonymous) @ combined.js?rel=f82cba0347:640
(anonymous) @ angular.js:16832
$digest @ angular.js:17971
$apply @ angular.js:18269
l @ angular.js:12387
A.onload @ angular.js:12541
load (async)
(anonymous) @ angular.js:12524
p @ angular.js:12332
(anonymous) @ angular.js:12084
(anonymous) @ angular.js:16832
$digest @ angular.js:17971
$apply @ angular.js:18269
l @ angular.js:12387
A.onload @ angular.js:12541
load (async)
(anonymous) @ angular.js:12524
p @ angular.js:12332
(anonymous) @ angular.js:12084
(anonymous) @ angular.js:16832
$digest @ angular.js:17971
$apply @ angular.js:18269
l @ angular.js:12387
A.onload @ angular.js:12541
load (async)
(anonymous) @ angular.js:12524
p @ angular.js:12332
(anonymous) @ angular.js:12084
(anonymous) @ angular.js:16832
$digest @ angular.js:17971
$apply @ angular.js:18269
(anonymous) @ angular.js:1917
invoke @ angular.js:5003
c @ angular.js:1915
Sc @ angular.js:1935
ue @ angular.js:1820
(anonymous) @ angular.js:33367
b @ angular.js:3431

angular.js:14525 Possibly unhandled rejection: Failed at method [GET] [/api/kafka-rest-proxy/topics] with error: 
{"data":"502 Bad Gateway\n","status":502,"config":{"method":"GET","transformRequest":[null],"transformResponse":[null],"jsonpCallbackParam":"callback","url":"/api/kafka-rest-proxy/topics","dataType":"json","headers":{}},"statusText":"Bad Gateway"}
(anonymous) @ angular.js:14525
(anonymous) @ angular.js:11008
g @ angular.js:16860
$digest @ angular.js:17971
$apply @ angular.js:18269
l @ angular.js:12387
A.onload @ angular.js:12541
load (async)
(anonymous) @ angular.js:12524
p @ angular.js:12332
(anonymous) @ angular.js:12084
(anonymous) @ angular.js:16832
$digest @ angular.js:17971
$apply @ angular.js:18269
l @ angular.js:12387
A.onload @ angular.js:12541
load (async)
(anonymous) @ angular.js:12524
p @ angular.js:12332
(anonymous) @ angular.js:12084
(anonymous) @ angular.js:16832
$digest @ angular.js:17971
$apply @ angular.js:18269
l @ angular.js:12387
A.onload @ angular.js:12541
load (async)
(anonymous) @ angular.js:12524
p @ angular.js:12332
(anonymous) @ angular.js:12084
(anonymous) @ angular.js:16832
$digest @ angular.js:17971
$apply @ angular.js:18269
(anonymous) @ angular.js:1917
invoke @ angular.js:5003
c @ angular.js:1915
Sc @ angular.js:1935
ue @ angular.js:1820
(anonymous) @ angular.js:33367
b @ angular.js:3431

angular.js:12587 GET http://0.0.0.0:8000/api/kafka-rest-proxy/brokers 502 (Bad Gateway)
(anonymous) @ angular.js:12587
p @ angular.js:12332
(anonymous) @ angular.js:12084
(anonymous) @ angular.js:16832
$digest @ angular.js:17971
$apply @ angular.js:18269
l @ angular.js:12387
A.onload @ angular.js:12541
load (async)
(anonymous) @ angular.js:12524
p @ angular.js:12332
(anonymous) @ angular.js:12084
(anonymous) @ angular.js:16832
$digest @ angular.js:17971
$apply @ angular.js:18269
l @ angular.js:12387
A.onload @ angular.js:12541
load (async)
(anonymous) @ angular.js:12524
p @ angular.js:12332
(anonymous) @ angular.js:12084
(anonymous) @ angular.js:16832
$digest @ angular.js:17971
$apply @ angular.js:18269
(anonymous) @ angular.js:1917
invoke @ angular.js:5003
c @ angular.js:1915
Sc @ angular.js:1935
ue @ angular.js:1820
(anonymous) @ angular.js:33367
b @ angular.js:3431

angular.js:14525 HTTP ERROR:  Failed at method [GET] [/api/kafka-rest-proxy/brokers] with error: 
{"data":"502 Bad Gateway\n","status":502,"config":{"method":"GET","transformRequest":[null],"transformResponse":[null],"jsonpCallbackParam":"callback","url":"/api/kafka-rest-proxy/brokers","dataType":"json","headers":{}},"statusText":"Bad Gateway"} 
DATA SENT: undefined

What am I missing to be able to get the Topics UI running without problems or is this a bug?

该提问来源于开源项目:lensesio/kafka-topics-ui

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

4条回答

  • weixin_39800062 weixin_39800062 5月前

    Hi , I think your listeners line for Kafka REST is the issue.

    You can try to set Kafka REST to bind to all interfaces:

    KAFKA_REST_LISTENERS: http://0.0.0.0:8082
    

    Or listen to the hostname of the container:

     KAFKA_REST_LISTENERS: http://rest_proxy:8082
    
    点赞 评论 复制链接分享
  • weixin_39710660 weixin_39710660 5月前

    Thank you, changing the KAFKA_REST_LISTENERS to http://0.0.0.0:8082 resolved the problem. However, for future readers, setting KAFKA_REST_LISTENERS to http://rest_proxy:8082 results in the rest_proxy failing to start up.

    点赞 评论 复制链接分享
  • weixin_39800062 weixin_39800062 5月前

    Glad we solved it!

    点赞 评论 复制链接分享
  • weixin_39517241 weixin_39517241 5月前

    Hi,

    I am getting same issue with configuration: version: '2' services: zookeeper: image: confluentinc/cp-zookeeper:5.2.2 ports: - 32181:32181 volumes: - "/vol1/zk-data:/var/lib/zookeeper/data" - "/vol2/zk-txn-logs:/var/lib/zookeeper/log" environment: ZOOKEEPER_CLIENT_PORT: 32181 ZOOKEEPER_TICK_TIME: 2000

    kafka: image: confluentinc/cp-kafka:5.2.2 volumes: - "/vol3/kafka-data:/var/lib/kafka/data" depends_on: - zookeeper ports: - 29092:29092 environment: KAFKA_BROKER_ID: 1 KAFKA_ZOOKEEPER_CONNECT: zookeeper:32181 KAFKA_LISTENERS: LISTENER_BOB://kafka:9092,LISTENER_FRED://0.0.0.0:29092 KAFKA_ADVERTISED_LISTENERS: LISTENER_FRED://test.moglix.com:29092,LISTENER_BOB://kafka:9092 KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: LISTENER_BOB:PLAINTEXT,LISTENER_FRED:PLAINTEXT KAFKA_INTER_BROKER_LISTENER_NAME: LISTENER_BOB KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 KAFKA_CONFIG_STORAGE_REPLICATION_FACTOR: 1 KAFKA_STATUS_STORAGE_REPLICATION_FACTOR: 1

    kafkaconnectjdbc: image: confluentinc/cp-kafka-connect network_mode: host hostname: localhost depends_on: - zookeeper - kafka ports: - "48083:48083" volumes: - /tmp/quickstart/file:/tmp/quickstart - /etc/jars:/etc/kafka-connect/jars environment: CONNECT_BOOTSTRAP_SERVERS: 'localhost:29092' CONNECT_REST_ADVERTISED_HOST_NAME: localhost CONNECT_REST_PORT: 48083 CONNECT_GROUP_ID: compose-connect-group CONNECT_CONFIG_STORAGE_TOPIC: docker-connect-configs CONNECT_CONFIG_STORAGE_REPLICATION_FACTOR: 1 CONNECT_OFFSET_FLUSH_INTERVAL_MS: 10000 CONNECT_OFFSET_STORAGE_TOPIC: docker-connect-offsets CONNECT_OFFSET_STORAGE_REPLICATION_FACTOR: 1 CONNECT_STATUS_STORAGE_TOPIC: docker-connect-status CONNECT_STATUS_STORAGE_REPLICATION_FACTOR: 1 CONNECT_KEY_CONVERTER: org.apache.kafka.connect.json.JsonConverter CONNECT_VALUE_CONVERTER: org.apache.kafka.connect.json.JsonConverter CONNECT_INTERNAL_KEY_CONVERTER: org.apache.kafka.connect.json.JsonConverter CONNECT_INTERNAL_VALUE_CONVERTER: org.apache.kafka.connect.json.JsonConverter CONNECT_ZOOKEEPER_CONNECT: 'localhost:32181' CONNECT_LOG4J_ROOT_LOGLEVEL: INFO CONNECT_LOG4J_LOGGERS: "org.apache.kafka.connect.runtime.rest=WARN,org.reflections=ERROR" CONNECT_PLUGIN_PATH: '/usr/share/java,/etc/kafka-connect/jars'

    debezium: image: debezium/connect:0.9 depends_on: - zookeeper - kafka ports: - "38083:38083" environment: BOOTSTRAP_SERVERS: 'kafka:9092' REST_ADVERTISED_HOST_NAME: localhost REST_PORT: 38083 GROUP_ID: debezium-connect-group CONFIG_STORAGE_TOPIC: docker-debezium-configs CONFIG_STORAGE_REPLICATION_FACTOR: 1 OFFSET_FLUSH_INTERVAL_MS: 10000 OFFSET_STORAGE_TOPIC: docker-debezium-offsets OFFSET_STORAGE_REPLICATION_FACTOR: 1 STATUS_STORAGE_TOPIC: docker-debezium-status STATUS_STORAGE_REPLICATION_FACTOR: 1 KEY_CONVERTER: org.apache.kafka.connect.json.JsonConverter VALUE_CONVERTER: org.apache.kafka.connect.json.JsonConverter INTERNAL_KEY_CONVERTER: org.apache.kafka.connect.json.JsonConverter INTERNAL_VALUE_CONVERTER: org.apache.kafka.connect.json.JsonConverter ZOOKEEPER_CONNECT: 'zookeeper:32181' kafka-rest-proxy: image: confluentinc/cp-kafka-rest:5.2.2 container_name: kafka-rest-proxy network_mode: host restart: unless-stopped depends_on: - zookeeper - kafka ports: - "8082:8082" environment: KAFKA_REST_BOOTSTRAP_SERVERS: kafka:29092 KAFKA_REST_ZOOKEEPER_CONNECT: zookeeper:32181 KAFKA_REST_HOST_NAME: kafka-rest-proxy KAFKA_REST_LISTENERS: http://0.0.0.0:8082 KAFKA_REST_CONSUMER_REQUEST_TIMEOUT_MS: 40000

    kafka-topics-ui: image: landoop/kafka-topics-ui:0.9.4 container_name: kafka-topics-ui restart: unless-stopped depends_on: - kafka-rest-proxy ports: - "8085:8000" environment: KAFKA_REST_PROXY_URL: http://kafka-rest-proxy:8082 PROXY: "true"

    Logs:

    Landoop Kafka Topics UI 0.9.4 Visit https://github.com/Landoop/kafka-topics-ui/tree/master/docker to find more about how you can configure this container.

    Enabling proxy. Kafka REST Proxy URL to /api/kafka-rest-proxy.

    Activating privacy features... done. http://0.0.0.0:8000 172.21.0.1 - - [17/Sep/2019:07:42:36 +0000] "GET /env.js HTTP/1.0" 200 181 172.21.0.1 - - [17/Sep/2019:07:42:37 +0000] "GET /api/kafka-rest-proxy/topics HTTP/1.0" 502 16 172.21.0.1 - - [17/Sep/2019:07:42:37 +0000] "GET /api/kafka-rest-proxy/brokers HTTP/1.0" 502 16 172.21.0.1 - - [17/Sep/2019:07:42:37 +0000] "POST /api/kafka-rest-proxy/consumers/kafka_topics_ui_json_2019-09-17-01-12-21-342 HTTP/1.0" 502 16 172.21.0.1 - - [17/Sep/2019:07:42:37 +0000] "GET /api/kafka-rest-proxy/topics HTTP/1.0" 502 16

    and anyone Please help me with this issue.

    点赞 评论 复制链接分享

相关推荐