Skip to content

gh run view --job --log-failed fails on required shared-workflow metadata 404 #14822

Open

Description

@henrymodisett

Symptom

gh run view RUN --job JOB --log-failed fails before fetching logs for a completed organization-required workflow run:

failed to get run: HTTP 404: Not Found (https://api.github.com/repos/ORG/CONSUMER/actions/workflows/WORKFLOW_ID)

The same authenticated CLI can read the run metadata and download that job's logs directly. The workflow is required by an organization ruleset and originates in a shared workflow repository, rather than a workflow file in the consumer checkout.

Repro

  1. Configure a ruleset-required workflow from a shared repository and let its run complete for a consumer PR.
  2. Obtain the run/job IDs from the PR check URL.
  3. Run gh run view RUN --repo ORG/CONSUMER --job JOB --log-failed; it fails on the consumer repository's workflow metadata lookup above.
  4. With the same authentication, gh api repos/ORG/CONSUMER/actions/runs/RUN succeeds, and gh api --allow-escape-sequences repos/ORG/CONSUMER/actions/jobs/JOB/logs > job.log succeeds. In the observed case the latter retrieved 81,118 bytes. Escape sequences were captured to a file, not printed to the terminal.

The run metadata's workflow_id is the ID in the failing URL, and path is .github/workflows/review-gate.yml. Repository/run IDs are redacted because this reproduction originated in application development.

Expected

An explicit job-log request can read available job logs even when the optional workflow metadata lookup returns 404, or explains this workflow-source limitation without implying the run itself cannot be read.

Environment

  • gh version 2.103.1 (2026-10-23)
  • macOS 27.0
  • Observed 2026-10-26 while diagnosing a failed required review check.

I searched this tracker for required-workflow/run-view and workflow/not-found/log combinations before filing.

Activity

  1. cli-triage commented on Oct 26, 2026

    @cli-triage

    Thanks for the detailed repro. I traced this through the source and the cause looks clear: shared.GetRun (shared.go lines 559–592 at commit 4f2cfe9) always calls workflowShared.GetWorkflow(client, repo, result.WorkflowID) right after fetching the run, and returns any error from that call unmodified. For a run whose workflow originates from an organization/enterprise ruleset rather than the consumer repo's own workflow list, that lookup 404s, so GetRun fails before view.go's --log/--log-failed path ever reaches getRunLog/job-log fetching — even though the run and job metadata and logs are otherwise readable. This matches a known pattern already handled more leniently elsewhere: preloadWorkflowNames (shared.go lines ~487–505) explicitly catches a 404 from the same GetWorkflow call for run list and falls back to an empty workflow name instead of failing, but GetRun (used by run view) has no equivalent fallback. I'm suggesting bug, gh-run, and priority-3 (narrow case with a viable gh api workaround) for maintainer review. This is not a duplicate of #9228 (which is about run list/run view generally 404ing on ruleset workflows); this issue is specifically about --log-failed/--log failing even though job logs themselves are fetchable, so a first responder may want to consider making GetRun's workflow-name lookup tolerate a 404 the same way preloadWorkflowNames does.

    Generated by Issue Triage (skills-driven) for #14822 · copilot · auto · 79 AIC · ⊞ 4.5K · ◷

  2. henrymodisett commented on Oct 26, 2026

    @henrymodisett
    Author

    Additional reproduction on gh 2.103.1 (macOS), while diagnosing a required shared validate workflow for a merge-group candidate: gh run view RUN --log-failed also fails on the consumer repository's workflow-metadata endpoint with HTTP 404. The same authenticated gh api .../actions/jobs/JOB/logs --allow-escape-sequences successfully retrieved the job log to a file. This occurs for validation as well as the review-gate case above; no separate issue filed.

  3. henrymodisett commented on Oct 30, 2026

    @henrymodisett
    Author

    Additional reproduction on the same environment: gh run view RUN --repo ORG/CONSUMER --json jobs also fails at the shared required workflow metadata lookup with HTTP 404 while the run is in progress. With the same authentication, gh api repos/ORG/CONSUMER/actions/runs/RUN/jobs succeeds and returns current job states. This is therefore not limited to completed runs or log requests. No private repository/run identifiers are included here.

  4. added
    bug
    gh-run
    priority-3
    on Nov 2, 2026
  5. removed
    needs-triage
    on Nov 2, 2026
  6. henrymodisett commented on Nov 13, 2026

    @henrymodisett
    Author

    Reproduced on gh version 2.104.0 (2026-11-12) on macOS while reading a completed ruleset-required validation job on November 13. gh run view RUN --repo ORG/CONSUMER --job JOB --log-failed still fails at the consumer workflow-metadata endpoint with HTTP 404. The same authenticated gh api repos/ORG/CONSUMER/actions/jobs/JOB/logs --allow-escape-sequences > job.log succeeds; terminal sequences were captured to a file and stripped before inspection. This is the existing validation/log-fetch case on the newer release, not a separate issue. Private repository and run identifiers are omitted.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    buggh-runpriority-3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions