hashicorp / hashicorp/nomad

UI: child jobs for the wrong parent shown in "job launches" table

Open
#23,604 5 comments 1 reaction 0 assignees View on GitHub
hcc/jira theme/ui type/bug
Dominant language
Go
Stars
17k
Forks
2.1k
Avg merge
1d 9h
Merged PRs (30d)
105

Description

### Nomad version
```
Nomad v1.8.0
BuildDate 2024-05-28T17:38:17Z
Revision 28b82e4b2259fae5a62e2ed47395334bea5a24c4
```

### Operating system and Environment details
```
Linux ip-172-31-6-94 6.8.0-1010-aws #10-Ubuntu SMP Thu Jun 13 17:36:15 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
```

### Issue
![image](https://github.com/user-attachments/assets/5bde31a4-d345-4832-a450-539addc552e6)
![image](https://github.com/user-attachments/assets/88fdd808-bb7d-4e27-9e5c-54553de286a9)

If I launch one job then it displays good:
![image](https://github.com/user-attachments/assets/8df6c615-191f-4652-a3a4-c8fc7b8b2c27)

### Reproduction steps
1. Nomad plan/run backup job
2. Nomad plan/run reindex job
3. Open WebUI, Click reindex job

#### Expected Result
Because the reindex job is new there should be no logs about launches

#### Actual Result
Nomad WebUI displays info from different job

### Job file

```
job "postgres-backup" {
region = "XX"
datacenters = ["XX"]
type = "batch"

# Backup a database every 4 hours
periodic {
enabled = true
crons = [ "* * */7 * * * *" ]
time_zone = "America/Toronto"
prohibit_overlap = true
}

group "db-backup" {
task "postgres-backup-task" {
driver = "raw_exec"

config {
command = "/bin/bash"
args = ["local/script.sh"]
}

template {
destination = "local/script.sh"
data = <<-EOH
set -ex
.......
EOH
}
}
}
}

```

Reindex
```
job "postgres-reindex" {
region = "XX"
datacenters = ["XX"]
type = "batch"

periodic {
enabled = true
crons = [ "* * 10 * * *" ]
time_zone = "America/Toronto"
prohibit_overlap = true
}

group "db-backup" {
task "postgres-reindex-task" {
driver = "raw_exec"

config {
command = "/bin/bash"
args = ["local/script.sh"]
}

template {
destination = "local/script.sh"
data = <<-EOH
set -ex
....
EOH
}
}
}
}

```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the issue in the Nomad WebUI: run the postgres-backup job, then postgres-reindex, and open the reindex job's job launches table. Trace how the table selects child jobs and compare the displayed data with the expected empty state. Done means a newly launched job no longer shows launches belonging to a different job, with a regression test covering the sequence.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.