Skip to content

Instantly share code, notes, and snippets.

@sudipt1999
Last active February 22, 2020 17:37
Show Gist options
  • Save sudipt1999/62f18a3293b545d76ac94c1c97c49218 to your computer and use it in GitHub Desktop.
Save sudipt1999/62f18a3293b545d76ac94c1c97c49218 to your computer and use it in GitHub Desktop.
Error While Running the command ```python3 app.py```
```
(venv) sudipt@sudo-dev:~/Desktop/hydra-python-agent-gui$ python3 app.py
Traceback (most recent call last):
File "/home/sudipt/Desktop/hydra-python-agent-gui/venv/lib/python3.6/site-packages/urllib3/connection.py", line 157, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw
File "/home/sudipt/Desktop/hydra-python-agent-gui/venv/lib/python3.6/site-packages/urllib3/util/connection.py", line 84, in create_connection
raise err
File "/home/sudipt/Desktop/hydra-python-agent-gui/venv/lib/python3.6/site-packages/urllib3/util/connection.py", line 74, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/sudipt/Desktop/hydra-python-agent-gui/venv/lib/python3.6/site-packages/urllib3/connectionpool.py", line 672, in urlopen
chunked=chunked,
File "/home/sudipt/Desktop/hydra-python-agent-gui/venv/lib/python3.6/site-packages/urllib3/connectionpool.py", line 387, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/usr/lib/python3.6/http/client.py", line 1254, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/lib/python3.6/http/client.py", line 1300, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/lib/python3.6/http/client.py", line 1249, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/lib/python3.6/http/client.py", line 1036, in _send_output
self.send(msg)
File "/usr/lib/python3.6/http/client.py", line 974, in send
self.connect()
File "/home/sudipt/Desktop/hydra-python-agent-gui/venv/lib/python3.6/site-packages/urllib3/connection.py", line 184, in connect
conn = self._new_conn()
File "/home/sudipt/Desktop/hydra-python-agent-gui/venv/lib/python3.6/site-packages/urllib3/connection.py", line 169, in _new_conn
self, "Failed to establish a new connection: %s" % e
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7fb5b222b2b0>: Failed to establish a new connection: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/sudipt/Desktop/hydra-python-agent-gui/venv/lib/python3.6/site-packages/requests/adapters.py", line 449, in send
timeout=timeout
File "/home/sudipt/Desktop/hydra-python-agent-gui/venv/lib/python3.6/site-packages/urllib3/connectionpool.py", line 720, in urlopen
method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
File "/home/sudipt/Desktop/hydra-python-agent-gui/venv/lib/python3.6/site-packages/urllib3/util/retry.py", line 436, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8080): Max retries exceeded with url: /serverapi/vocab (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fb5b222b2b0>: Failed to establish a new connection: [Errno 111] Connection refused',))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "app.py", line 15, in <module>
agent = Agent(url)
File "/home/sudipt/Desktop/hydra-python-agent-gui/venv/src/hydra-agent/hydra_agent/agent.py", line 30, in __init__
self.fetch_apidoc()
File "/home/sudipt/Desktop/hydra-python-agent-gui/venv/src/hydra-agent/hydra_agent/agent.py", line 47, in fetch_apidoc
jsonld_api_doc = super().get(self.entrypoint_url + '/vocab').json()
File "/home/sudipt/Desktop/hydra-python-agent-gui/venv/lib/python3.6/site-packages/requests/sessions.py", line 543, in get
return self.request('GET', url, **kwargs)
File "/home/sudipt/Desktop/hydra-python-agent-gui/venv/lib/python3.6/site-packages/requests/sessions.py", line 530, in request
resp = self.send(prep, **send_kwargs)
File "/home/sudipt/Desktop/hydra-python-agent-gui/venv/lib/python3.6/site-packages/requests/sessions.py", line 643, in send
r = adapter.send(request, **kwargs)
File "/home/sudipt/Desktop/hydra-python-agent-gui/venv/lib/python3.6/site-packages/requests/adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8080): Max retries exceeded with url: /serverapi/vocab (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fb5b222b2b0>: Failed to establish a new connection: [Errno 111] Connection refused',))
```
@sudipt1999
Copy link
Author

I am using Ubuntu 18.04 LTS, I followed the instruction and started RedisGraph locally then when I am running python3 app.py I am getting the above error below is the log of RedisGraph.

(venv) sudipt@sudo-dev:~/Desktop/hydra-python-agent-gui$ sudo docker run -p 6379:6379 -it --rm redislabs/redisgraph:2.0-edge
Unable to find image 'redislabs/redisgraph:2.0-edge' locally
2.0-edge: Pulling from redislabs/redisgraph
743f2d6c1f65: Pull complete 
171658c5966d: Pull complete 
fbef10bd7a65: Pull complete 
0b0b11956c72: Pull complete 
09dbd716637e: Pull complete 
d09046fd4481: Pull complete 
565d15b91e1f: Pull complete 
49d3edb7a82b: Pull complete 
Digest: sha256:7b0387fd2e371535205bd67ef812ee6ecb5b5cf5f4b18c8993f02954314b42a8
Status: Downloaded newer image for redislabs/redisgraph:2.0-edge
1:C 22 Feb 2020 17:28:19.598 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:C 22 Feb 2020 17:28:19.598 # Redis version=5.0.5, bits=64, commit=00000000, modified=0, pid=1, just started
1:C 22 Feb 2020 17:28:19.598 # Configuration loaded
                _._                                                  
           _.-``__ ''-._                                             
      _.-``    `.  `_.  ''-._           Redis 5.0.5 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._                                   
 (    '      ,       .-`  | `,    )     Running in standalone mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
 |    `-._   `._    /     _.-'    |     PID: 1
  `-._    `-._  `-./  _.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |           http://redis.io        
  `-._    `-._`-.__.-'_.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |                                  
  `-._    `-._`-.__.-'_.-'    _.-'                                   
      `-._    `-.__.-'    _.-'                                       
          `-._        _.-'                                           
              `-.__.-'                                               

1:M 22 Feb 2020 17:28:19.600 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
1:M 22 Feb 2020 17:28:19.600 # Server initialized
1:M 22 Feb 2020 17:28:19.600 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
1:M 22 Feb 2020 17:28:19.600 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
1:M 22 Feb 2020 17:28:19.607 * <graph> Thread pool created, using 8 threads.
1:M 22 Feb 2020 17:28:19.607 * Module 'graph' loaded from /usr/lib/redis/modules/redisgraph.so
1:M 22 Feb 2020 17:28:19.607 * Ready to accept connections

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment