schickling/chromeless

IOT endpoint Timed out after 30sec. Connection couldn't be established.

Open

#99 opened on Jul 30, 2017

View on GitHub
 (50 comments) (5 reactions) (0 assignees)TypeScript (13,240 stars) (606 forks)batch import
Proxyhelp wantedquestion

Description

Hi,

I keep running into the following issue when trying to call the proxy chrome set up when I try call chromeless with the remote set up.

"Timed out after 30sec. Connection couldn't be established."

I tried from Windows, Ubuntu and from another AWS Lambda always resulting in the above error message.

Have completed step 1 for the proxy set up and deployed The Proxy service to AWS Lambda.

Steps I have done

  • Changed the url for awsIotHost in the serverless.yml
  • Changed region in the serverless.yml
  • ran npm run deploy successfully and made note of the api key and url.

But the after that I am unable to call this proxy without running into the error "Timed out after 30sec. Connection couldn't be established.".

The script I am running is pretty simple i.e.

  const chromeless = new Chromeless({
    remote: {
      endpointUrl: 'https://xxxxxxxxxx.execute-api.eu-west-1.amazonaws.com/dev',
      apiKey: mykey
    }
  });

const links = await chromeless
    .goto('https://www.google.com')
    .type('chromeless', 'input[name="q"]')
    .press(13)
    .wait('#resultStats')
    .evaluate(() => {
      // this will be executed in headless chrome
      const links = [].map.call(document.querySelectorAll('.g h3 a'), a => ({
        title: a.innerText,
        href: a.href
      }));
      return JSON.stringify(links);
    })
    // you can still use the method chaining API after evaluating
    // when you're done, at any time you can call `.then` (in our case `await`)
    .scrollTo(0, 1000);

Always results in

node chrome.js Error: Timed out after 30sec. Connection couldn't be established. at Timeout._onTimeout (C:\dev\cb-headless-chrome\node_modules\chromeless\dist\src\chrome\remote.js:73:52) at ontimeout (timers.js:488:11) at tryOnTimeout (timers.js:323:5) at Timer.listOnTimeout (timers.js:283:5)

Is there some kind of permission, role I need that maybe is not in the documentation ?

Would love some help since I have no idea how to progress on this, even some idea which url it can't connect to ?

EDIT : After some more debugging I am finding its the IOT Host url that I can't connect to i.e.

wss://xxxxxxx.iot.eu-west-1.amazon.com/.....

Is there a step I am missing to allow connection to this ? I can see when I put my IOT endpoint url I can see the same kind of timeout behaviour.

Contributor guide