question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tests randomly crashing at ProviderError.ExtendableError on Ubuntu (Linux)

See original GitHub issue
  • I’ve asked for help in the Truffle Gitter before filing this issue.

Issue

On a Ubuntu Linux environment (Trusty), tests randomly fail with this ExtendableError:

1) Contract: TopicEvent "after each" hook for "throws on an invalid result index":
Error: Could not connect to your Ethereum client. Please check that your Ethereum client:
    - is running
    - is accepting RPC connections (i.e., "--rpc" option is used in geth)
    - is accessible over the network
    - is properly configured in your Truffle configuration file (truffle.js)

      at ProviderError.ExtendableError (/home/travis/.nvm/versions/node/v8.9.3/lib/node_modules/truffle/build/cli.bundled.js:9401:17)
      at new ProviderError (/home/travis/.nvm/versions/node/v8.9.3/lib/node_modules/truffle/build/cli.bundled.js:325054:24)
      at /home/travis/.nvm/versions/node/v8.9.3/lib/node_modules/truffle/build/cli.bundled.js:325137:17
      at /home/travis/.nvm/versions/node/v8.9.3/lib/node_modules/truffle/build/cli.bundled.js:325195:24
      at XMLHttpRequest.request.onreadystatechange (/home/travis/.nvm/versions/node/v8.9.3/lib/node_modules/truffle/build/cli.bundled.js:328229:7)
      at XMLHttpRequestEventTarget.dispatchEvent (/home/travis/.nvm/versions/node/v8.9.3/lib/node_modules/truffle/build/cli.bundled.js:176415:18)
      at XMLHttpRequest._setReadyState (/home/travis/.nvm/versions/node/v8.9.3/lib/node_modules/truffle/build/cli.bundled.js:176705:12)
      at XMLHttpRequest._onHttpRequestError (/home/travis/.nvm/versions/node/v8.9.3/lib/node_modules/truffle/build/cli.bundled.js:176895:12)
      at ClientRequest.<anonymous> (/home/travis/.nvm/versions/node/v8.9.3/lib/node_modules/truffle/build/cli.bundled.js:176765:24)
      at Socket.socketOnEnd (_http_client.js:423:9)
      at endReadableNT (_stream_readable.js:1056:12)
      at _combinedTickCallback (internal/process/next_tick.js:138:11)

Specifically, I have a Travis-CI (continuous integration) setup and this is where the tests are failing. My local Mac OSX environment passes these tests with no problem. Every once and a while, they will fail with the same error, but I just run the tests again and they pass.

I’d say it happens like 10-15% of the time on Mac OSX, but it happens like 60-80% of the time on the Travis-CI linux env.

It feels like it used to have this error less on earlier Truffle versions. I just updated to 4.0.4 and it seems way more often now.

Steps to Reproduce

  1. Clone this repo: https://github.com/bodhiproject/bodhi-core
  2. Use Truffle v4.0.4 on a Ubuntu Linux environment (see environment details)
  3. truffle test

Expected Behavior

Tests should pass like they do on Mac OSX env.

Actual Results

I test this on my local machine (mac osx), when all tests pass which they do, I push up to Github. Then it fires off a Travis-CI test on the linux env and fails pretty much every time.

Environment

Travis-CI Env (fails)

  • Operating System: Ubuntu 14.04 Trusty
  • Truffle version: 4.0.4
  • node version: v8.9.3
  • npm version: 5.5.1
  • nvm version: 0.33.8
  • Build language: node_js
  • Build group: stable
  • Build dist: trusty
  • Distributor ID: Ubuntu
  • Description: Ubuntu 14.04.5 LTS
  • Release: 14.04
  • Codename: trusty
  • Compiled with gcc 4.8.2 for Unix (Linux ELF) on Oct 21 2013.
  • OS/Arch: linux/amd64

Mac OSX Env (passes)

  • Mac OSX 10.12.6 Sierra
  • Truffle v4.0.4
  • node version: 8.9.1
  • npm version: 5.5.1

$ gcc --version:

Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 9.0.0 (clang-900.0.39.2)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:81 (31 by maintainers)

github_iconTop GitHub Comments

2reactions
cgeweckecommented, Aug 15, 2018

@benjamincburns Yes, it turns out this originates at web3 and they’re fixing it in beta.36.

(It was keep-alive - the change).

2reactions
barakmancommented, Apr 30, 2018

@cgewecke: I have removed all my root-level hooks, and i’m still encountering disconnections. However, in opposed to before, the errors that I am getting are always "after each" hook.... And to be absolutely clear on that, I don’t even have an afterEach hook in any of my tests! Maybe Mocha adds implicit calls to afterEach, when an explicit call to beforeEach exists in the code. However, so long as these implicit calls are not added at the root-level, it does not support my conjecture of hooked code running in the wrong scope to begin with. In short, I’m at a loss here…

By the way, in the code that you linked, there doesn’t seem to be support for the after hook, and I am using this hook in my tests.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ubuntu Server 20.04 randomly crashing
After updating the BIOS, memtest still failed. We tested various pairs of DIMMs in slots 1 & 2, and they all passed memtest...
Read more >
ErrorTracker - Ubuntu Wiki
Ubuntu's error tracker explains crashes, hangs, and other severe errors to end users; lets them report an error with the click of a...
Read more >
Frequent freezes and crashes in Ubuntu 20.04
Hi, I have very frequent crashes (rendering pycharm unusable) with a new machine that runs on ubuntu 20.04. I'm on kernel 5.4.0-29-generic.
Read more >
VSCode, Browsers Crashing at random Ubuntu 22.04
Edge, Firefox, Chrome all crash. I have replaced my ram, I have ran memory tests on the new and old memory. I have...
Read more >
Crashes — Blender Manual
On Linux, run top -o %MEM . Crash Log . When Blender crashes, it writes out a text file which contains information...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found