Skip to content

UI: service detail page fails to render #27980

@tgross

Description

@tgross

The service detail page in the UI is failing to render, and the service list tab of the job detail page is throwing errors in the console. To reproduce, run the following job using Nomad 2.0.2-dev with the #27958 patch:

job "example" {

  group "group" {

    network {
      mode = "bridge"
      port "www" {
        to = 8001
      }
    }

    service {
      name     = "httpd-web"
      provider = "nomad"
      port     = "www"
    }

    task "task" {

      driver = "docker"
      user   = "www-data"

      config {
        image   = "busybox:1"
        command = "httpd"
        args    = ["-vv", "-f", "-p", "8001", "-h", "/local"]
        ports   = ["www"]
      }

      resources {
        cpu    = 100
        memory = 100
      }

    }
  }
}

We can see from the CLI that the service has been registered:

$ nomad service list
Service Name  Tags
httpd-web     []

$ nomad service info httpd-web
Job ID   Address              Tags  Node ID   Alloc ID
example  192.168.1.194:20308  []    71d5d628  cde64e8d

If I go to this page: http://localhost:4200/ui/jobs/example@default/services the console shows this error:

ember.js:308 Uncaught (in promise) Error: Assertion Failed: Cannot create a record for service:_nomad-task-cde64e8d-7120-ca28-f2e3-a3843533125b-group-group-httpd-web-www (@lid:service-_nomad-task-cde64e8d-7120-ca28-f2e3-a3843533125b-group-group-httpd-web-www) as no resource data exists
    at assert (ember.js:308:1)
    at InstanceCache.getRecord (index-cc461d33.js:3032:1)
    at Object.get (index-cc461d33.js:4044:1)
    at Proxy.filter (<anonymous>)
    at Proxy.fn (index-cc461d33.js:4066:1)
    at PromiseManyArray.proxiedMethod [as filter] (has-many-d45aa09e.js:1501:1)
    at index.js:54:1
    at Array.map (<anonymous>)
    at get services (index.js:53:1)
    at ember.js:2701:1

Clicking thru to the service detail page fails to render entirely. At this point, I can also see we're repeatedly making requests to the server like:

GET /v1/job/example/services?index=1 200 1.455 ms - 259
GET /v1/job/example?index=1 200 0.987 ms - 1790

And the console repeatedly throws warnings like:

Error occurred:

- While rendering:
  {{outlet}} for -top-level
    -top-level
      {{outlet}} for application
        application
          {{outlet}} for jobs
            jobs
              page-layout
                gutter-menu
                  {{outlet}} for jobs.job
                    jobs.job
                      {{outlet}} for jobs.job.services
                        jobs.job.services
                          {{outlet}} for jobs.job.services.index
                            jobs.job.services.index

Internal ref https://hashicorp.atlassian.net/browse/NMD-1473

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions