consul: no service named core-metadata getting this error on device service #218
-
Hi Team, But we are getting empty response when trying to get 'http://edge-consul:8500/v1/catalog/service/core-metadata' using same deployment configuration. we have added below environment:
and the service gets stuck on this log We use manual steps to get consul token from vault try getting results from 'http://edge-consul:8500/v1/catalog/service/core-metadata' then we are getting empty list in response. Below are steps:
Get the consul creds of device-service-usb-webcam from vault:
Try getting core-metadata details using consul token of device-service-usb-webcam:
And then we tried getting response from this API Get the consul creds from CONSUL_HTTP_TOKEN_FILE:
Try getting core-metadata details using consul token from CONSUL_HTTP_TOKEN_FILE:
Looks like service is not using token from CONSUL_HTTP_TOKEN_FILE and then it is not able to find service core-metadata. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
@ankit-4129 |
Beta Was this translation helpful? Give feedback.
-
The missing information is that in secure mode, EdgeX services get their consul token from Vault. How this works is that when Consul is initialized, it gets a management token that has permission to issue other tokens, and this token is configured into Vault as the consul secrets provider. The lifetime of the two are tied together, so that if a service allows its Vault token to expire, Vault also revokes the consul token as well. CONSUL_HTTP_TOKEN_FILE is used for the consul CLI and EdgeX does not use it, and your evidence seems to suggest that the consul libraries won't check to to override the token EdgeX is passing. Additionally, make sure you closely read I think already set ADD_SECRETSTORE_TOKENS, but you also need to make sure you are using ADD_REGISTRY_ACL_ROLES in order to create the consul role that the consul secrets engine to map to. Also a concern, possibly, is the service naming. Make sure your app services are named 'app-' and devices are named 'device-' as there are some hardcoded rules in some spots of EdgeX. 'edge-device-service-usb-webcam' is compliant with neither. |
Beta Was this translation helpful? Give feedback.
-
@ankit-4129 , version 2.2.0 is no longer supported. Please upgrade to using the recently release 3.1.0 (Napa) which is the currently supported release. |
Beta Was this translation helpful? Give feedback.
@ankit-4129 , version 2.2.0 is no longer supported. Please upgrade to using the recently release 3.1.0 (Napa) which is the currently supported release.