buildbarn / bb-browser

Web frontend for exploring an Action Cache / Content Addressable Storage
Apache License 2.0
42 stars 35 forks source link

Malformed browser page when log file too large #24

Closed Qinusty closed 4 years ago

Qinusty commented 4 years ago

I've just noticed a bug with this, it seems that the page is malformed in some way and the page ends at "The" before it say "log file", this means that you're unable to see anything past this point until you revert the browser version. Looking at the HTML, I can't see anything blatantly obvious which would cause this but I have attached a snippet of the malformed HTML relating to this.

<table class="table" style="table-layout: fixed">

  <tbody><tr>
    <th style="width: 25%">Exit code:</th>
    <td style="width: 75%">
      0

        <span class="badge badge-success">Success</span>

    </td>
  </tr>

    <tr>
        <th style="width: 25%">Standard output<sup><a href="https://browser.example.com/file/buildbarn/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef/1234567/log.txt">*</a></sup>:</th>
        <td class="width: 75%">

                The </td></tr></tbody></table></div></body></html>

Originally posted by @Qinusty in https://github.com/buildbarn/bb-browser/pull/23#issuecomment-623574530

EdSchouten commented 4 years ago

Be sure to check the stdout/stderr of bb-browser.

I suspect that the issue is that we should have used {{.Digest.GetSizeBytes}} instead of {{.GetSizeBytes}}.

Qinusty commented 4 years ago

2020/05/04 17:40:48 template: view_log.html:8:25: executing "view_log.html" at <.GetInstance>: can't evaluate field GetInstance in type *main.logInfo

Seems an issue with GetInstance, likely due to the {{end}} statement at the end of the <th> line. I'm not 100% on this templating, what object is it exactly exiting with the {{end}} statement?

EDIT: Spotted the With statement.