Skip to content

v2.75 fails downloading logs from workflows with skipped jobs #11311

Description

Describe the bug

Recently, the github hosted runners were upgraded to use gh cli 2.75. Since then, one workflow of ours started failing. This workflow is downloading logs from other workflow runs. It seems like in previous versions, it did not attempt to download logs from skipped jobs (since they are unavailable).
This now apparently changed and makes the cli fail in this case.

Affected version

2.75

Steps to reproduce the behavior

  1. Note that the workflow run id of a workflow run that has skipped jobs
  2. run gh cli run view --log <ID>

Expected vs actual behavior

Expected:
Download all logs, ignore skipped jobs

Actual:
Fails on the first skipped job with

log not found: <SKIPPED JOB ID>

Logs

Paste the activity from your command line. Redact if needed.

Activity

  1. williammartin commented on Jul 16, 2025

    @williammartin
    Member

    @babakks probably related to #11172

  2. babakks commented on Jul 16, 2025

    @babakks
    Member

    Yeah, there's another report in a comment. Seems like we're not checking for the skipped job. Before the last changes, if a job wasn't in the ZIP archive we'd just skip over, but now the API call fails. I'm going to look into this.

  3. babakks commented on Jul 16, 2025

    @babakks
    Member

    Yeah, I can confirm the problem and that's what I mentioned in the above comment.

    As expected, API responds with HTTP 404 when the job has been skipped:

    {
      "message": "Not Found",
      "documentation_url": "https://docs.github.com/rest/actions/workflow-jobs#download-job-logs-for-a-workflow-run",
      "status": "404"
    }

    So, now we have two options to fix this; either check the job Conclusion and if it's skipped, just drop it from the log segments, or exclude HTTP 404 from error cases. I don't like the latter since it's just burying potential API problems.

    I can put down the A/C for this, but first I'm want to hear what do you think, @williammartin?

  4. williammartin commented on Jul 16, 2025

    @williammartin
    Member

    Think we should try to avoid fetching skipped logs at all, in whatever way we choose to implement that.

  5. babakks commented on Jul 16, 2025

    @babakks
    Member

    Agreed. That's the first approach then. That way we just drop the skipped job at the top of the loop we don't even try finding the log in the ZIP archive, let alone an API call.

  6. babakks commented on Jul 16, 2025

    @babakks
    Member

    Acceptance Criteria

    1. An entire run log, with skipped job(s)

    Given I have a run with one or more skipped jobs
    When I run gh run view --log <RUN-ID>
    Then The available job logs are displayed without error

    2. A single job that is skipped

    Given I have a run with one or more skipped jobs
    When I run gh run view --log --job <JOB-ID>
    Then An empty log trail is displayed without error

  7. added
    coreThis issue is not accepting PRs from outside contributors
    on Jul 16, 2025
  8. linked a pull request that will close this issueAvoid fetching logs for skipped jobs #11312on Jul 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcoreThis issue is not accepting PRs from outside contributorsgh-runrelating to the gh run command

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions