Bmansurov has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/385044 )

Change subject: DON'T merge: headless chromium not working
......................................................................

DON'T merge: headless chromium not working

Here we're trying to use the chromium that comes with the OS, in this
case I'm using Arch Linux, and the chromium version is 61.0.3163.100.
Loading a page to generate a PDF results in the following error:

Error: Timed out after 30000 ms while trying to connect to Chrome! The
only Chrome revision guaranteed to work is r499413.

Change-Id: I6e50d47049e00410fa8c8877142d8bb5efe9aee3
---
M config.dev.yaml
M routes/html2pdf-v1.js
2 files changed, 9 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/chromium-render 
refs/changes/44/385044/1

diff --git a/config.dev.yaml b/config.dev.yaml
index fe9b9d4..e4dcbe9 100644
--- a/config.dev.yaml
+++ b/config.dev.yaml
@@ -91,6 +91,11 @@
           # some room for page numbers
           bottom: '0.75in'
           left: '0.5in'
+      # 
https://github.com/GoogleChrome/puppeteer/blob/v0.11.0/docs/api.md#puppeteerlaunchoptions
       puppeteer_flags:
-        - '--no-sandbox'
-        - '--disable-setuid-sandbox'
+        executablePath: '/usr/bin/chromium'
+        headless: true
+        timeout: 30000
+        args:
+          - '--no-sandbox'
+          - '--disable-setuid-sandbox'
diff --git a/routes/html2pdf-v1.js b/routes/html2pdf-v1.js
index 26f5a62..f80eab3 100644
--- a/routes/html2pdf-v1.js
+++ b/routes/html2pdf-v1.js
@@ -25,7 +25,8 @@
     let browser;
     let page;
 
-    return puppeteer.launch({ args: app.conf.puppeteer_flags })
+    return puppeteer.launch(app.conf.puppeteer_flags)
+        .catch((error) => { console.log(error); })
         .then((browser_) => {
             browser = browser_;
             return browser.newPage();

-- 
To view, visit https://gerrit.wikimedia.org/r/385044
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6e50d47049e00410fa8c8877142d8bb5efe9aee3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/chromium-render
Gerrit-Branch: master
Gerrit-Owner: Bmansurov <bmansu...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to