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

consul 1.2.0: MarshalJSON error happen in internal/ui api when proxy(Connect feature) exist #4345

Closed
yutopp opened this Issue Jul 6, 2018 · 4 comments

Comments

Projects
None yet
3 participants
@yutopp

yutopp commented Jul 6, 2018

Overview of the Issue

Internal API for ui returns a 500 error when viewing pages which have proxy related information like /nodes, /services, etc, if proxy services exist.

Reproduction Steps

Steps to reproduce this issue, eg:

  1. Create config file like below (named test.hcl)
connect {
  enabled = true
}

services {
  name = "test"
  id = "test-v1"
  port = 8080
  connect "proxy" {
    config {
      upstreams {
        destination_name = "test-dest"
        local_bind_port = 1234
      }
    }
  }
}
  1. Start consul as dev mode ./consul agent -dev -config-file=test.hcl -log-level=TRACE
  2. Access to http://localhost:8500/ui/dc1/nodes
  3. View error

Consul info for both Client and Server

Client info
agent:
	check_monitors = 0
	check_ttls = 0
	checks = 1
	services = 2
build:
	prerelease = 
	revision = 28141971
	version = 1.2.0
consul:
	bootstrap = false
	known_datacenters = 1
	leader = true
	leader_addr = 127.0.0.1:8300
	server = true
raft:
	applied_index = 12
	commit_index = 12
	fsm_pending = 0
	last_contact = 0
	last_log_index = 12
	last_log_term = 2
	last_snapshot_index = 0
	last_snapshot_term = 0
	latest_configuration = [{Suffrage:Voter ID:5c9e3efc-ca02-a600-8c42-8e44c3fefde2 Address:127.0.0.1:8300}]
	latest_configuration_index = 1
	num_peers = 0
	protocol_version = 3
	protocol_version_max = 3
	protocol_version_min = 0
	snapshot_version_max = 1
	snapshot_version_min = 0
	state = Leader
	term = 2
runtime:
	arch = amd64
	cpu_count = 2
	goroutines = 78
	max_procs = 2
	os = linux
	version = go1.10.1
serf_lan:
	coordinate_resets = 0
	encrypted = false
	event_queue = 1
	event_time = 2
	failed = 0
	health_score = 0
	intent_queue = 0
	left = 0
	member_time = 1
	members = 1
	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 = 1
	members = 1
	query_queue = 0
	query_time = 1
Server info
agent:
	check_monitors = 0
	check_ttls = 0
	checks = 1
	services = 2
build:
	prerelease = 
	revision = 28141971
	version = 1.2.0
consul:
	bootstrap = false
	known_datacenters = 1
	leader = true
	leader_addr = 127.0.0.1:8300
	server = true
raft:
	applied_index = 12
	commit_index = 12
	fsm_pending = 0
	last_contact = 0
	last_log_index = 12
	last_log_term = 2
	last_snapshot_index = 0
	last_snapshot_term = 0
	latest_configuration = [{Suffrage:Voter ID:5c9e3efc-ca02-a600-8c42-8e44c3fefde2 Address:127.0.0.1:8300}]
	latest_configuration_index = 1
	num_peers = 0
	protocol_version = 3
	protocol_version_max = 3
	protocol_version_min = 0
	snapshot_version_max = 1
	snapshot_version_min = 0
	state = Leader
	term = 2
runtime:
	arch = amd64
	cpu_count = 2
	goroutines = 78
	max_procs = 2
	os = linux
	version = go1.10.1
serf_lan:
	coordinate_resets = 0
	encrypted = false
	event_queue = 1
	event_time = 2
	failed = 0
	health_score = 0
	intent_queue = 0
	left = 0
	member_time = 1
	members = 1
	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 = 1
	members = 1
	query_queue = 0
	query_time = 1

Operating system and Environment details

Linux 4.16.13-2-ARCH #1 SMP PREEMPT Fri Jun 1 18:46:11 UTC 2018 x86_64 GNU/Linux

Log Fragments

2018/07/06 14:48:29 [ERR] http: Request GET /v1/internal/ui/nodes?dc=dc1, error: json: error calling MarshalJSON for type *structs.ServiceDefinitionConnectProxy: json: unsupported type: map[interface {}]interface {} from=127.0.0.1:41370
@yuval-k

This comment has been minimized.

yuval-k commented Jul 10, 2018

I've encountered the same issue. using latest master fixed it for us.

@mitchellh

This comment has been minimized.

Member

mitchellh commented Jul 10, 2018

@hashicorp/consul I'll take a look at this today if its not already fixed on master.

@mitchellh mitchellh self-assigned this Jul 10, 2018

@mitchellh mitchellh added this to the 1.2.1 milestone Jul 10, 2018

@mitchellh

This comment has been minimized.

Member

mitchellh commented Jul 10, 2018

Verified this is fixed on master already so we're good to go. 1.2.1 will be released soon (this week or early next).

@mitchellh mitchellh closed this Jul 10, 2018

@yutopp

This comment has been minimized.

yutopp commented Jul 11, 2018

Thank you for your quick response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment