Error: sender doesn't have enough funds to send tx


#1

Due to some weird behaviour on the Contract container, I am getting this error in the JavaScript console of the DApp:
Error: sender doesn't have enough funds to send tx. The upfront cost is: 20000000000000000 and the sender's account only has: 0

This happens after loading the network, and the Contract container starts outputting such lines in fast succession, possibly using up all the funds:

contract_1  | web3_clientVersion
contract_1  | net_listening
contract_1  | net_peerCount
contract_1  | net_version
contract_1  | eth_getBalance
contract_1  | eth_getBalance
contract_1  | eth_getBalance
contract_1  | eth_getBalance
contract_1  | eth_getBalance
contract_1  | eth_getBalance
contract_1  | eth_getBalance
contract_1  | eth_getBalance
contract_1  | eth_getBalance
contract_1  | eth_getBalance
contract_1  | eth_sendTransaction
contract_1  | eth_sendTransaction
contract_1  | eth_sendTransaction
contract_1  | eth_sendTransaction
contract_1  | eth_sendTransaction
contract_1  | eth_sendTransaction
contract_1  | eth_sendTransaction
contract_1  | eth_sendTransaction
contract_1  | eth_sendTransaction
contract_1  | eth_blockNumber
contract_1  | eth_accounts

when usually I am used to a series of:

contract_1  | eth_getFilterChanges
contract_1  | eth_getFilterChanges
contract_1  | eth_getFilterChanges
contract_1  | eth_getFilterChanges

This happens (sometimes) even if I relaunch the network. I also tried to rebuild the containers without cache, with the same behaviour.

Does anyone know the cause of such behaviour?


#2

Hi @myked – just to make sure I understand your problem—

  • do you get this error every time, or sometimes?
  • does the error prevent the dapp from running?
  • this is new (started happening and you didn’t change anything on your setup)?

Thanks! Hope we can get to the bottom of it.


#3

Hello @ainsley, thank you for your questions.

  • I get this error/behaviour only sometimes. I tried restarting the network, restarting the machine and the behaviour stays the same (sometimes). I left the machine off for a couple of days, and now all was running fine. It seems to be unpredictable.
  • It prevents the Dapp from doing anything that requires gas, so wherever you managed to reach until the Contract container starts acting up. Contract deployment with truffle is also limited/not possible.
  • I didn’t change anything in the setup, it seemed to just happen. I run my network using ./launch.bash -s -t. It seemed to be happening if I run it more than once or if I run spawn_workers.bash 2 more than once, but I just tried now and could not reproduce it.

I am also not sure if a Dapp has to be running initially for this to start happening at all. It started happening when I had a Dapp running, but also got the same behaviour in the Contract container without a Dapp running.

I hope this helps to point to some direction!