Consul is a distributed, highly available, and data center aware solution to connect and configure applications across dynamic, distributed infrastructure. https://www.consul.io
Go to file
Aestek 5960974db1 [Fix] Services sometimes not being synced with acl_enforce_version_8 = false (#4771)
Fixes: https://github.com/hashicorp/consul/issues/3676

This fixes a bug were registering an agent with a non-existent ACL token can prevent other 
services registered with a good token from being synced to the server when using 
`acl_enforce_version_8 = false`.

## Background

When `acl_enforce_version_8` is off the agent does not check the ACL token validity before 
storing the service in its state.
When syncing a service registered with a missing ACL token we fall into the default error 
handling case (https://github.com/hashicorp/consul/blob/master/agent/local/state.go#L1255)
and stop the sync (https://github.com/hashicorp/consul/blob/master/agent/local/state.go#L1082)
without setting its Synced property to true like in the permission denied case.
This means that the sync will always stop at the faulty service(s).
The order in which the services are synced is random since we iterate on a map. So eventually
all services with good ACL tokens will be synced, this can however take some time and is influenced 
by the cluster size, the bigger the slower because retries are less frequent.
Having a service in this state also prevent all further sync of checks as they are done after
the services.

## Changes 

This change modify the sync process to continue even if there is an error. 
This fixes the issue described above as well as making the sync more error tolerant: if the server repeatedly refuses
a service (the ACL token could have been deleted by the time the service is synced, the servers 
were upgraded to a newer version that has more strict checks on the service definition...). 
Then all services and check that can be synced will, and those that don't will be marked as errors in 
the logs instead of blocking the whole process.
2019-01-04 10:01:50 -05:00
.circleci add circleci website build 2018-11-16 17:05:19 -05:00
.github add codeowners for consul docs 2019-01-03 15:01:16 -05:00
acl New ACLs (#4791) 2018-10-19 12:04:07 -04:00
agent [Fix] Services sometimes not being synced with acl_enforce_version_8 = false (#4771) 2019-01-04 10:01:50 -05:00
api [Travis][UnstableTests] Fixed unstable tests in travis (#5013) 2018-12-12 12:09:42 -08:00
bench Gets benchmarks running again and does a rough pass for 0.7.1. 2016-11-29 13:02:26 -08:00
build-support Dont expect the freebsd/arm build 2018-10-19 14:50:51 -04:00
command Fixed gziping function for debug archive (#5184) 2019-01-03 10:39:58 -05:00
connect connect: remove additional trust-domain validation (#4934) 2018-11-12 20:20:12 +00:00
demo demo: Added udp port forwarding 2018-05-30 13:56:56 +09:00
ipaddr New config parser, HCL support, multiple bind addrs (#3480) 2017-09-25 11:40:42 -07:00
lib New ACLs (#4791) 2018-10-19 12:04:07 -04:00
logger Connect Envoy Command (#4735) 2018-10-10 16:55:34 +01:00
sentinel Renames stubs to be more consistent. 2017-11-29 18:36:52 -08:00
service_os Changes made : 2018-06-28 21:18:14 -04:00
snapshot Removes timeout when restoring snapshots. 2017-12-13 14:10:54 -08:00
terraform terraform: fix formatting of consul.tf (#4580) 2018-10-24 08:02:38 -07:00
test Update test certificates that expire this year to be way in the future 2018-05-12 10:15:45 +01:00
testrpc Bugfix: Use "%#v" when formatting structs (#4600) 2018-08-28 12:37:34 -04:00
testutil testutil: If testing.T is nil panic with error (#4725) 2018-10-26 12:13:40 -07:00
tlsutil agent: honor when ca is set but verify_outgoing is disabled (#4826) 2018-12-17 09:56:18 -08:00
types Removes remoteConsuls in favor of the new router. 2017-03-16 16:42:19 -07:00
ui update ffi to dodge CVE-2018-1000201 (#4670) 2018-09-14 11:22:48 +02:00
ui-v2 ui: serve /robots.txt when UI is enabled. (#5089) 2018-12-17 19:35:03 +01:00
vendor vendor: upgrade to latest version of gopsutil 2018-10-19 11:33:23 -07:00
version Put the tree in v1.4.1 dev mode 2018-11-14 16:56:48 -08:00
watch Add -sidecar-for and new /agent/service/:service_id endpoint (#4691) 2018-10-10 16:55:34 +01:00
website website: Use secret id instead of policy id (#5049) 2019-01-03 10:45:01 -05:00
.dockerignore Update the scripting 2018-06-14 21:42:47 -04:00
.gitignore merge feedback: fix typos; actually use deliverLatest added previously but not plumbed in 2018-10-10 16:55:34 +01:00
.travis.yml Bump Go version for CI and build to 1.11.1 (#4782) 2018-10-11 12:21:53 +01:00
CHANGELOG.md Update CHANGELOG.md 2019-01-03 10:41:33 -05:00
GNUmakefile Single quote a directory (#4846) 2018-10-24 09:48:19 -04:00
INTERNALS.md docs: correct link to top level agent package (#4750) 2018-10-04 09:15:55 -05:00
LICENSE Initial commit 2013-11-04 14:15:27 -08:00
NOTICE.md add copyright notice file 2018-07-09 10:58:26 -07:00
README.md Contribution guide (#4704) 2018-10-05 09:06:40 -07:00
Vagrantfile Adds a basic Linux Vagrant setup, stolen from Nomad. 2017-10-06 08:10:12 -07:00
main.go Added Side Effect import for Windows Service 2018-06-18 14:55:11 -04:00
main_test.go Adding basic CLI infrastructure 2013-12-19 11:22:08 -08:00

README.md

Consul Build Status Join the chat at https://gitter.im/hashicorp-consul/Lobby

Consul is a tool for service discovery and configuration. Consul is distributed, highly available, and extremely scalable.

Consul provides several key features:

  • Service Discovery - Consul makes it simple for services to register themselves and to discover other services via a DNS or HTTP interface. External services such as SaaS providers can be registered as well.

  • Health Checking - Health Checking enables Consul to quickly alert operators about any issues in a cluster. The integration with service discovery prevents routing traffic to unhealthy hosts and enables service level circuit breakers.

  • Key/Value Storage - A flexible key/value store enables storing dynamic configuration, feature flagging, coordination, leader election and more. The simple HTTP API makes it easy to use anywhere.

  • Multi-Datacenter - Consul is built to be datacenter aware, and can support any number of regions without complex configuration.

  • Service Segmentation - Consul Connect enables secure service-to-service communication with automatic TLS encryption and identity-based authorization.

Consul runs on Linux, Mac OS X, FreeBSD, Solaris, and Windows. A commercial version called Consul Enterprise is also available.

Please note: We take Consul's security and our users' trust very seriously. If you believe you have found a security issue in Consul, please responsibly disclose by contacting us at security@hashicorp.com.

Quick Start

An extensive quick start is viewable on the Consul website:

https://www.consul.io/intro/getting-started/install.html

Documentation

Full, comprehensive documentation is viewable on the Consul website:

https://www.consul.io/docs

Contributing

Thank you for your interest in contributing! Please refer to CONTRIBUTING.md for guidance.