hashicorp / hashicorp/consul

Consul reload logs warning about being unable to deregister proxy services

Open
#11,711 1 comment 0 reactions 0 assignees View on GitHub
type/bug
Dominant language
Go
Stars
30.1k
Forks
4.6k
Avg merge
1d 18h
Merged PRs (30d)
39

Description

#### Overview of the Issue

```hcl
# service.hcl
service {
name = "foo"
port = 6060
connect {
sidecar_service {}
}
}
```

```
consul agent -dev -config-file service.hcl
```

```
consul reload
```

When it tries to unload the services as part of the reload process it logs a WARN about being unable to deregister the proxy service:

```
2021-12-02T09:21:44.674-0800 [DEBUG] agent: removed service: service=foo
2021-12-02T09:21:44.674-0800 [DEBUG] agent: removed check: check=service:foo-sidecar-proxy:2
2021-12-02T09:21:44.674-0800 [DEBUG] agent: removed check: check=service:foo-sidecar-proxy:1
2021-12-02T09:21:44.674-0800 [DEBUG] agent: removed service: service=foo-sidecar-proxy
2021-12-02T09:21:44.674-0800 [WARN] agent: Failed to deregister service: service=foo-sidecar-proxy error="Service "foo-sidecar-proxy" does not exist"
2021-12-02T09:21:44.675-0800 [DEBUG] agent: added local registration for service: service=foo-sidecar-proxy
2021-12-02T09:21:44.675-0800 [DEBUG] agent: Cache options have not been modified
2021-12-02T09:21:44.675-0800 [DEBUG] agent.http: Request finished: method=PUT url=/v1/agent/reload from=127.0.0.1:63246 latency=3.806361ms
2021-12-02T09:21:44.675-0800 [DEBUG] agent: Node info in sync
2021-12-02T09:21:44.675-0800 [DEBUG] agent: Service in sync: service=foo
2021-12-02T09:21:44.675-0800 [DEBUG] agent: Service in sync: service=foo-sidecar-proxy
2021-12-02T09:21:44.675-0800 [DEBUG] agent: Check in sync: check=service:foo-sidecar-proxy:2
2021-12-02T09:21:44.675-0800 [DEBUG] agent: Check in sync: check=service:foo-sidecar-proxy:1
```

Specific log line:

```
2021-12-02T09:21:44.674-0800 [WARN] agent: Failed to deregister service: \
service=foo-sidecar-proxy error="Service "foo-sidecar-proxy" does not exist"
```

### Consul info for both Client and Server

I've reproduced on Consul 1.10.3 and 1.10.4.

Contributor guide

Open the contributing guide

Research direction

Reproduce the warning using the service.hcl example, then run the listed consul agent and consul reload commands. Trace the agent reload path that removes and re-adds the foo-sidecar-proxy service. Done means reloading no longer logs a failed deregistration warning while the proxy service and its checks remain synchronized.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend
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.