Timeout in Physical Ubuntu Server but Not in Docker
-
I am using JSREPORT local. It is working on windows and ubuntu (18.04 and 20.04) docker (with all dependencies, it's working fine, but in the physical ubuntu server it's getting TimeOut exception.
One or more errors occurred. (Error rendering report: instance has been daemonized and initialized successfully (pid: 1589062)rendering has finished with errors:A critical error occurred while trying to execute the render command (2). Timeout Error: pdf generation not completed after 30000ms (1). caused by error (2):-> stackError: at onCriticalError (/snapshot/jsreport/node_modules/jsreport-cli/lib/commands/render.js:302:19) at /snapshot/jsreport/node_modules/jsreport-cli/lib/commands/render.js:256:14 at processTicksAndRejections (internal/process/task_queues.js:97:5)caused by error (1):-> stackError: at Client.render (/snapshot/jsreport/node_modules/jsreport-client/lib/client.js) at processTicksAndRejections (internal/process/task_queues.js:97:5) at async startRender (/snapshot/jsreport/node_modules/jsreport-cli/lib/commands/render.js:319:24) at async /snapshot/jsreport/node_modules/jsreport-cli/lib/commands/render.js:226:22 at async Commander.executeCommand (/snapshot/jsreport/node_modules/jsreport-cli/lib/commander.js:242:22)Remote stack: Error: at Timeout.<anonymous> (/snapshot/jsreport/node_modules/jsreport-chrome-pdf/lib/conversion.js:293:19) at listOnTimeout (internal/timers.js:549:17) at processTimers (internal/timers.js:492:7))
-
Are you able to render a simple "hello world" pdf? Or the timeout is affecting also simple templates?
-
Yes, it's affecting a test code actually. My Code sample is given below.
var rs = new LocalReporting() .TempDirectory("/home/jsreport-dotnet-example-consoleapp/temp") .RunInDirectory(Path.Combine(Directory.GetCurrentDirectory(), "jsreport")) .KillRunningJsReportProcesses() .UseBinary(jsreport.Binary.Linux.JsReportBinary.GetBinary()) .Configure(cfg => { cfg.AllowedLocalFilesAccess().FileSystemStore().BaseUrlAsWorkingDirectory(); cfg.Chrome = new ChromeConfiguration { Timeout = 260000}; return cfg; }) .AsUtility() .Create(); var customReport = rs.RenderAsync(CustomRenderRequest).Result; customReport.Content.CopyTo(File.OpenWrite("customReport.pdf")); Console.WriteLine("Done, hit any key..."); Console.ReadKey(); private static RenderRequest CustomRenderRequest = new RenderRequest() { Template = new Template() { Content = "Helo world from {{message}}", Engine = Engine.Handlebars, Recipe = Recipe.ChromePdf }, Data = new { message = "jsreport for .NET!!!" } };
-
I also tried to render pdf using a template.
var invoiceReport1 = rs.RenderByNameAsync("MyTemplate", MyTemplateData).Result; invoiceReport1.Content.CopyTo(File.OpenWrite("MyTemplate.pdf"));
But for both use case it is giving me timeout error.
I can send you the source code, if you want. For that please let me know where to share
-
Could you try to delete the
/home/jsreport-dotnet-example-consoleapp/temp
and try again?
You get this error on the ubuntu 20.04?
It's running in some kind of AWS or Azure common image?
-
I have tried that also. But not working.
I have tried that on ubuntu 20.04 and 18.04 both.
-
I installed jsreport server in the ubuntu server, to test. But result is same. Please let me know If I missed any dependencies.
-
This is the installation from the npm?
Did you follow these steps? https://jsreport.net/learn/ubuntu
-
Yes. I maintain the steps. The server is running, but the report is not generating, same error as .net code
-
I tried a brand new VM in azure with ubuntu 20.04 and the following setup
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash nvm install 8.11.3 mkdir jsreportapp cd jsreportapp npm i -g jsreport-cli jsreport init jsreport configure # chrome dependencies sudo apt-get update sudo apt-get install -y libgconf-2-4 sudo wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' sudo apt-get update sudo apt-get install -y google-chrome-unstable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst --no-install-recommends sudo apt-get install -y libxtst6 libxss1 libx11-xcb1 jsreport start
Afterward I can render the invoice sample. Could you try the same?