You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description of the Issue (and unexpected/desired result)
Consul watch does not trigger when acl_default_policy is set to deny, even with a master token or with every ACL set to write. I could work around that problem by setting acl_default_policy to allow, but I would prefer to set the proper ACL policy to get it to work.
Reproduction steps
consul watch -type=keyprefix -prefix="services/restart/" echo reload
consul kv put services/restart/test hi
Log Fragments
Server log for consul watch :
Aug 11 12:31:03 admin-10-72-152-206 consul[17113]: 2017/08/11 12:31:03 [DEBUG] http: Request GET /v1/agent/self (693.758µs) from=10.72.140.144:49230
Aug 11 12:31:03 admin-10-72-152-206 consul[17113]: 2017/08/11 12:31:03 [DEBUG] http: Request GET /v1/kv/services/restart/?recurse= (94.493µs) from=10.72.140.144:49231
Aug 11 12:31:31 admin-10-72-152-206 consul[17113]: 2017/08/11 12:31:31 [DEBUG] http: Request GET /v1/kv/services/restart/?recurse=&stale= (97.595µs) from=10.72.154.45:10530
Server log when consul kv put is executed :
Aug 11 12:32:13 admin-10-72-152-206 consul[17113]: 2017/08/11 12:32:13 [DEBUG] http: Request GET /v1/kv/services/restart/?index=121&recurse= (1m9.162114879s) from=10.72.140.144:49231
Aug 11 12:32:13 admin-10-72-152-206 consul[17113]: 2017/08/11 12:32:13 [DEBUG] http: Request GET /v1/kv/services/restart/?index=121&recurse=&stale= (41.121869994s) from=10.72.154.45:10530
Aug 11 12:32:13 admin-10-72-152-206 consul[17113]: 2017/08/11 12:32:13 [DEBUG] http: Request GET /v1/kv/services/restart/?index=121&recurse= (1m21.367793019s) from=10.72.140.144:49227
Aug 11 12:32:13 admin-10-72-152-206 consul[17113]: 2017/08/11 12:32:13 [DEBUG] http: Request GET /v1/kv/services/restart/?index=121&recurse=&stale= (5.985543051s) from=10.72.154.45:10570
Aug 11 12:32:13 admin-10-72-152-206 consul[17113]: 2017/08/11 12:32:13 [DEBUG] http: Request GET /v1/kv/services/restart/?index=121&recurse=&stale= (1m15.481924391s) from=10.72.154.45:10500
Aug 11 12:32:13 admin-10-72-152-206 consul[17113]: 2017/08/11 12:32:13 [DEBUG] http: Request PUT /v1/kv/services/restart/my-sample-service/dev/my-sample-service-stable (5.636545ms) from=10.72.154.45:10580
The text was updated successfully, but these errors were encountered:
@nanoz Thanks for reporting this. This behavior seems to only affect happen with watches done via consul watch. We will look into fixing it in an upcoming release.
As a work around, you could define the same watch inside the agent's config file. I was able to do that with your example above and saw it invoke the watch handler every time the key changed. Example config:
I tried to reproduce the problem with consul watch for this bug report, but I actually have the problem on Nomad's template stanza, which subscribes to keys using consul-template internally. So I can't really use this workaround :)
consul version
Client: v0.9.0
Server: v0.9.0
consul info
Client:
Server:
Operating system and Environment details
Server runs on Debian Jessie, client is on mac with CONSUL_HTTP_ADDR and CONSUL_HTTP_TOKEN correctly set. Here is the ACL configuration :
Description of the Issue (and unexpected/desired result)
Consul watch does not trigger when acl_default_policy is set to deny, even with a master token or with every ACL set to write. I could work around that problem by setting acl_default_policy to allow, but I would prefer to set the proper ACL policy to get it to work.
Reproduction steps
Log Fragments
Server log for
consul watch
:Server log when
consul kv put
is executed :The text was updated successfully, but these errors were encountered: