eth-brownie / brownie

A Python-based development and testing framework for smart contracts targeting the Ethereum Virtual Machine.

Home Page:https://eth-brownie.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wrong Ganache port error handle

iurii2002 opened this issue · comments

commented

I was installing brownie and ganache on a fresh machine and while I was trying to use test I encounter error:
"....INTERNALERROR> FileNotFoundError: [WinError 2] The system cannot find the file specified..." (!!! Full version below)

The reason for this error was that my Ganache environment uses 7545 port and in brownie networks it had 8545 port.

It took my quite a while to find the reason of the error, so maybe there is a way to catch this error and provide more explicit explanation

long output:

PS C:\blockchain\solidity\my_farm> brownie test
INFO: Could not find files for the given pattern(s).
Brownie v1.19.2 - Python development framework for Ethereum

========================================================================= test session starts =========================================================================
platform win32 -- Python 3.10.1, pytest-6.2.5, py-1.11.0, pluggy-1.0.0
rootdir: C:\blockchain\solidity\my_farm
plugins: eth-brownie-1.19.2, hypothesis-6.27.3, forked-1.4.0, xdist-1.34.0, web3-5.31.1
collected 1 item
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "C:\Users\iurii\AppData\Local\Programs\Python\Python310\lib\site-packages_pytest\main.py", line 269, in wrap_session
INTERNALERROR> session.exitstatus = doit(config, session) or 0
INTERNALERROR> File "C:\Users\iurii\AppData\Local\Programs\Python\Python310\lib\site-packages_pytest\main.py", line 322, in _main
INTERNALERROR> config.hook.pytest_collection(session=session)
INTERNALERROR> File "C:\Users\iurii\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy_hooks.py", line 265, in call
INTERNALERROR> return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
INTERNALERROR> File "C:\Users\iurii\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy_manager.py", line 80, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR> File "C:\Users\iurii\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy_callers.py", line 60, in _multicall
INTERNALERROR> return outcome.get_result()
INTERNALERROR> File "C:\Users\iurii\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy_result.py", line 60, in get_result
INTERNALERROR> raise ex[1].with_traceback(ex[2])
INTERNALERROR> File "C:\Users\iurii\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy_callers.py", line 39, in _multicall
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "C:\Users\iurii\AppData\Local\Programs\Python\Python310\lib\site-packages_pytest\main.py", line 333, in pytest_collection
INTERNALERROR> session.perform_collect()
INTERNALERROR> File "C:\Users\iurii\AppData\Local\Programs\Python\Python310\lib\site-packages_pytest\main.py", line 641, in perform_collect
INTERNALERROR> hook.pytest_collection_finish(session=self)
INTERNALERROR> File "C:\Users\iurii\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy_hooks.py", line 265, in call
INTERNALERROR> return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
INTERNALERROR> File "C:\Users\iurii\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy_manager.py", line 80, in _hookexec
INTERNALERROR> return self.inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR> File "C:\Users\iurii\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy_callers.py", line 55, in multicall
INTERNALERROR> gen.send(outcome)
INTERNALERROR> File "C:\Users\iurii\AppData\Local\Programs\Python\Python310\lib\site-packages\brownie\test\managers\runner.py", line 258, in pytest_collection_finish
INTERNALERROR> brownie.network.connect(CONFIG.argv["network"])
INTERNALERROR> File "C:\Users\iurii\AppData\Local\Programs\Python\Python310\lib\site-packages\brownie\network\main.py", line 50, in connect
INTERNALERROR> rpc.launch(active["cmd"], **active["cmd_settings"])
INTERNALERROR> File "C:\Users\iurii\AppData\Local\Programs\Python\Python310\lib\site-packages\brownie\network\rpc_init
.py", line 76, in launch
INTERNALERROR> self.process = self.backend.launch(cmd, **kwargs)
INTERNALERROR> File "C:\Users\iurii\AppData\Local\Programs\Python\Python310\lib\site-packages\brownie\network\rpc\ganache.py", line 70, in launch
INTERNALERROR> ganache_version = get_ganache_version(cmd_list[0])
INTERNALERROR> File "C:\Users\iurii\AppData\Local\Programs\Python\Python310\lib\site-packages\brownie\network\rpc\ganache.py", line 111, in get_ganache_version
INTERNALERROR> ganache_version_proc = psutil.Popen([ganache_executable, "--version"], stdout=PIPE)
INTERNALERROR> File "C:\Users\iurii\AppData\Local\Programs\Python\Python310\lib\site-packages\psutil_init
.py", line 1316, in init
INTERNALERROR> self.__subproc = subprocess.Popen(*args, **kwargs)
INTERNALERROR> File "C:\Users\iurii\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 966, in init
INTERNALERROR> self._execute_child(args, executable, preexec_fn, close_fds,
INTERNALERROR> File "C:\Users\iurii\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 1435, in _execute_child
INTERNALERROR> hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
INTERNALERROR> FileNotFoundError: [WinError 2] The system cannot find the file specified