Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: connect ECONNREFUSED #30

Open
venkadesh-p opened this issue Aug 13, 2019 · 1 comment
Open

Error: connect ECONNREFUSED #30

venkadesh-p opened this issue Aug 13, 2019 · 1 comment

Comments

@venkadesh-p
Copy link

When i am trying to generate pdf using CLI, i am getting the following log.

$ DEBUG=pdf:* pdf-bot generate 359621c9-87cc-4070-b648-09aa51d117ba
  pdf:cli Creating CLI using config file /Users/venkadesh/Downloads/pdf-bot-master/pdf-bot.config.js +0ms
  pdf:generator Creating PDF for url https://esbenp.github.io with options {"completionTrigger":{"timeout":5000,"timeoutMessage":"CompletionTrigger timed out."}} +68ms
  pdf:db Logging try for job ID 359621c9-87cc-4070-b648-09aa51d117ba +26s
html-pdf-chrome error: Error: connect ECONNREFUSED ::1:50296 (job ID: 359621c9-87cc-4070-b648-09aa51d117ba. Generation ID: 09864256-00a8-410f-9a7a-68a8e8ba2f05)

Anyone please help me to fix this.

@xucito
Copy link

xucito commented Sep 23, 2019

When you run the CLI it seems that it doesn't use the chrome default port. Explicitly set it to your chrome remote debugging port (Default 9222).

var LowDB = require('./src/db/lowdb.js')
var htmlPdf = require('html-pdf-chrome')

module.exports = {
  api: {
    port: 3000,
    token: 'api-token'
  },
  db: LowDB({
    lowDbOptions: {},
    path: 'pdf-storage/db/db'
  }),
  storagePath: "pdf-storage",
  webhook: {
    url: 'http://localhost:3000/webhooks/pdf'
  },
  //include this section
  generator: {
    // Triggers that specify when the PDF should be generated
    completionTrigger: new htmlPdf.CompletionTrigger.Timer(1000), // waits for 1 sec
    // The port to listen for Chrome (default: 9222)
    port: 9222 //this will be your default chrome remote debugging port
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants