'Error 111: Connection refused when trying to execute the backend server on Kubuntu works fine on macOS

I am following a Udemy Course and here is the final GitHub repo link :- https://github.com/15Dkatz/python-blockchain-tutorial

I have installed all the required node modules and dependencies.

Here is the error which i am facing while starting the backend.

Traceback (most recent call last): File "/usr/lib/python3.8/runpy.py", line 185, in _run_module_as_main

mod_name, mod_spec, code = _get_module_details(mod_name, _Error)

File "/usr/lib/python3.8/runpy.py", line 144, in _get_module_details

return _get_module_details(pkg_main_name, error)

File "/usr/lib/python3.8/runpy.py", line 111, in _get_module_details

import(pkg_name)

File "/home/akshay/Downloads/python-blockchain/backend/app/init.py", line 98, in

result = requests.get(f'http://localhost:{ROOT_PORT}/blockchain')

File "/usr/lib/python3/dist-packages/requests/api.py", line 75, in get

return request('get', url, params=params, **kwargs)

File "/usr/lib/python3/dist-packages/requests/api.py", line 60, in request

return session.request(method=method, url=url, **kwargs)

File "/usr/lib/python3/dist-packages/requests/sessions.py", line 533, in request resp = self.send(prep, **send_kwargs) File "/usr/lib/python3/dist-packages/requests/sessions.py", line 646, in send

 r = adapter.send(request, **kwargs)

File "/usr/lib/python3/dist-packages/requests/adapters.py", line 516, in send

raise ConnectionError(e, request=request)

requests.exceptions.ConnectionError: `HTTPConnectionPool(host='localhost', port=5000)`: Max retries exceeded with url: /blockchain (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fa56aca3670>: Failed to establish a new connection: [Errno 111] Connection refused'))


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source