{"action":"closed","issue":{"url":"https://api.github.com/repos/bjrmatos/jsreport-electron-pdf/issues/18","repository_url":"https://api.github.com/repos/bjrmatos/jsreport-electron-pdf","labels_url":"https://api.github.com/repos/bjrmatos/jsreport-electron-pdf/issues/18/labels{/name}","comments_url":"https://api.github.com/repos/bjrmatos/jsreport-electron-pdf/issues/18/comments","events_url":"https://api.github.com/repos/bjrmatos/jsreport-electron-pdf/issues/18/events","html_url":"https://github.com/bjrmatos/jsreport-electron-pdf/issues/18","id":341314031,"node_id":"MDU6SXNzdWUzNDEzMTQwMzE=","number":18,"title":"Electron-PDF timing out and looks like configuration isn't picking up from jsreport.config.json","user":{"login":"jLouzado","id":2016685,"node_id":"MDQ6VXNlcjIwMTY2ODU=","avatar_url":"https://avatars1.githubusercontent.com/u/2016685?v=4","gravatar_id":"","url":"https://api.github.com/users/jLouzado","html_url":"https://github.com/jLouzado","followers_url":"https://api.github.com/users/jLouzado/followers","following_url":"https://api.github.com/users/jLouzado/following{/other_user}","gists_url":"https://api.github.com/users/jLouzado/gists{/gist_id}","starred_url":"https://api.github.com/users/jLouzado/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jLouzado/subscriptions","organizations_url":"https://api.github.com/users/jLouzado/orgs","repos_url":"https://api.github.com/users/jLouzado/repos","events_url":"https://api.github.com/users/jLouzado/events{/privacy}","received_events_url":"https://api.github.com/users/jLouzado/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-07-15T11:32:14Z","updated_at":"2018-07-22T12:08:12Z","closed_at":"2018-07-22T12:08:12Z","author_association":"NONE","body":"## Issue\r\n\r\n- I'm trying to generate a report via electron-pdf and it's timing out with the following error:\r\n```\r\nError: Timeout when executing in electron\r\n    at Timeout._onTimeout (/home/ubuntu/jsreportapp/node_modules/electron-html-to/lib/dedicatedProcessStrategy.js:277:20)\r\n    at ontimeout (timers.js:498:11)\r\n    at tryOnTimeout (timers.js:323:5)\r\n    at Timer.listOnTimeout (timers.js:290:5)\r\n```\r\n- Would very much appreciate any assistance :pray:  \r\n\r\n## Steps\r\n\r\n- I installed `jsreport-electron-pdf` and `electron` since `electron-prebuilt` is now Deprecated.\r\n- Here's the extract from my package.json:\r\n\r\n```\r\n\"dependencies\": {\r\n    \"electron\": \"^2.0.5\",\r\n    \"install\": \"^0.12.1\",\r\n    \"jsreport\": \"2.1.1\",\r\n    \"jsreport-electron-pdf\": \"^3.0.0\",\r\n    \"jsreport-phantom-pdf\": \"^2.1.3\",\r\n    \"npm\": \"^6.2.0\"\r\n  }\r\n```\r\n- and here's the section from my `jsreport.config.json` file:\r\n\r\n```\r\n\"extensions\": {\r\n    \"authentication\": {\r\n      \"cookieSession\": {\r\n        \"secret\": \"some secret\"\r\n      },\r\n      \"admin\": {\r\n        \"username\": \"some name\",\r\n        \"password\": \"some password\"\r\n      },\r\n      \"enabled\": true\r\n    },\r\n    \"scripts\": {\r\n      \"timeout\": 40000,\r\n      \"strategy\": \"http-server\"\r\n    },\r\n    \"electron\":{\r\n      \"strategy\":\"electron-ipc\",\r\n      \"pingTimeout\":100,\r\n      \"timeout\":5000\r\n    }\r\n  },\r\n```\r\n\r\n## Description \r\n- I'm running on an AWS EC2 `t2.medium` instance so that has 2 cores\r\n- However the electron-pdf `strategy` is defaulting to `dedicated-process` even though I'm setting it as `electron-ipc` in the jsreport \"extensions\" configuration.\r\n- It's not even taking the `pingTimeout` and `timeout` values from the config file\r\n- startup log\r\n\r\n```\r\n2018-07-15T10:59:39.982Z - info: Using extension electron-pdf\r\n  electron-html-to Creating a new conversion function with options: +0ms { timeout: 10000,\r\n  numberOfWorkers: 2,\r\n  chromeCommandLineSwitches: { 'ignore-certificate-errors': null },\r\n  allowLocalFilesAccess: false,\r\n  maxLogEntrySize: 1000,\r\n  tmpDir: '/tmp/jsreport/autocleanup',\r\n  strategy: 'dedicated-process' }\r\n\r\n```\r\n\r\n- Jsreport Server Log\r\n\r\n```\r\n2018-07-15T11:00:11.394Z - debug: Electron Pdf recipe start.\r\n  electron-html-to:conversion generating new conversion task.. +31s\r\n  electron-html-to:conversion conversion task id: ea778c01-9b8d-4672-865a-ee5c18cb5328 +0ms\r\n  electron-html-to:conversion creating temporal html files in /tmp/jsreport/autocleanup.. +1ms\r\n  electron-html-to:conversion creating temporal html file [type: html] in /tmp/jsreport/autocleanup/ea778c01-9b8d-4672-865a-ee5c18cb5328html.html.. +0ms\r\n  electron-html-to:conversion starting conversion task [strategy:dedicated-process][task id:ea778c01-9b8d-4672-865a-ee5c18cb5328] with options: +1ms { browserWindow: \r\n   { width: undefined,\r\n     height: undefined,\r\n     webPreferences: { javascript: true } },\r\n  waitForJSVarName: 'JSREPORT_READY_TO_START',\r\n  collectLogs: true,\r\n  delay: undefined,\r\n  waitForJS: false,\r\n  converterPath: '/home/ubuntu/jsreportapp/node_modules/electron-html-to/lib/converters/pdf.js',\r\n  pdf: \r\n   { marginsType: undefined,\r\n     pageSize: undefined,\r\n     printBackground: true,\r\n     landscape: false },\r\n  htmlFile: '/tmp/jsreport/autocleanup/ea778c01-9b8d-4672-865a-ee5c18cb5328html.html',\r\n  url: 'file:///tmp/jsreport/autocleanup/ea778c01-9b8d-4672-865a-ee5c18cb5328html.html',\r\n  chromeCommandLineSwitches: { 'ignore-certificate-errors': null },\r\n  extraHeaders: {},\r\n  output: \r\n   { tmpDir: '/tmp/jsreport/autocleanup',\r\n     id: 'ea778c01-9b8d-4672-865a-ee5c18cb5328' } }\r\n  electron-html-to:dedicated-process-strategy saving settings in temporal file.. +1ms\r\n  electron-html-to:dedicated-process-strategy searching electron executable path.. +0ms\r\n  electron-html-to:dedicated-process-strategy trying to get electron path from \"electron\" module.. +0ms\r\n  electron-html-to:dedicated-process-strategy spawning new electron process with args: +1ms [ '/home/ubuntu/jsreportapp/node_modules/electron-html-to/lib/scripts/standaloneScript.js' ] and options: { env: \r\n   { ELECTRON_WORKER_ID: 'ea778c01-9b8d-4672-865a-ee5c18cb5328',\r\n     ELECTRON_HTML_TO_SETTINGS_FILE_PATH: '/tmp/jsreport/autocleanup/ea778c01-9b8d-4672-865a-ee5c18cb5328settings.html',\r\n     DISPLAY: 'localhost:10.0' },\r\n  stdio: [ null, null, null, 'ipc' ] }\r\n  electron-html-to:dedicated-process-strategy electron process pid: +4ms 2196\r\n  electron-html-to:dedicated-process-strategy processing conversion.. +1ms\r\n  electron-html-to:dedicated-process-strategy electron process exit with code: 127 and signal: null +1ms\r\n  electron-html-to:dedicated-process-strategy conversion timeout.. +10s\r\n2018-07-15T11:00:21.409Z - error: Error when processing render request Timeout when executing in electron Error: Timeout when executing in electron\r\n    at Timeout._onTimeout (/home/ubuntu/jsreportapp/node_modules/electron-html-to/lib/dedicatedProcessStrategy.js:277:20)\r\n    at ontimeout (timers.js:498:11)\r\n    at tryOnTimeout (timers.js:323:5)\r\n    at Timer.listOnTimeout (timers.js:290:5)\r\n2018-07-15T11:00:21.410Z - error: Error during processing request at http:/<IP_Address>:5488/api/report/student-list-normal-marks\r\n```\r\n\r\n"}}
{"actor":{"display_login":"jLouzado"}}