karma-sauce-launcher icon indicating copy to clipboard operation
karma-sauce-launcher copied to clipboard

Uncaught TypeError: Cannot read property 'deleteSession' of null

Open Krinkle opened this issue 4 years ago • 2 comments

Environment:

  • GitHub Actions, ubuntu-20.04
  • Node.js 14.15.1 (latest LTS, also affects Node.js 12 and Node.js 10)
  • [email protected] (latest, also affects 4.3.3 and 4.3.2)
  • [email protected] (latest)

Example at https://github.com/Krinkle/kiwix-js/runs/1620210786?check_suite_focus=true

Tue, 29 Dec 2020 04:22:39 GMT > karma start tests/karma.conf.saucelabs.js

Tue, 29 Dec 2020 04:23:40 GMT … WARN [launcher]: firefox   on SauceLabs have not captured in 60000 ms, killing.
Tue, 29 Dec 2020 04:23:40 GMT … ERROR [SaucelabsLauncher]: Could not quit the Saucelabs selenium connection.
  Failure message:
  TypeError: Cannot read property 'deleteSession' of null
    at SaucelabsLauncher.<anonymous> (/home/runner/work/kiwix-js/kiwix-js/node_modules/karma-sauce-launcher/dist/launcher/launcher.js:139:26)
    at Generator.next (<anonymous>)
    at /home/runner/work/kiwix-js/kiwix-js/node_modules/karma-sauce-launcher/dist/launcher/launcher.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (/home/runner/work/kiwix-js/kiwix-js/node_modules/karma-sauce-launcher/dist/launcher/launcher.js:4:12)
    at SaucelabsLauncher.<anonymous> (/home/runner/work/kiwix-js/kiwix-js/node_modules/karma-sauce-launcher/dist/launcher/launcher.js:131:31)
    at SaucelabsLauncher.emit (events.js:315:20)
    at SaucelabsLauncher.EventEmitter.emit (domain.js:486:12)
    at SaucelabsLauncher.emitAsync (/home/runner/work/kiwix-js/kiwix-js/node_modules/karma/lib/events.js:52:10)
    at SaucelabsLauncher.BaseLauncher.kill (/home/runner/work/kiwix-js/kiwix-js/node_modules/karma/lib/launchers/base.js:61:27)

Tue, 29 Dec 2020 04:23:40 GMT … WARN [launcher]: chrome   on SauceLabs have not captured in 60000 ms, killing.
…

Tue, 29 Dec 2020 04:23:40 GMT … WARN [launcher]: MicrosoftEdge 15.15063  on SauceLabs have not captured in 60000 ms, killing.
…

Tue, 29 Dec 2020 04:23:40 GMT … WARN [launcher]: MicrosoftEdge 18.17763  on SauceLabs have not captured in 60000 ms, killing.
…

It works fine from my machine with Node.js 10.15.2 on Debian 9 Stretch (via Docker for Mac), and it used to work fine on Travis CI, but now on GitHub Actions I can't get it work.

I've tried everything I could think of, including different Node.js versions and the latest versions of dependencies, and verifying that credentials are making it through.

As you can see from the timestamps, it happens immediately upon startup, so contrary to the warning, it is not a timeout. (The error message itself might be a secondary problem, as that led to some additional confusion initially.)

Krinkle avatar Dec 30 '20 01:12 Krinkle

Nevermind. I eventually figured out that the issue was that the connection wasn't being estalished in the first place because the SAUCE_ACCESS_KEY was missing. I mistakenly assumed that GitHub Actions would work similarly to Travis CI and allow forked repositories to provide their own secrets. But, despite GitHub happily allowing you to configure secrets in a forked repo, these are completely ignored.

It might be good if karma-sauce-launcher would give a better error message since there is nothing in the above that suggests incorrect or missing credentials, or indeed anything about the connection not being established.

The two errors shown are both "wrong", there is no 60s timeout reached, and there is no issue in quiting the connection. There was never a connection in the first place.

If that's a valid issue and not an upstream issue, great. Otherwise, feel free to close this :)

Krinkle avatar Dec 30 '20 03:12 Krinkle

I want to work on this issue as I am new so please guide me through.

sakshiiii38 avatar Jan 07 '21 10:01 sakshiiii38