Repository navigation
gh run view (--log||--log-failed) no longer produces logs? #10551
Description
Activity
- changed the title
[-]gh run view (--log || -failed) no longer produces logs?[/-][+]gh run view (--log||--log-failed) no longer produces logs?[/+]on Mar 6, 2025 Would be helpful if you could update the description according to the bug report template:
https://github.com/cli/cli/issues/new?template=bug_report.mdThe usage of
GH_DEBUGis mentioned in the note at the end of the template to generate the debug info.- Thanks a lot for the feedback! So the command-line I use is: ``` GH_DEBUG=true gh run view --log-failed -R shindere/stdcompat 13677151402 ``` which spendssome time but finally shows nothing at all instead of the expected logs for failed jobs. The gh logs are: ``` * Request at 2025-03-06 19:10:00.159927738 +0100 CET m=+0.091609212 * Request to https://api.github.com/repos/shindere/stdcompat/actions/runs/13677151402?exclude_pull_requests=true * Request took 346.44351ms * Request at 2025-03-06 19:10:00.512362245 +0100 CET m=+0.444043782 * Request to https://api.github.com/repos/shindere/stdcompat/actions/workflows/144784623 * Request took 170.73035ms * Request at 2025-03-06 19:10:00.683908615 +0100 CET m=+0.615590164 * Request to https://api.github.com/repos/shindere/stdcompat/actions/runs/13677151402/jobs?per_page=100 * Request took 3.476002413s ``` Is it worth a run with `GH_DEBUG=api`?
See #10551 (comment) for the update.
Disregard this part containing the preliminary investigation:
Details
Just looked at your failing workflows:
https://github.com/shindere/stdcompat/actions/workflows/ci.ymlThe workflow run
13677151402is for a pull request andgh run viewcommand doesn't support that at the moment.
You can observe the same from theGH_DEBUG=truelogs i.e.exclude_pull_requests=true:* Request to https://api.github.com/repos/shindere/stdcompat/actions/runs/13677151402?exclude_pull_requests=trueI checked the code and the handling of pull requests is not there even when
exclude_pull_requests=false(or omitted which meansfalseby default according to its API Get a workflow run).You should be able to see the logs for other non-PR runs e.g.:
which is a direct commit (
push) to the default branch.Workflow run: https://github.com/shindere/stdcompat/actions/runs/13393034352
Run ID: 13393034352$ gh run view --log-failed -R shindere/stdcompat 13393034352 build-ubuntu-old-ocamls (make, 3.07) Set up job 2025-02-18T14:42:25.6578622Z Current runner version: '2.322.0' build-ubuntu-old-ocamls (make, 3.07) Set up job 2025-02-18T14:42:25.6609497Z ##[group]Operating System build-ubuntu-old-ocamls (make, 3.07) Set up job 2025-02-18T14:42:25.6610284Z Ubuntu build-ubuntu-old-ocamls (make, 3.07) Set up job 2025-02-18T14:42:25.6610877Z 24.04.1 build-ubuntu-old-ocamls (make, 3.07) Set up job 2025-02-18T14:42:25.6611425Z LTS build-ubuntu-old-ocamls (make, 3.07) Set up job 2025-02-18T14:42:25.6611911Z ##[endgroup] build-ubuntu-old-ocamls (make, 3.07) Set up job 2025-02-18T14:42:25.6612521Z ##[group]Runner Image build-ubuntu-old-ocamls (make, 3.07) Set up job 2025-02-18T14:42:25.6613112Z Image: ubuntu-24.04 build-ubuntu-old-ocamls (make, 3.07) Set up job 2025-02-18T14:42:25.6613809Z Version: 20250209.1.0 ...
So, it's a feature request, not a bug.
Let's see what the maintainers decide after triage. 🤞- Many thanks for the clue. I indeed so the parameter saying to exclude PRs, but it actually did work in the past, perhaps because, without noticing, I used runs that were associated to a direct push. Is there a way when I get a failure notice to determine whether it's associated to a PR or not? I am a bit confused about why ti even does make a difference whether a run is triggered by a PR or not, when it comes to looking at its logs? In any case, a bunch of thanks for having figured that out!
@shindere @iamazeem Thank you for the investigation everyone 🙏
I haven't finished digging into this yet, but I think something else may be going on because the command still fails even when
exclude_pull_requestsis removed from the request parameters.❯ GH_DEBUG=true ./bin/gh run view --log-failed -R shindere/stdcompat 13677151402 ⣾* Request at 2025-03-07 10:39:08.946284 -0700 MST m=+0.085645709 * Request to https://api.github.com/repos/shindere/stdcompat/actions/runs/13677151402 ⢿* Request took 360.202792ms * Request at 2025-03-07 10:39:09.355176 -0700 MST m=+0.494534209 * Request to https://api.github.com/repos/shindere/stdcompat/actions/workflows/144784623 ⡿* Request took 143.70425ms ⣾* Request at 2025-03-07 10:39:09.555462 -0700 MST m=+0.694818876 * Request to https://api.github.com/repos/shindere/stdcompat/actions/runs/13677151402/jobs?per_page=100 ⣽* Request took 3.008319708sI also noticed the command completes successfully when the
--log-failedoption is removed, even with theexclude_pull_requestsparameter is present.@shindere Does the command complete successfully with other PRs? Do you happen to have an example PR which the command completes successfully?
- addedmore-info-neededMore info needed from user/contributorMore info needed from user/contributor
on Mar 7, 2025 @BagToad:
The issues seems to be related to--logand--log-failedflags only.
Without these, the command runs fine for PR workflows as well.
The logs are downloaded once and cached locally as ZIP i.e.~/.cache/gh/run-log-<RUN_ID>-<TIMESTAMP>.zip.
Still looking into it to pinpoint the root cause.May be related to
attachRunLogand/ordisplayRunLoghere:Lines 304 to 324 in fc19ff3
if opts.Log || opts.LogFailed { if selectedJob != nil && selectedJob.Status != shared.Completed { return fmt.Errorf("job %d is still in progress; logs will be available when it is complete", selectedJob.ID) } if run.Status != shared.Completed { return fmt.Errorf("run %d is still in progress; logs will be available when it is complete", run.ID) } opts.IO.StartProgressIndicator() runLogZip, err := getRunLog(opts.RunLogCache, httpClient, repo, run, attempt) opts.IO.StopProgressIndicator() if err != nil { return fmt.Errorf("failed to get run log: %w", err) } defer runLogZip.Close() attachRunLog(&runLogZip.Reader, jobs) return displayRunLog(opts.IO.Out, jobs, opts.LogFailed) } - Azeem Sajid (2025/03/07 09:51 -0800):iamazeem left a comment (cli/cli#10551) The issues seems related to `--log` and `--log-failed` flags only. Without these, the command runs fine for PR workflows as well. The logs are downloaded once and cached locally as ZIP i.e. `~/.cache/gh/run-log-<RUN_ID>-<TIMESTAMP>.zip`.On this topic, and if I may: is the internal structure of the zip files one obtains documented somewhere? I am asking because I thought each job would be associated to a directory and each step of this job would be stored in a file in the job's directory, whihc would then mean no files should be at the root level of the archive. But, this is not what I observe and so far I couldn't figure out a rational regarding the way the archive is structured.
@shindere: It's documented here as a comment above
attachRunLog:Lines 621 to 649 in fc19ff3
// This function takes a zip file of logs and a list of jobs. // Structure of zip file // // zip/ // ├── jobname1/ // │ ├── 1_stepname.txt // │ ├── 2_anotherstepname.txt // │ ├── 3_stepstepname.txt // │ └── 4_laststepname.txt // └── jobname2/ // ├── 1_stepname.txt // └── 2_somestepname.txt // // It iterates through the list of jobs and tries to find the matching // log in the zip file. If the matching log is found it is attached // to the job. func attachRunLog(rlz *zip.Reader, jobs []shared.Job) { for i, job := range jobs { for j, step := range job.Steps { re := logFilenameRegexp(job, step) for _, file := range rlz.File { if re.MatchString(file.Name) { jobs[i].Steps[j].Log = file break } } } } } But, as you've observed, it different from the actual ZIP.
The cached ZIP has all the files on the root (except one directory):$ unzip -l run-log-13677151402-1741181422 Archive: run-log-13677151402-1741181422.zip Length Date Time Name --------- ---------- ----- ---- 1870 1980-00-00 00:00 0_build-ubuntu-old-ocamls (make-no-magic, 3.12.1).txt 1870 1980-00-00 00:00 1_build-ubuntu-old-ocamls (make, 3.08.4).txt 1870 1980-00-00 00:00 2_build-ubuntu-old-ocamls (make, 4.00.1).txt 1870 1980-00-00 00:00 3_build-ubuntu-old-ocamls (make, 3.09.3).txt 1870 1980-00-00 00:00 4_build-ubuntu-old-ocamls (make-no-magic, 4.00.1).txt 1870 1980-00-00 00:00 5_build-ubuntu-old-ocamls (make-no-magic, 3.08.4).txt 1870 1980-00-00 00:00 6_build-ubuntu-old-ocamls (make-no-magic, 3.10.2).txt 1870 1980-00-00 00:00 7_build-ubuntu-old-ocamls (make, 4.01.0).txt 1870 1980-00-00 00:00 8_build-ubuntu-old-ocamls (make-no-magic, 3.07).txt 1870 1980-00-00 00:00 9_build-ubuntu-old-ocamls (make-no-magic, 3.11.2).txt 70596 1980-00-00 00:00 10_build-ubuntu (dune, 4.08.x).txt 99872 1980-00-00 00:00 11_build-macos-and-windows (macos-latest, make, 5.0.0).txt 50453 1980-00-00 00:00 12_build-macos-and-windows (windows-latest, dune, 4.02.x).txt 76064 1980-00-00 00:00 13_build-ubuntu (dune, 4.02.x).txt 1870 1980-00-00 00:00 14_build-ubuntu-old-ocamls (make, 3.12.1).txt 1870 1980-00-00 00:00 15_build-ubuntu-old-ocamls (make, 3.07).txt 1870 1980-00-00 00:00 16_build-ubuntu-old-ocamls (make-no-magic, 3.09.3).txt 45798 1980-00-00 00:00 17_build-macos-and-windows (macos-latest, make-no-magic, 4.02.x).txt 128295 1980-00-00 00:00 18_build-macos-and-windows (windows-latest, make-no-magic, 4.14.x).txt 45789 1980-00-00 00:00 19_build-macos-and-windows (macos-latest, dune, 4.02.x).txt 1870 1980-00-00 00:00 20_build-ubuntu-old-ocamls (make, 3.11.2).txt 99887 1980-00-00 00:00 21_build-macos-and-windows (macos-latest, make-no-magic, 5.0.0).txt 128654 1980-00-00 00:00 22_build-macos-and-windows (windows-latest, make-no-magic, 5.2.0).txt 128341 1980-00-00 00:00 23_build-macos-and-windows (windows-latest, make-no-magic, 5.1.1).txt 128198 1980-00-00 00:00 24_build-macos-and-windows (windows-latest, make, 4.14.x).txt 69959 1980-00-00 00:00 25_build-macos-and-windows (windows-latest, dune, 5.2.0).txt 124492 1980-00-00 00:00 26_build-macos-and-windows (macos-latest, make, 5.1.1).txt 126631 1980-00-00 00:00 27_build-ubuntu (make, 5.1.1).txt 50453 1980-00-00 00:00 28_build-macos-and-windows (windows-latest, make, 4.02.x).txt 102424 1980-00-00 00:00 29_build-ubuntu (make, 4.09.x).txt 70410 1980-00-00 00:00 30_build-macos-and-windows (windows-latest, dune, 4.14.x).txt 96956 1980-00-00 00:00 31_build-ubuntu (make, 4.03.x).txt 124802 1980-00-00 00:00 32_build-macos-and-windows (macos-latest, make, 4.14.x).txt 103788 1980-00-00 00:00 33_build-macos-and-windows (windows-latest, make-no-magic, 5.0.0).txt 128647 1980-00-00 00:00 34_build-macos-and-windows (windows-latest, make, 5.1.1).txt 47960 1980-00-00 00:00 35_build-macos-and-windows (windows-latest, make-no-magic, ocaml-variants.4.14.0+mingw64c).txt 97492 1980-00-00 00:00 36_build-ubuntu (make, 4.07.x).txt 1870 1980-00-00 00:00 37_build-ubuntu-old-ocamls (make-no-magic, 4.01.0).txt 76143 1980-00-00 00:00 38_build-ubuntu (dune, 4.03.x).txt 97653 1980-00-00 00:00 39_build-ubuntu (make, 4.04.x).txt 76376 1980-00-00 00:00 40_build-ubuntu (dune, 4.06.x).txt 66450 1980-00-00 00:00 41_build-macos-and-windows (macos-latest, dune, 4.14.x).txt 124492 1980-00-00 00:00 42_build-macos-and-windows (macos-latest, make, 5.2.0).txt 76898 1980-00-00 00:00 43_build-ubuntu (dune, 4.04.x).txt 71527 1980-00-00 00:00 44_build-macos-and-windows (windows-latest, dune, 5.0.0).txt 96924 1980-00-00 00:00 45_build-ubuntu (make-no-magic, 4.06.x).txt 47951 1980-00-00 00:00 46_build-macos-and-windows (windows-latest, dune, ocaml-variants.4.14.0+mingw64c).txt 68081 1980-00-00 00:00 47_build-ubuntu (dune, 4.11.x).txt 74162 1980-00-00 00:00 48_build-ubuntu (dune, 4.07.x).txt 70104 1980-00-00 00:00 49_build-ubuntu (dune, 5.0.0).txt 126511 1980-00-00 00:00 50_build-ubuntu (make, 4.12.x).txt 102496 1980-00-00 00:00 51_build-ubuntu (make, 4.08.x).txt 50462 1980-00-00 00:00 52_build-macos-and-windows (windows-latest, make-no-magic, 4.02.x).txt 45793 1980-00-00 00:00 53_build-macos-and-windows (macos-latest, make, 4.02.x).txt 124815 1980-00-00 00:00 54_build-macos-and-windows (macos-latest, make-no-magic, 4.14.x).txt 67950 1980-00-00 00:00 55_build-macos-and-windows (macos-latest, dune, 5.0.0).txt 48105 1980-00-00 00:00 56_build-macos-and-windows (windows-latest, make, ocaml-variants.4.14.0+mingw64c).txt 127019 1980-00-00 00:00 57_build-ubuntu (make-no-magic, 4.12.x).txt 1870 1980-00-00 00:00 58_build-ubuntu-old-ocamls (make, 3.10.2).txt 126513 1980-00-00 00:00 59_build-ubuntu (make, 4.13.x).txt 97041 1980-00-00 00:00 60_build-ubuntu (make-no-magic, 4.03.x).txt 103449 1980-00-00 00:00 61_build-macos-and-windows (windows-latest, make, 5.0.0).txt 68011 1980-00-00 00:00 62_build-ubuntu (dune, 4.13.x).txt 126573 1980-00-00 00:00 63_build-ubuntu (make-no-magic, 5.2.0).txt 128575 1980-00-00 00:00 64_build-macos-and-windows (windows-latest, make, 5.2.0).txt 65982 1980-00-00 00:00 65_build-macos-and-windows (macos-latest, dune, 5.1.1).txt 124506 1980-00-00 00:00 66_build-macos-and-windows (macos-latest, make-no-magic, 5.1.1).txt 101881 1980-00-00 00:00 67_build-ubuntu (make, 5.0.0).txt 68165 1980-00-00 00:00 68_build-ubuntu (dune, 4.12.x).txt 126592 1980-00-00 00:00 69_build-ubuntu (make, 4.11.x).txt 97913 1980-00-00 00:00 70_build-ubuntu (make-no-magic, 4.05.x).txt 124506 1980-00-00 00:00 71_build-macos-and-windows (macos-latest, make-no-magic, 5.2.0).txt 96193 1980-00-00 00:00 72_build-ubuntu (make, 4.02.x).txt 102439 1980-00-00 00:00 73_build-ubuntu (make-no-magic, 4.10.x).txt 67977 1980-00-00 00:00 74_build-ubuntu (dune, 5.1.1).txt 97596 1980-00-00 00:00 75_build-ubuntu (make-no-magic, 4.04.x).txt 96910 1980-00-00 00:00 76_build-ubuntu (make, 4.06.x).txt 70679 1980-00-00 00:00 77_build-ubuntu (dune, 4.09.x).txt 126527 1980-00-00 00:00 78_build-ubuntu (make-no-magic, 4.11.x).txt 65981 1980-00-00 00:00 79_build-macos-and-windows (macos-latest, dune, 5.2.0).txt 101899 1980-00-00 00:00 80_build-ubuntu (make-no-magic, 5.0.0).txt 126513 1980-00-00 00:00 81_build-ubuntu (make, 4.14.x).txt 70144 1980-00-00 00:00 82_build-macos-and-windows (windows-latest, dune, 5.1.1).txt 102504 1980-00-00 00:00 83_build-ubuntu (make, 4.10.x).txt 102508 1980-00-00 00:00 84_build-ubuntu (make-no-magic, 4.08.x).txt 126475 1980-00-00 00:00 85_build-ubuntu (make, 5.2.0).txt 126489 1980-00-00 00:00 86_build-ubuntu (make-no-magic, 5.1.1).txt 126527 1980-00-00 00:00 87_build-ubuntu (make-no-magic, 4.14.x).txt 96279 1980-00-00 00:00 88_build-ubuntu (make-no-magic, 4.02.x).txt 67977 1980-00-00 00:00 89_build-ubuntu (dune, 5.2.0).txt 77171 1980-00-00 00:00 90_build-ubuntu (dune, 4.05.x).txt 240 1980-00-00 00:00 build-ubuntu (dune, 4.05.x)/system.txt 102435 1980-00-00 00:00 91_build-ubuntu (make-no-magic, 4.09.x).txt 97660 1980-00-00 00:00 92_build-ubuntu (make-no-magic, 4.07.x).txt 126604 1980-00-00 00:00 93_build-ubuntu (make-no-magic, 4.13.x).txt 68011 1980-00-00 00:00 94_build-ubuntu (dune, 4.14.x).txt 97898 1980-00-00 00:00 95_build-ubuntu (make, 4.05.x).txt 70679 1980-00-00 00:00 96_build-ubuntu (dune, 4.10.x).txt --------- ------- 7587815 98 filesCurrently, the files are not being attached correctly in
attachRunLog.
The issue lies inlogFilenameRegexp:Lines 536 to 553 in fc19ff3
func logFilenameRegexp(job shared.Job, step shared.Step) *regexp.Regexp { // As described in https://github.com/cli/cli/issues/5011#issuecomment-1570713070, there are a number of steps // the server can take when producing the downloaded zip file that can result in a mismatch between the job name // and the filename in the zip including: // * Removing characters in the job name that aren't allowed in file paths // * Truncating names that are too long for zip files // * Adding collision deduplicating numbers for jobs with the same name // // We are hesitant to duplicate all the server logic due to the fragility but it may be unavoidable. Currently, we: // * Strip `/` which occur when composite action job names are constructed of the form `<JOB_NAME`> / <ACTION_NAME>` // * Truncate long job names // sanitizedJobName := strings.ReplaceAll(job.Name, "/", "") sanitizedJobName = strings.ReplaceAll(sanitizedJobName, ":", "") sanitizedJobName = truncateAsUTF16(sanitizedJobName, JOB_NAME_MAX_LENGTH) re := fmt.Sprintf(`^%s\/%d_.*\.txt`, regexp.QuoteMeta(sanitizedJobName), step.Number) return regexp.MustCompile(re) } Locally, for me, this is working fine:
- re := fmt.Sprintf(`^%s\/%d_.*\.txt`, regexp.QuoteMeta(sanitizedJobName), step.Number) + re := fmt.Sprintf(`^\d+_%s.*\.txt`, regexp.QuoteMeta(sanitizedJobName))
Test run:
$ bin/gh run view --repo shindere/stdcompat 13677151402 --log-failed | head -n 100 build-ubuntu-old-ocamls (make, 3.08.4) Set up job 2025-03-05T13:30:32.6031507Z Current runner version: '2.322.0' build-ubuntu-old-ocamls (make, 3.08.4) Set up job 2025-03-05T13:30:32.6056655Z ##[group]Operating System build-ubuntu-old-ocamls (make, 3.08.4) Set up job 2025-03-05T13:30:32.6057486Z Ubuntu build-ubuntu-old-ocamls (make, 3.08.4) Set up job 2025-03-05T13:30:32.6057960Z 24.04.2 build-ubuntu-old-ocamls (make, 3.08.4) Set up job 2025-03-05T13:30:32.6058453Z LTS build-ubuntu-old-ocamls (make, 3.08.4) Set up job 2025-03-05T13:30:32.6058875Z ##[endgroup] build-ubuntu-old-ocamls (make, 3.08.4) Set up job 2025-03-05T13:30:32.6059454Z ##[group]Runner Image build-ubuntu-old-ocamls (make, 3.08.4) Set up job 2025-03-05T13:30:32.6060050Z Image: ubuntu-24.04 build-ubuntu-old-ocamls (make, 3.08.4) Set up job 2025-03-05T13:30:32.6060519Z Version: 20250302.1.0 build-ubuntu-old-ocamls (make, 3.08.4) Set up job 2025-03-05T13:30:32.6061844Z Included Software: https://github.com/actions/runner-images/blob/ubuntu24/20250302.1/images/ubuntu/Ubuntu2404-Readme.md build-ubuntu-old-ocamls (make, 3.08.4) Set up job 2025-03-05T13:30:32.6063187Z Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu24%2F20250302.1 build-ubuntu-old-ocamls (make, 3.08.4) Set up job 2025-03-05T13:30:32.6064058Z ##[endgroup] build-ubuntu-old-ocamls (make, 3.08.4) Set up job 2025-03-05T13:30:32.6064610Z ##[group]Runner Image Provisioner build-ubuntu-old-ocamls (make, 3.08.4) Set up job 2025-03-05T13:30:32.6065211Z 2.0.422.1 build-ubuntu-old-ocamls (make, 3.08.4) Set up job 2025-03-05T13:30:32.6065630Z ##[endgroup] build-ubuntu-old-ocamls (make, 3.08.4) Set up job 2025-03-05T13:30:32.6067959Z ##[group]GITHUB_TOKEN Permissions build-ubuntu-old-ocamls (make, 3.08.4) Set up job 2025-03-05T13:30:32.6070233Z Actions: write build-ubuntu-old-ocamls (make, 3.08.4) Set up job 2025-03-05T13:30:32.6071198Z Attestations: write build-ubuntu-old-ocamls (make, 3.08.4) Set up job 2025-03-05T13:30:32.6071808Z Checks: write build-ubuntu-old-ocamls (make, 3.08.4) Set up job 2025-03-05T13:30:32.6072346Z Contents: write build-ubuntu-old-ocamls (make, 3.08.4) Set up job 2025-03-05T13:30:32.6072814Z Deployments: write build-ubuntu-old-ocamls (make, 3.08.4) Set up job 2025-03-05T13:30:32.6073310Z Discussions: write build-ubuntu-old-ocamls (make, 3.08.4) Set up job 2025-03-05T13:30:32.6073791Z Issues: write build-ubuntu-old-ocamls (make, 3.08.4) Set up job 2025-03-05T13:30:32.6074299Z Metadata: read build-ubuntu-old-ocamls (make, 3.08.4) Set up job 2025-03-05T13:30:32.6074741Z Packages: write build-ubuntu-old-ocamls (make, 3.08.4) Set up job 2025-03-05T13:30:32.6075251Z Pages: write build-ubuntu-old-ocamls (make, 3.08.4) Set up job 2025-03-05T13:30:32.6075758Z PullRequests: write build-ubuntu-old-ocamls (make, 3.08.4) Set up job 2025-03-05T13:30:32.6076236Z RepositoryProjects: write build-ubuntu-old-ocamls (make, 3.08.4) Set up job 2025-03-05T13:30:32.6076806Z SecurityEvents: write build-ubuntu-old-ocamls (make, 3.08.4) Set up job 2025-03-05T13:30:32.6077355Z Statuses: write build-ubuntu-old-ocamls (make, 3.08.4) Set up job 2025-03-05T13:30:32.6077838Z ##[endgroup] build-ubuntu-old-ocamls (make, 3.08.4) Set up job 2025-03-05T13:30:32.6080096Z Secret source: Actions build-ubuntu-old-ocamls (make, 3.08.4) Set up job 2025-03-05T13:30:32.6081104Z Prepare workflow directory build-ubuntu-old-ocamls (make, 3.08.4) Set up job 2025-03-05T13:30:32.6681575Z ##[error]The template is not valid. .github/workflows/ci.yml (Line: 95, Col: 19): Unexpected value '' build-ubuntu-old-ocamls (make, 3.07) Set up job 2025-03-05T13:37:50.8959630Z Current runner version: '2.322.0' build-ubuntu-old-ocamls (make, 3.07) Set up job 2025-03-05T13:37:50.8985159Z ##[group]Operating System build-ubuntu-old-ocamls (make, 3.07) Set up job 2025-03-05T13:37:50.8985916Z Ubuntu build-ubuntu-old-ocamls (make, 3.07) Set up job 2025-03-05T13:37:50.8986403Z 24.04.2 build-ubuntu-old-ocamls (make, 3.07) Set up job 2025-03-05T13:37:50.8987036Z LTS build-ubuntu-old-ocamls (make, 3.07) Set up job 2025-03-05T13:37:50.8987479Z ##[endgroup] build-ubuntu-old-ocamls (make, 3.07) Set up job 2025-03-05T13:37:50.8988284Z ##[group]Runner Image build-ubuntu-old-ocamls (make, 3.07) Set up job 2025-03-05T13:37:50.8988923Z Image: ubuntu-24.04 build-ubuntu-old-ocamls (make, 3.07) Set up job 2025-03-05T13:37:50.8989468Z Version: 20250223.1.0 build-ubuntu-old-ocamls (make, 3.07) Set up job 2025-03-05T13:37:50.8990474Z Included Software: https://github.com/actions/runner-images/blob/ubuntu24/20250223.1/images/ubuntu/Ubuntu2404-Readme.md build-ubuntu-old-ocamls (make, 3.07) Set up job 2025-03-05T13:37:50.8992019Z Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu24%2F20250223.1 build-ubuntu-old-ocamls (make, 3.07) Set up job 2025-03-05T13:37:50.8992993Z ##[endgroup] build-ubuntu-old-ocamls (make, 3.07) Set up job 2025-03-05T13:37:50.8993479Z ##[group]Runner Image Provisioner build-ubuntu-old-ocamls (make, 3.07) Set up job 2025-03-05T13:37:50.8994118Z 2.0.422.1 build-ubuntu-old-ocamls (make, 3.07) Set up job 2025-03-05T13:37:50.8994557Z ##[endgroup] build-ubuntu-old-ocamls (make, 3.07) Set up job 2025-03-05T13:37:50.8997071Z ##[group]GITHUB_TOKEN Permissions build-ubuntu-old-ocamls (make, 3.07) Set up job 2025-03-05T13:37:50.8999554Z Actions: write build-ubuntu-old-ocamls (make, 3.07) Set up job 2025-03-05T13:37:50.9000241Z Attestations: write build-ubuntu-old-ocamls (make, 3.07) Set up job 2025-03-05T13:37:50.9000925Z Checks: write build-ubuntu-old-ocamls (make, 3.07) Set up job 2025-03-05T13:37:50.9001408Z Contents: write build-ubuntu-old-ocamls (make, 3.07) Set up job 2025-03-05T13:37:50.9001932Z Deployments: write build-ubuntu-old-ocamls (make, 3.07) Set up job 2025-03-05T13:37:50.9002473Z Discussions: write build-ubuntu-old-ocamls (make, 3.07) Set up job 2025-03-05T13:37:50.9002955Z Issues: write build-ubuntu-old-ocamls (make, 3.07) Set up job 2025-03-05T13:37:50.9003492Z Metadata: read build-ubuntu-old-ocamls (make, 3.07) Set up job 2025-03-05T13:37:50.9004001Z Packages: write build-ubuntu-old-ocamls (make, 3.07) Set up job 2025-03-05T13:37:50.9004499Z Pages: write build-ubuntu-old-ocamls (make, 3.07) Set up job 2025-03-05T13:37:50.9004931Z PullRequests: write build-ubuntu-old-ocamls (make, 3.07) Set up job 2025-03-05T13:37:50.9005524Z RepositoryProjects: write build-ubuntu-old-ocamls (make, 3.07) Set up job 2025-03-05T13:37:50.9006036Z SecurityEvents: write build-ubuntu-old-ocamls (make, 3.07) Set up job 2025-03-05T13:37:50.9006543Z Statuses: write build-ubuntu-old-ocamls (make, 3.07) Set up job 2025-03-05T13:37:50.9007046Z ##[endgroup] build-ubuntu-old-ocamls (make, 3.07) Set up job 2025-03-05T13:37:50.9009211Z Secret source: Actions build-ubuntu-old-ocamls (make, 3.07) Set up job 2025-03-05T13:37:50.9009886Z Prepare workflow directory build-ubuntu-old-ocamls (make, 3.07) Set up job 2025-03-05T13:37:50.9592271Z ##[error]The template is not valid. .github/workflows/ci.yml (Line: 95, Col: 19): Unexpected value '' build-ubuntu-old-ocamls (make, 3.09.3) Set up job 2025-03-05T13:31:35.7092655Z Current runner version: '2.322.0' build-ubuntu-old-ocamls (make, 3.09.3) Set up job 2025-03-05T13:31:35.7119780Z ##[group]Operating System build-ubuntu-old-ocamls (make, 3.09.3) Set up job 2025-03-05T13:31:35.7120524Z Ubuntu build-ubuntu-old-ocamls (make, 3.09.3) Set up job 2025-03-05T13:31:35.7121026Z 24.04.2 build-ubuntu-old-ocamls (make, 3.09.3) Set up job 2025-03-05T13:31:35.7121518Z LTS build-ubuntu-old-ocamls (make, 3.09.3) Set up job 2025-03-05T13:31:35.7122011Z ##[endgroup] build-ubuntu-old-ocamls (make, 3.09.3) Set up job 2025-03-05T13:31:35.7122479Z ##[group]Runner Image build-ubuntu-old-ocamls (make, 3.09.3) Set up job 2025-03-05T13:31:35.7123089Z Image: ubuntu-24.04 build-ubuntu-old-ocamls (make, 3.09.3) Set up job 2025-03-05T13:31:35.7123629Z Version: 20250302.1.0 build-ubuntu-old-ocamls (make, 3.09.3) Set up job 2025-03-05T13:31:35.7124617Z Included Software: https://github.com/actions/runner-images/blob/ubuntu24/20250302.1/images/ubuntu/Ubuntu2404-Readme.md build-ubuntu-old-ocamls (make, 3.09.3) Set up job 2025-03-05T13:31:35.7125984Z Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu24%2F20250302.1 build-ubuntu-old-ocamls (make, 3.09.3) Set up job 2025-03-05T13:31:35.7126852Z ##[endgroup] build-ubuntu-old-ocamls (make, 3.09.3) Set up job 2025-03-05T13:31:35.7127391Z ##[group]Runner Image Provisioner build-ubuntu-old-ocamls (make, 3.09.3) Set up job 2025-03-05T13:31:35.7127924Z 2.0.422.1 build-ubuntu-old-ocamls (make, 3.09.3) Set up job 2025-03-05T13:31:35.7128619Z ##[endgroup] build-ubuntu-old-ocamls (make, 3.09.3) Set up job 2025-03-05T13:31:35.7130957Z ##[group]GITHUB_TOKEN Permissions build-ubuntu-old-ocamls (make, 3.09.3) Set up job 2025-03-05T13:31:35.7132999Z Actions: write build-ubuntu-old-ocamls (make, 3.09.3) Set up job 2025-03-05T13:31:35.7133712Z Attestations: write build-ubuntu-old-ocamls (make, 3.09.3) Set up job 2025-03-05T13:31:35.7134381Z Checks: write build-ubuntu-old-ocamls (make, 3.09.3) Set up job 2025-03-05T13:31:35.7134840Z Contents: write build-ubuntu-old-ocamls (make, 3.09.3) Set up job 2025-03-05T13:31:35.7135310Z Deployments: write build-ubuntu-old-ocamls (make, 3.09.3) Set up job 2025-03-05T13:31:35.7135854Z Discussions: write build-ubuntu-old-ocamls (make, 3.09.3) Set up job 2025-03-05T13:31:35.7136385Z Issues: write build-ubuntu-old-ocamls (make, 3.09.3) Set up job 2025-03-05T13:31:35.7136829Z Metadata: read build-ubuntu-old-ocamls (make, 3.09.3) Set up job 2025-03-05T13:31:35.7137360Z Packages: write build-ubuntu-old-ocamls (make, 3.09.3) Set up job 2025-03-05T13:31:35.7137830Z Pages: write build-ubuntu-old-ocamls (make, 3.09.3) Set up job 2025-03-05T13:31:35.7138523Z PullRequests: write build-ubuntu-old-ocamls (make, 3.09.3) Set up job 2025-03-05T13:31:35.7139249Z RepositoryProjects: write build-ubuntu-old-ocamls (make, 3.09.3) Set up job 2025-03-05T13:31:35.7139797Z SecurityEvents: write build-ubuntu-old-ocamls (make, 3.09.3) Set up job 2025-03-05T13:31:35.7140349Z Statuses: write build-ubuntu-old-ocamls (make, 3.09.3) Set up job 2025-03-05T13:31:35.7140827Z ##[endgroup] build-ubuntu-old-ocamls (make, 3.09.3) Set up job 2025-03-05T13:31:35.7143188Z Secret source: Actions
I'll be testing and verifying by correlating this output with the failed jobs.
I'll keep updating here as I proceed.
This is working without removing that
exclude_pull_requests=truequery parameter.
So, it's not related to that as I previously mentioned in my comment.- Kynan Ware (2025/03/07 09:43 -0800):BagToad left a comment (cli/cli#10551) @shindere @iamazeem Thank you for the investigation everyone 🙏 I haven't finished digging into this yet, but I think something else may be going on because the command still fails even when `exclude_pull_requests` is removed from the request parameters. ``` ❯ GH_DEBUG=true ./bin/gh run view --log-failed -R shindere/stdcompat 13677151402 ⣾* Request at 2025-03-07 10:39:08.946284 -0700 MST m=+0.085645709 * Request to https://api.github.com/repos/shindere/stdcompat/actions/runs/13677151402 ⢿* Request took 360.202792ms * Request at 2025-03-07 10:39:09.355176 -0700 MST m=+0.494534209 * Request to https://api.github.com/repos/shindere/stdcompat/actions/workflows/144784623 ⡿* Request took 143.70425ms ⣾* Request at 2025-03-07 10:39:09.555462 -0700 MST m=+0.694818876 * Request to https://api.github.com/repos/shindere/stdcompat/actions/runs/13677151402/jobs?per_page=100 ⣽* Request took 3.008319708s ``` I also noticed the command completes successfully when the `--log-failed` option is removed, even with the `exclude_pull_requests` parameter is present. @shindere Does the command complete successfully with other PRs? Do you happen to have an example PR which the command completes successfully?Well to tell the truth it's the first one on which I tried it. It's just that I was surprised because I was under the impression that it did initially work and then stopped to work, but perhaps it's because the initial runs were triggered by pushes of branches rather than a PR. Unfortunately, I do not have access to these runs at the moment and won't before a week or so, sorry about that.
- Azeem Sajid (2025/03/08 00:12 -0800):iamazeem left a comment (cli/cli#10551) @shindere: It's documented here as a comment above `attachRunLog`: https://github.com/cli/cli/blob/fc19ff321a4b7f4198f788f08da20249c7950fbd/pkg/cmd/run/view/view.go#L621-L649 But, as you've observed, it different from the actual ZIP.Thanks for the pointer! Do we know why GH stores files this way?I'll be testing and verifying by correlating this output with the failed jobs. I'll keep updating here as I proceed.Many thanks for all your detective work, warmly appreciated!Reacted by Azeem
Do we know why GH stores files this way?
From the code,
ghdoesn't seem to do any intermediate processing.
The response is being read and then dumped as-is in ZIP format.21 remaining items
Thanks everyone in the thread for digging into this. 👏
As a summary, there is a new service producing ZIP archives that is being rolled out and it's not a stable interface. We’re going to fix the CLI to work with both formats for the time being.
- Thanks. Even if not stable, can you still provide a bit information about the ocntent of the Zip file, please? An insight on what trigggers whether it's one of the formats or another which is produced would definitely please / relieve me. Thanks!
Sure. Actually, it's not a two totally different formats case. Sometimes, the ZIP archive includes the logs for the individual steps, sometimes it's not. This is due to the internals of the API back-end. In either case there is a top-level log file in the archive. The CLI will fallback to the mentioned file if the step-wise logs were not present. So, the differentiation is based on the directory structure and missing step files.
I hope this answers your question.
UPDATE: Check the updated list in a few comments below (here).
Here's the C/A for the fix.
Acceptance Criteria
Given I have a job run whose logs are produced by the new results service
When I rungh run view --logs <JOB-ID>
Then the job logs are displayed with proper step name on every lineGiven I have a job run whose logs are produced by new results service without individual step logs
When I rungh run view --logs <JOB-ID>
Then the job logs are displayed with UNKNOWN placeholder for step name on every line- addedcoreThis issue is not accepting PRs from outside contributorsThis issue is not accepting PRs from outside contributorsand removedneeds-triageneeds to be reviewedneeds to be reviewed
on Apr 3, 2025 - Many thanks for the explanations, @Babak.Sure. Actually, it's not a two totally different formats case. Sometimes, the ZIP archive includes the logs for the individual steps, sometimes it's not.This indeed matches what had already been found out by others who have investigated here. Isthere any determinism in this `sometimes`? Any clue so that we know when we are going to receive what, or is it unpredictable?This is due to the internals of the API back-end. In either case there is a top-level log file in the archive. The CLI will fallback to the mentioned file if the step-wise logs were not present. So, the differentiation is based on the directory structure and missing step files.This, too, had already been found out as I am sure you are aware of if you read the thread.I hope this answers your question.Not quite, see above. Will you please also take into account the previoous comments where I mentionned it would be awesome to have the possibility to download a zip with only the log of failed builds?
No worries.
Isthere any determinism in this
sometimes? Any clue so that we know
when we are going to receive what, or is it unpredictable?This is due to how the Actions API work. Unfortunately, we don't yet have a full understanding about the underlying causes and we're still following up on this internally. So, the best we can do here the CLI side is to make it aware and adapt to the possible cases.
Will you please also take into account the previoous comments where I
mentionned it would be awesome to have the possibility to download a zip
with only the log of failed builds?Sure. I noted this to bring it up in our internal comms with the Actions team. Not to mention the ZIP archive is created at the API side and this request involves introducing changes to it so that the CLI can use it.
- linked a pull request that will close this issueFallback to job run logs when step logs are missing #10740
on Apr 7, 2025 During investigation, we noticed another issue with legacy filename formats. So, the updated A/C is as below:
Acceptance Criteria
1. Step logs present
Given I have a job run whose logs are produced by the new results service
When I rungh run view --logs <JOB-ID>
Then the job logs are displayed with proper step name on every line2. Step logs missing
Given I have a job run whose logs are produced by new results service without individual step logs
When I rungh run view --logs <JOB-ID>
Then the job logs are displayed with UNKNOWN placeholder for step name on every line3. Legacy filename format
Given I have a job run whose logs are named in the legacy format (e.g.,
-2147483648_issue.txt) and its individual step logs are missing
When I rungh run view --logs <JOB-ID>
Then the job logs are displayed with UNKNOWN placeholder for step name on every lineThanks everyone for helping spot the problem here. A fix has been landed and will be available in the next release, which is very soon. 🎉
I started to use this feature quite recently and initially it seemed to
work but now I simply cannot get any log, but no error either.
Is there any trick I can use to debug? Shall I provide an example of a
repo and run id for which I encounter this problem?