403 error with client-side export in myxwiki

We’re trying to use the newer client-side export process to generate PDFs from myxwiki.org pages. The user experience is as expected until after hitting the button. Then the spinner shows up “exporting as PDF”, but never gets beyond that.

Looking in the browser consoler, we see this, which is interesting:
image

That is: we’re getting a 403 error when trying to access
/xwiki/bin/export/test_page/?format=html-print&xpage=get&outputSyntax=plain&async=true&sheet=XWiki.PDFExport.Sheet&jobId=export%2Fpdf%2F1675715974898-254&

This is true whether the user is logged in to the wiki or not.

I know there’s been some work to make this functional on the myxwiki.org farm; is that perhaps not yet complete? I’ll note we don’t see this behavior in our on-prem environment.

Thanks much!

Indeed, I can reproduce but it looks like a myxwiki.org infra issue:

  • the PDF export job finishes successfully
    {
      "id":["export","pdf","1675763237607-304"],
      "state":"FINISHED",
      "canceled":false,
      "progress":{"offset":1.0},
      "failed":false,
      "lastError":null
    }
    
  • if I change format=html-print to format=xhtml-print in the export URL then I get the proper response

@tmortagne do we have some rules to forbid requests with format=html? Maybe they match too much (prefix instead of exact match).

This is confirmed: we have a protection on myxwiki.org for HTML exports to avoid bots or humans doing DDOS attacks (as doing an HTML export takes a lot of time). It was matching too much.

The infra team has now changed the protection.

@lanedsmu can you try again?

Thanks

Thanks much, @mflorea and @vmassol: that fixed the problem. Client-side pdf exports now are working well on our myxwiki.org site. -Lane