Skip to content

ui: fix error getting task logs when refreshing page#28137

Open
mismithhisler wants to merge 4 commits into
mainfrom
b-fix-task-log-error-on-refresh
Open

ui: fix error getting task logs when refreshing page#28137
mismithhisler wants to merge 4 commits into
mainfrom
b-fix-task-log-error-on-refresh

Conversation

@mismithhisler

@mismithhisler mismithhisler commented Jun 16, 2026

Copy link
Copy Markdown
Member

Description

#24973 removed the api request for the allocation's node as it was causing permission denied errors. However, it introduced issues with the computed property of the logUrl() method under certain circumstances. For example, when refreshing the page, the node.httpAddr is undefined and ember component never renders correctly.

This issue is fixed by reverting this change but also adding a the same guard around the API request that is used in the logUrl() method.

An alternative fix for this issue is to use the allocation.node instead of allocation.node.httpAddr as the computing property of logUrl().

Testing & Reproduction steps

As far back as 1.9.6, run a job, view the task logs, then refresh the page. See that it does not load the logs.

Links

Fixes: #27821
Potentially Fixes: #28112

Contributor Checklist

  • Changelog Entry If this PR changes user-facing behavior, please generate and add a
    changelog entry using the make cl command.
  • Testing Please add tests to cover any new functionality or to demonstrate bug fixes and
    ensure regressions will be caught.
  • Documentation If the change impacts user-facing functionality such as the CLI, API, UI,
    and job configuration, please update the Nomad product documentation, which is stored in the
    web-unified-docs repo. Refer to the web-unified-docs contributor guide for docs guidelines.
    Please also consider whether the change requires notes within the upgrade
    guide
    . If you would like help with the docs, tag the nomad-docs team in this PR.

Reviewer Checklist

  • Backport Labels Please add the correct backport labels as described by the internal
    backporting document.
  • Commit Type Ensure the correct merge method is selected which should be "squash and merge"
    in the majority of situations. The main exceptions are long-lived feature branches or merges where
    history should be preserved.
  • Enterprise PRs If this is an enterprise only PR, please add any required changelog entry
    within the public repository.
  • If a change needs to be reverted, we will roll out an update to the code within 7 days.

Changes to Security Controls

Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.

@mismithhisler mismithhisler requested review from jrasell and tehut June 16, 2026 20:57
@mismithhisler mismithhisler self-assigned this Jun 16, 2026
@mismithhisler mismithhisler requested review from a team as code owners June 16, 2026 20:57
@jrasell jrasell added backport/ent/1.10.x+ent backport to 1.10.x+ent release line backport/ent/1.11.x+ent backport to 1.11.x+ent release line backport/2.0.x backport to 2.0.x release line labels Jun 17, 2026

@navyadas-dev navyadas-dev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a regression test for the refresh case

@navyadas-dev navyadas-dev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add a guard for task as well here as it appears to nullable/undefined? Can we change it to this way

 if (task && this.abilities.can('read client')) {
      return task.get('allocation.node').then(() => task);
    }

@mismithhisler

Copy link
Copy Markdown
Member Author

@navyadas-dev can you advise on adding a regression test here? It appears all the task-log tests (tests/integration/components/task-log-test.js and tests/acceptance/task-logs-test.js) appear to be getting skipped.

@navyadas-dev

Copy link
Copy Markdown
Collaborator

@navyadas-dev can you advise on adding a regression test here? It appears all the task-log tests (tests/integration/components/task-log-test.js and tests/acceptance/task-logs-test.js) appear to be getting skipped.

Thanks for pointing that out. I didn't notice those tests were being skipped. Let's add the regression test once those test suites are enabled again.

@tehut tehut left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit: 🥳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/ent/1.10.x+ent backport to 1.10.x+ent release line backport/ent/1.11.x+ent backport to 1.11.x+ent release line backport/2.0.x backport to 2.0.x release line

Projects

None yet

4 participants