Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-25306

Parse error while generating PDF report

XMLWordPrintable

    • Icon: Problem report Problem report
    • Resolution: Unresolved
    • Icon: Trivial Trivial
    • 7.0.5rc1
    • Server (S)
    • None
    • go.mod
      github.com/chromedp/cdproto v0.0.0-20230220211738-2b1ec77315c9
      github.com/chromedp/chromedp v0.8.7

      chrome version 129.0.6668.70
    • Prev.Sprint, S24-W42/43

      Steps to reproduce:

      1. Use the latest chrome (see Environment section for the version we used)
      2. Generate a scheduled report. Make sure it succeeds (does not abort with a different error earlier).

      Result:

      See stdout of Zabbix web service. Many errors like this happen

      2024/09/26 11:53:35 ERROR: could not unmarshal event: parse error: expected string near offset 1542 of 'cookiePart...'
      

      They happen in waitForDashboardReady() while performing: chromedp.Run(ctx, chromedp.Poll...

       

      func waitForDashboardReady(ctx context.Context, url string) error {
        const wrapperIsReady = ".wrapper.is-ready"
        const timeout = time.Minute
      
        expression := fmt.Sprintf("document.querySelector('%s') !== null", wrapperIsReady)
        var isReady bool
      
        err := chromedp.Run(ctx, chromedp.Poll(expression, &isReady, chromedp.WithPollingTimeout(timeout)))
      
        if errors.Is(err, chromedp.ErrPollingTimeout) {
          log.Warningf("timeout occurred while dashboard was getting ready, url: '%s'", url)
        } else if err != nil {
          log.Warningf("error while dashboard was getting ready: %s, url: '%s'", err.Error(), url)
        } else if !isReady {
          log.Warningf("should never happen, dashboard failed to get ready with no error, url: '%s'", url)
        }
      
        return nil
      }
       

      After chromedp was updated to a newer version v0.10.0 and cdproto (dependency of chromedp) was updated accordingly, the errors in stdout disappeared.

      It looks like some change in cdproto caused this.

      git log -S'cookiePart' -p 6b041c6303cc..3f85d328b335
      

      It might be this change
      https://github.com/chromedp/cdproto/blob/f933b107c653594d09bb9fb4d16adf6b4d696c65/network/events.go#L233

      Expected:

      Versions of chromedp and cdproto are updated in go.mod.

      As a result, no inconsistency is present between chrome and chromedp anymore and no errors are logged.

            esneiders Eriks Sneiders
            mprihodko Mihails Prihodko
            Team INT
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: