hashicorp / hashicorp/consul

Consul UI makes invalid requests when Connect is disabled

Open
#8,033 16 comments 1 reaction 0 assignees View on GitHub
theme/ui
Dominant language
Go
Stars
30.1k
Forks
4.6k
Avg merge
1d 18h
Merged PRs (30d)
39

Description

#### Overview of the Issue

When deploying a Consul server with disabled Connect, navigating to a service's page in Consul UI leads to HTTP 500 on the server side with an error indicating that Connect must be enabled in order to access said endpoint.

#### Reproduction Steps

1. Start up a Consul agent as a server
1. Make sure Connect is disabled for the Consul server
1. Make sure Consul UI is enabled
1. Open up a browser and navigate to the Consul UI endpoint at /ui/dc1/services/consul
1. Observe the following error in the Consul agent logs (Actual IP replaced with `xxx` below):

`agent.http: Request error: method=GET url=/v1/discovery-chain/consul?dc=dc1 from=xxx.xxx.xxx.xxx:50354 error="rpc error making call: Connect must be enabled in order to use this endpoint"`

### Consul info for both Client and Server

Client info

```
agent:
check_monitors = 0
check_ttls = 1
checks = 5
services = 5
build:
prerelease =
revision = 8b4a3d95
version = 1.7.3
consul:
acl = disabled
known_servers = 3
server = false
runtime:
arch = amd64
cpu_count = 2
goroutines = 163
max_procs = 2
os = linux
version = go1.13.7
serf_lan:
coordinate_resets = 0
encrypted = false
event_queue = 0
event_time = 3
failed = 0
health_score = 0
intent_queue = 0
left = 0
member_time = 96
members = 4
query_queue = 0
query_time = 1
```

Server info

```
agent:
check_monitors = 0
check_ttls = 0
checks = 0
services = 0
build:
prerelease =
revision = 8b4a3d95
version = 1.7.3
consul:
acl = disabled
bootstrap = false
known_datacenters = 1
leader = false
leader_addr = 10.1.1.29:8300
server = true
raft:
applied_index = 29000
commit_index = 29000
fsm_pending = 0
last_contact = 37.640092ms
last_log_index = 29000
last_log_term = 97
last_snapshot_index = 16390
last_snapshot_term = 54
latest_configuration = [{Suffrage:Voter ID:729b7718-3a9a-95b8-f1fd-3a59f54c407d Address:10.1.1.29:8300} {Suffrage:Voter ID:2cd025ca-771a-4311-e873-ae699816d4f9 Address:10.1.1.30:8300} {Suffrage:Voter ID:30cfa0ae-1f1f-67a8-5470-137ce45ae193 Address:10.1.1.26:8300}]
latest_configuration_index = 0
num_peers = 2
protocol_version = 3
protocol_version_max = 3
protocol_version_min = 0
snapshot_version_max = 1
snapshot_version_min = 0
state = Follower
term = 97
runtime:
arch = amd64
cpu_count = 2
goroutines = 148
max_procs = 2
os = linux
version = go1.13.7
serf_lan:
coordinate_resets = 0
encrypted = false
event_queue = 0
event_time = 3
failed = 0
health_score = 0
intent_queue = 0
left = 0
member_time = 96
members = 4
query_queue = 0
query_time = 1
serf_wan:
coordinate_resets = 0
encrypted = false
event_queue = 0
event_time = 1
failed = 0
health_score = 0
intent_queue = 0
left = 0
member_time = 72
members = 3
query_queue = 0
query_time = 1
```

### Operating system and Environment details

Docker 19.03.3 running on Ubuntu 18.04.

### Log Fragments
```
2020-06-05T20:00:57.183Z [ERROR] agent.client: RPC failed to server: method=DiscoveryChain.Get server=xxx.xxx.xxx.xxx:8300 error="rpc error making call: Connect must be enabled in order to use this endpoint"
2020-06-05T20:00:57.183Z [ERROR] agent.http: Request error: method=GET url=/v1/discovery-chain/consul?dc=dc1 from=xxx.xxx.xxx.xxx:50354 error="rpc error making call: Connect must be enabled in order to use this endpoint"
```

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue by opening /ui/dc1/services/consul with Connect disabled, then inspect the UI request to /v1/discovery-chain/consul?dc=dc1 and the related server handling. Done means the service page no longer makes the invalid request or produces the Connect-disabled HTTP 500.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.