title: "Failed to submit supervisor: Request failed with status code 502" on submitting ingestion spec to router
body: <p>I am getting the error <em>"Failed to submit supervisor: Request failed with status code 502"</em> when I am trying to submit an ingestion spec to the druid UI (through the router). The ingestion spec works in a standalone druid server. </p>
  
  <p>I have set up the cluster using 4 machines-1 for the coordinator and overlord (master), 1 for historical and middle manager (data), 1 for broker (query), and 1 for router, with a separate instance for zookeeper. There is no error in the logs. </p>
  
  <p>The ingestion spec is as follows:</p>
  
  <pre><code>{
    "type": "kafka",
    "dataSchema": {
      "dataSource": "table1",
      "parser": {
        "type": "string",
        "parseSpec": {
          "format": "json",
          "dimensionsSpec": {
            "dimensions": [
             // List of valid dimensions
            ]
          },
          "timestampSpec": {
            "column": "createdOnDate", // In 'YYYY-MM-DD' format
            "format": "iso"
          }
        }
      },
      "granularitySpec": {
        "type": "uniform",
        "segmentGranularity": "MONTH",
        "rollup": false,
        "queryGranularity": "none"
      },
      "metricsSpec": []
    },
    "ioConfig": {
      "type": "kafka",
      "topic": "mongotopic",
      "consumerProperties": {
        "bootstrap.servers": "ip:9092"
      },
      "useEarliestOffset": true
    },
    "tuningConfig": {
      "type": "kafka",
      "forceExtendableShardSpecs": true,
      "maxParseExceptions": 100,
      "maxSavedParseExceptions": 10
    }
  }
  
  </code></pre>
  
  <p>The content of common.runtime.properties is as follows:</p>
  
  <pre><code>#
  # Licensed to the Apache Software Foundation (ASF) under one
  # or more contributor license agreements.  See the NOTICE file
  # distributed with this work for additional information
  # regarding copyright ownership.  The ASF licenses this file
  # to you under the Apache License, Version 2.0 (the
  # "License"); you may not use this file except in compliance
  # with the License.  You may obtain a copy of the License at
  #
  #   http://www.apache.org/licenses/LICENSE-2.0
  #
  # Unless required by applicable law or agreed to in writing,
  # software distributed under the License is distributed on an
  # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  # KIND, either express or implied.  See the License for the
  # specific language governing permissions and limitations
  # under the License.
  #
  
  #
  # Extensions
  #
  
  # This is not the full list of Druid extensions, but common ones that people often use. You may need to change this list
  # based on your particular setup.
  druid.extensions.loadList=["druid-histogram", "druid-datasketches", "druid-lookups-cached-global", "druid-s3-extensions","postgresql-metadata-storage"]
  
  # If you have a different version of Hadoop, place your Hadoop client jar files in your hadoop-dependencies directory
  # and uncomment the line below to point to your directory.
  #druid.extensions.hadoopDependenciesDir=/my/dir/hadoop-dependencies
  
  #
  # Logging
  #
  
  # Log all runtime properties on startup. Disable to avoid logging properties on startup:
  druid.startup.logging.logProperties=true
  
  #
  # Zookeeper
  #
  
  druid.zk.service.host=druid-ip:2181
  druid.zk.paths.base=/druid
  
  #
  # Metadata storage
  #
  
  # For Derby server on your Druid Coordinator (only viable in a cluster with a single Coordinator, no fail-over):
  #druid.metadata.storage.type=derby
  #druid.metadata.storage.connector.connectURI=jdbc:derby://metadata.store.ip:1527/var/druid/metadata.db;create=true
  #druid.metadata.storage.connector.host=metadata.store.ip
  #druid.metadata.storage.connector.port=1527
  
  # For MySQL (make sure to include the MySQL JDBC driver on the classpath):
  #druid.metadata.storage.type=mysql
  #druid.metadata.storage.connector.connectURI=jdbc:mysql:///druid
  #druid.metadata.storage.connector.user=druid
  #druid.metadata.storage.connector.password=druid
  
  # For PostgreSQL (make sure to additionally include the Postgres extension):
  druid.metadata.storage.type=postgresql
  druid.metadata.storage.connector.connectURI=jdbc:postgresql://db.example.com:5432/druid
  druid.metadata.storage.connector.user=user
  druid.metadata.storage.connector.password=password
  
  #
  # Deep storage
  #
  
  # For local disk (only viable in a cluster if this is a network mount):
  # druid.storage.type=local
  # druid.storage.storageDirectory=var/druid/segments
  
  # For HDFS (make sure to include the HDFS extension and that your Hadoop config files in the cp):
  #druid.storage.type=hdfs
  #druid.storage.storageDirectory=/druid/segments
  
  # For S3:
  druid.storage.type=s3
  druid.storage.bucket=valid-bucket
  druid.storage.baseKey=druid/segments
  druid.s3.accessKey=valid-key
  druid.s3.secretKey=valid-secret
  
  #
  # Indexing service logs
  #
  
  # For local disk (only viable in a cluster if this is a network mount):
  #druid.indexer.logs.type=file
  #druid.indexer.logs.directory=var/druid/indexing-logs
  
  # For HDFS (make sure to include the HDFS extension and that your Hadoop config files in the cp):
  #druid.indexer.logs.type=hdfs
  #druid.indexer.logs.directory=/druid/indexing-logs
  
  # For S3:
  druid.indexer.logs.type=s3
  druid.indexer.logs.s3Bucket=druid-test-1
  druid.indexer.logs.s3Prefix=druid/indexing-logs
  
  #
  # Service discovery
  #
  
  druid.selectors.indexing.serviceName=druid/overlord
  druid.selectors.coordinator.serviceName=druid/coordinator
  
  #
  # Monitoring
  #
  
  druid.monitoring.monitors=["org.apache.druid.java.util.metrics.JvmMonitor"]
  druid.emitter=logging
  druid.emitter.logging.logLevel=info
  
  # Storage type of double columns
  # ommiting this will lead to index double as float at the storage layer
  
  druid.indexing.doubleStorage=double
  
  #
  # SQL
  #
  druid.sql.enable=true
  
  </code></pre>
  
  <p>On submitting the specification to the task/supervisor/Submit Supervisor tab through the IP of the router (IP:8888/unified-console), I get the <em>Failed to submit supervisor: Request failed with status code 502</em> error in the UI. Zookeeper, S3 and Postgres configurations are valid. The UI shows 1 middle-manager, and 0 historicals, 0 data sources, and 0 segments.</p>