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.

deploy script returns 'Exception in thread Thread-1:'…sometimes

See original GitHub issue
  • brownie Version: latest
  • OS: osx

running a deploy script which deploys a couple contracts then makes calls to them which previously worked now returning big error trace, something about a 502 bad gateway from binance seed

brownie console --network bsc-test

then

run('deploy')

sometimes the error comes immediately sometimes after a few calls

full stack trace:

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/threading.py", line 954, in _bootstrap_inner
    self.run()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/threading.py", line 892, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/mac/.local/pipx/venvs/eth-brownie/lib/python3.9/site-packages/brownie/network/middlewares/caching.py", line 142, in block_filter_loop
    new_blocks = self.block_filter.get_new_entries()
  File "/Users/mac/.local/pipx/venvs/eth-brownie/lib/python3.9/site-packages/web3/_utils/filters.py", line 164, in get_new_entries
    log_entries = self._filter_valid_entries(self.eth_module.get_filter_changes(self.filter_id))
  File "/Users/mac/.local/pipx/venvs/eth-brownie/lib/python3.9/site-packages/web3/module.py", line 58, in caller
    result = w3.manager.request_blocking(method_str, params, error_formatters)
  File "/Users/mac/.local/pipx/venvs/eth-brownie/lib/python3.9/site-packages/web3/manager.py", line 154, in request_blocking
    response = self._make_request(method, params)
  File "/Users/mac/.local/pipx/venvs/eth-brownie/lib/python3.9/site-packages/web3/manager.py", line 133, in _make_request
    return request_func(method, params)
  File "/Users/mac/.local/pipx/venvs/eth-brownie/lib/python3.9/site-packages/brownie/network/middlewares/caching.py", line 179, in process_request
    return make_request(method, params)
  File "cytoolz/functoolz.pyx", line 250, in cytoolz.functoolz.curry.__call__
  File "/Users/mac/.local/pipx/venvs/eth-brownie/lib/python3.9/site-packages/web3/middleware/formatting.py", line 76, in apply_formatters
    response = make_request(method, params)
  File "/Users/mac/.local/pipx/venvs/eth-brownie/lib/python3.9/site-packages/web3/middleware/gas_price_strategy.py", line 34, in middleware
    return make_request(method, params)
  File "cytoolz/functoolz.pyx", line 250, in cytoolz.functoolz.curry.__call__
  File "/Users/mac/.local/pipx/venvs/eth-brownie/lib/python3.9/site-packages/web3/middleware/formatting.py", line 76, in apply_formatters
    response = make_request(method, params)
  File "/Users/mac/.local/pipx/venvs/eth-brownie/lib/python3.9/site-packages/web3/middleware/attrdict.py", line 33, in middleware
    response = make_request(method, params)
  File "cytoolz/functoolz.pyx", line 250, in cytoolz.functoolz.curry.__call__
  File "/Users/mac/.local/pipx/venvs/eth-brownie/lib/python3.9/site-packages/web3/middleware/formatting.py", line 76, in apply_formatters
    response = make_request(method, params)
  File "/Users/mac/.local/pipx/venvs/eth-brownie/lib/python3.9/site-packages/web3/middleware/normalize_errors.py", line 25, in middleware
    result = make_request(method, params)
  File "cytoolz/functoolz.pyx", line 250, in cytoolz.functoolz.curry.__call__
  File "/Users/mac/.local/pipx/venvs/eth-brownie/lib/python3.9/site-packages/web3/middleware/formatting.py", line 76, in apply_formatters
    response = make_request(method, params)
  File "cytoolz/functoolz.pyx", line 250, in cytoolz.functoolz.curry.__call__
  File "/Users/mac/.local/pipx/venvs/eth-brownie/lib/python3.9/site-packages/web3/middleware/formatting.py", line 76, in apply_formatters
    response = make_request(method, params)
  File "/Users/mac/.local/pipx/venvs/eth-brownie/lib/python3.9/site-packages/brownie/network/middlewares/catch_tx_revert.py", line 24, in process_request
    result = make_request(method, params)
  File "/Users/mac/.local/pipx/venvs/eth-brownie/lib/python3.9/site-packages/brownie/network/middlewares/geth_poa.py", line 21, in process_request
    return middleware_fn(method, params)
  File "cytoolz/functoolz.pyx", line 250, in cytoolz.functoolz.curry.__call__
  File "/Users/mac/.local/pipx/venvs/eth-brownie/lib/python3.9/site-packages/web3/middleware/formatting.py", line 76, in apply_formatters
    response = make_request(method, params)
  File "/Users/mac/.local/pipx/venvs/eth-brownie/lib/python3.9/site-packages/web3/middleware/exception_retry_request.py", line 104, in middleware
    return make_request(method, params)
  File "/Users/mac/.local/pipx/venvs/eth-brownie/lib/python3.9/site-packages/web3/providers/rpc.py", line 92, in make_request
    raw_response = make_post_request(
  File "/Users/mac/.local/pipx/venvs/eth-brownie/lib/python3.9/site-packages/web3/_utils/request.py", line 40, in make_post_request
    response.raise_for_status()
  File "/Users/mac/.local/pipx/venvs/eth-brownie/lib/python3.9/site-packages/requests/models.py", line 943, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 502 Server Error: Bad Gateway for url: https://data-seed-prebsc-1-s1.binance.org:8545/
Exception in thread Thread-7:
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/threading.py", line 954, in _bootstrap_inner
    self.run()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/threading.py", line 892, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/mac/.local/pipx/venvs/eth-brownie/lib/python3.9/site-packages/brownie/network/transaction.py", line 447, in _await_confirmation
    sender_nonce = web3.eth.get_transaction_count(str(self.sender))
  File "/Users/mac/.local/pipx/venvs/eth-brownie/lib/python3.9/site-packages/web3/module.py", line 58, in caller
    result = w3.manager.request_blocking(method_str, params, error_formatters)
  File "/Users/mac/.local/pipx/venvs/eth-brownie/lib/python3.9/site-packages/web3/manager.py", line 154, in request_blocking
    response = self._make_request(method, params)
  File "/Users/mac/.local/pipx/venvs/eth-brownie/lib/python3.9/site-packages/web3/manager.py", line 133, in _make_request
    return request_func(method, params)
  File "/Users/mac/.local/pipx/venvs/eth-brownie/lib/python3.9/site-packages/brownie/network/middlewares/caching.py", line 206, in process_request
    response = make_request(method, params)
  File "cytoolz/functoolz.pyx", line 250, in cytoolz.functoolz.curry.__call__
  File "/Users/mac/.local/pipx/venvs/eth-brownie/lib/python3.9/site-packages/web3/middleware/formatting.py", line 76, in apply_formatters
    response = make_request(method, params)
  File "/Users/mac/.local/pipx/venvs/eth-brownie/lib/python3.9/site-packages/web3/middleware/gas_price_strategy.py", line 34, in middleware
    return make_request(method, params)
  File "cytoolz/functoolz.pyx", line 250, in cytoolz.functoolz.curry.__call__
  File "/Users/mac/.local/pipx/venvs/eth-brownie/lib/python3.9/site-packages/web3/middleware/formatting.py", line 74, in apply_formatters
    response = make_request(method, formatted_params)
  File "/Users/mac/.local/pipx/venvs/eth-brownie/lib/python3.9/site-packages/web3/middleware/attrdict.py", line 33, in middleware
    response = make_request(method, params)
  File "cytoolz/functoolz.pyx", line 250, in cytoolz.functoolz.curry.__call__
  File "/Users/mac/.local/pipx/venvs/eth-brownie/lib/python3.9/site-packages/web3/middleware/formatting.py", line 74, in apply_formatters
    response = make_request(method, formatted_params)
  File "/Users/mac/.local/pipx/venvs/eth-brownie/lib/python3.9/site-packages/web3/middleware/normalize_errors.py", line 25, in middleware
    result = make_request(method, params)
  File "cytoolz/functoolz.pyx", line 250, in cytoolz.functoolz.curry.__call__
  File "/Users/mac/.local/pipx/venvs/eth-brownie/lib/python3.9/site-packages/web3/middleware/formatting.py", line 76, in apply_formatters
    response = make_request(method, params)
  File "cytoolz/functoolz.pyx", line 250, in cytoolz.functoolz.curry.__call__
  File "/Users/mac/.local/pipx/venvs/eth-brownie/lib/python3.9/site-packages/web3/middleware/formatting.py", line 74, in apply_formatters
    response = make_request(method, formatted_params)
  File "/Users/mac/.local/pipx/venvs/eth-brownie/lib/python3.9/site-packages/brownie/network/middlewares/catch_tx_revert.py", line 24, in process_request
    result = make_request(method, params)
  File "/Users/mac/.local/pipx/venvs/eth-brownie/lib/python3.9/site-packages/brownie/network/middlewares/geth_poa.py", line 21, in process_request
    return middleware_fn(method, params)
  File "cytoolz/functoolz.pyx", line 250, in cytoolz.functoolz.curry.__call__
  File "/Users/mac/.local/pipx/venvs/eth-brownie/lib/python3.9/site-packages/web3/middleware/formatting.py", line 76, in apply_formatters
    response = make_request(method, params)
  File "/Users/mac/.local/pipx/venvs/eth-brownie/lib/python3.9/site-packages/web3/middleware/exception_retry_request.py", line 104, in middleware
    return make_request(method, params)
  File "/Users/mac/.local/pipx/venvs/eth-brownie/lib/python3.9/site-packages/web3/providers/rpc.py", line 92, in make_request
    raw_response = make_post_request(
  File "/Users/mac/.local/pipx/venvs/eth-brownie/lib/python3.9/site-packages/web3/_utils/request.py", line 40, in make_post_request
    response.raise_for_status()
  File "/Users/mac/.local/pipx/venvs/eth-brownie/lib/python3.9/site-packages/requests/models.py", line 943, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 502 Server Error: Bad Gateway for url: https://data-seed-prebsc-1-s1.binance.org:8545/

like i said was working fine before

possible related to this

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
iamdefinitelyahumancommented, Jul 24, 2021

Great to hear! I’m gonna leave this open a bit longer in case the issue still persists for anyone else - i’m only 95% sure I fixed it.

0reactions
liam-otcommented, Jul 24, 2021

@iamdefinitelyahuman well i spoke too soon, issue has popped back up, same error stack trace

Read more comments on GitHub >

github_iconTop Results From Across the Web

Exception in thread · Issue #17 - GitHub
My app often crashes when it exits with a paramiko-related traceback. The crashes happen with Paramiko 1.7.7.1 and Python 2.7.2 (on Mac OS...
Read more >
How to catch an Exception from a thread - java - Stack Overflow
An exception that is thrown in a thread and never caught terminates it, which is why join returns on your main thread, but...
Read more >
An Intro to Threading in Python
When Thread 1 starts, FakeDatabase.value is zero. The first line of code in the method, local_copy = self.value , copies the value zero...
Read more >
Python Threading: The Complete Guide
The Python Threading module allows you to create and manage new threads of execution in Python. Although the threads have been available ...
Read more >
Python - Multithreaded Programming - Tutorialspoint
When function returns, the thread terminates. Here, args is a tuple of arguments; use an empty tuple to call function without passing any...
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