Open bigdatasourav opened 1 year ago
@bigdatasourav , thanks for reporting the issue. To help us reproduce the behavior, could you provide
Looking forward to your reply!
@huikang I am using the consul version - 1.15.2 Here is a sample API command -> curl -H "Authorization: Bearer token" "http://address/v1/catalog/service/nomad?tag=rpc&tag=serf&tag=http"
Hi @bigdatasourav,
We'd have to look into the tag
query parameter. In the meantime, can you try the equivalent using the filter
query parameter?
It should look something like:
curl --get -H "Authorization: Bearer token" http://address/v1/catalog/service/nomad --data-urlencode 'filter="rpc" in ServiceTags and "serf" in ServiceTags and "http" in ServiceTags'
For reference, this is the docs page on filtering: https://developer.hashicorp.com/consul/api-docs/features/filtering
Hey @jkirschner-hashicorp, I tried the method you suggested above, but unfortunately, it doesn't seem to be working with multiple tags. I was able to get it to work with a single tag in the filter using (http in ServiceTags).
@bigdatasourav , I couldn't reproduce the problem with the following steps.
v1.15.2
==> Starting Consul agent...
Version: '1.15.2'
Build Date: '2023-03-30 17:51:19 +0000 UTC'
Node ID: 'edabf396-b86c-bb42-78f9-6d1766f8825f'
Node name: 'server-1'
Register a service named, say counting
with 3 tags — "rpc", "serf", "http".
Query service without tag
curl --location --request GET '127.0.0.1:8500/v1/catalog/service/counting' | jq
"ServiceName": "counting",
"ServiceTags": [
"rpc",
"serf",
"http"
],
"ServiceAddress": "",
curl --location --request GET '127.0.0.1:8500/v1/catalog/service/counting?tag=serf&tag=rpc&tag=http' | jq .
"ServiceTags": [
"rpc",
"serf",
"http"
],
"ServiceAddress": "",
As you can see, the result is the same as query without any tag.
Please let me know if I miss anything your steps.
Overview of the Issue
The ServiceMultipleTags API is not rendering results if we pass services with multiple tags. Example -> Service name - nomad tags - [rpc serf http] when all tags are passed, the API is not rendering results, but if I pass a single tag, the API is working.
Reproduction Steps
Execute the API with any service which has multiple tags
Consul info for both Client and Server
Client info
``` Output from client 'consul info' command here ``` ``` Client agent HCL config ```Server info
``` Output from server 'consul info' command here ``` ``` Server agent HCL config ```Operating system and Environment details
Log Fragments