502 Bad Gateway from JsReportOnline



  • I've been able to replicate this with both my own code and Postman.

    Trying to render a report that I have created within my own jsreport account but constantly receiving the following exception:

    Unable to render template.
    <html>
    <head><title>502 Bad Gateway</title></head>
    <body bgcolor="white">
    <center><h1>502 Bad Gateway</h1></center>
    <hr><center>nginx/1.13.8</center>
    </body>
    </html>

    Looking at the log, I can see that the report has been generated (and if I save it I can see it looks fine), but for some reason the response being sent is causing a bad gateway error somewhere along the line.

    Anyone else seeing this?



  • I am looking into it. Could you please email me the request you send (remove the secret data, just make sure it still fails)?
    jan.blaha@jsreport.net
    Thank you



  • Thanks Jan for all your help.

    It's now working as expected with that workaround.

    For those of you using the code from Github to create the Render Request, it's worth noting the following change I made to resolve the issue:

    public class RenderRequest
    {
        public RenderRequest()
        {
            Template = new Template();
            Options = new RenderOptions()
            {
               // use this if you want to see what you are creating from your request
    	   Reports = new ReportsOptions
    	   {
    		Save = true
    	   }
               // it makes sense to enable this always (WRONG!)
    	   // switch this off for now as current bug can cause 502 bad gateway 
               //Debug = new DebugOptions()
               //{
               //    LogsToResponseHeader = true
               //}
             };
       }
    
       public Template Template { get; set; }
       public object Data { get; set; }
       public RenderOptions Options { get; set; }
    
       public object Overwrites { get; set; }
    }
    


  • This post is deleted!

Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.