Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli: service info command returns incorrect services in output #19542

Open
jrasell opened this issue Dec 20, 2023 · 7 comments
Open

cli: service info command returns incorrect services in output #19542

jrasell opened this issue Dec 20, 2023 · 7 comments
Labels
stage/accepted Confirmed, and intend to work on. No timeline committment though. theme/cli theme/service-discovery/nomad theme/service-discovery type/bug

Comments

@jrasell
Copy link
Member

jrasell commented Dec 20, 2023

Nomad version

$ nomad version
Nomad v1.7.3-dev
BuildDate 2023-12-19T11:17:48Z
Revision b2f640346d7609057ab55a0037c23ad5f5edfb68

Issue

The service info command returns incorrect results when attempting to perform a simple service lookup within a particular namespace.

The list output correctly lists two services registered:

$ nomad service list
Service Name       Tags
grafana-server     []
prometheus-server  []

When I go to lookup the grafana-server service I get the following result:

$ nomad service info grafana-server
Job ID             Address               Tags  Node ID   Alloc ID
prometheus-server  192.168.108.13:24057  []    fc18ed18  04499ded

The API is returning the correct data, so this is a problem with the command.

$ nomad operator api /v1/service/grafana-server | jq
[
  {
    "Address": "192.168.108.13",
    "AllocID": "8fe15d39-cd9d-cbdb-ca31-d795b4f4ca78",
    "CreateIndex": 188,
    "Datacenter": "kent",
    "ID": "_nomad-task-8fe15d39-cd9d-cbdb-ca31-d795b4f4ca78-group-server-grafana-server-grafana",
    "JobID": "grafana-server",
    "ModifyIndex": 188,
    "Namespace": "default",
    "NodeID": "fc18ed18-d4ef-115c-17f5-43e4e48c37a8",
    "Port": 22138,
    "ServiceName": "grafana-server",
    "Tags": []
  }
]

It seems the bug was introduced within #18836

@jrasell jrasell added type/bug theme/cli stage/accepted Confirmed, and intend to work on. No timeline committment though. theme/service-discovery theme/service-discovery/nomad labels Dec 20, 2023
@jrasell jrasell self-assigned this Dec 20, 2023
@blmhemu
Copy link

blmhemu commented Dec 20, 2023

I can see this in 1.7.2 as well. The nomad templates are also quite messed up similar to #16616

@jrasell
Copy link
Member Author

jrasell commented Jan 2, 2024

Hi @blmhemu; as far as this stated issue goes, it only affects the CLI and the linked issue is a separate, non-related bug.

@blmhemu
Copy link

blmhemu commented Jan 2, 2024

I understand, but i could not repro #16616 on 1.6, only on 1.7.(2) (Let me know if I should raise another issue)

Also, I assumed templates use the data published by the API and if the API provides wrong info, may be the templates are rendedered with wrong info.

@Pondidum
Copy link

Seeing this with the 1.7.5 CLI too:

Nomad v1.7.5
BuildDate 2024-02-13T15:10:13Z
Revision 5f5d4646198d09b8f4f6cb90fb5d50b53fa328b8
> nomad service list
Service Name    Tags
caddy           [ingress]
noutaja         []
otel-collector  [otel]
> nomad service info otel-collector
Job ID  Address            Tags       Node ID   Alloc ID
caddy   192.168.1.128:443  [ingress]  06289a2e  c7c2a24f
> nomad service info otel-collector
Job ID   Address             Tags  Node ID   Alloc ID
noutaja  192.168.1.128:5959  []    06289a2e  8b8d5f7b

@geekodour
Copy link

Still relevant^, had me wondering where did I go wrong. @jrasell are you working on this? otherwise I think I can pick this up?

@msherman13
Copy link

+1 on this, it's a bad issue that seems to have been included in one of the recent releases. breaks our workflow...

@dpogorzelski
Copy link

Still present in 1.8.1, just ran into this

@jrasell jrasell removed their assignment Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage/accepted Confirmed, and intend to work on. No timeline committment though. theme/cli theme/service-discovery/nomad theme/service-discovery type/bug
Projects
Status: Needs Roadmapping
Development

No branches or pull requests

6 participants