pusher / pusher-http-python

Pusher Channels HTTP API library for Python
https://pusher.com/docs/server_api_guide
MIT License
375 stars 112 forks source link

Trying to call order_book but failed #98

Closed zlwolf236 closed 6 years ago

zlwolf236 commented 7 years ago

I'm trying to call the orderbook using the code below

    BitTrigger = BitPusher.trigger([u'order_book_xrpusd'],
                                    u'data',
                                    u'bids')

However, i received the error of these things, can somebody explain this to me? Very much appreciated! Thank you (I believe sensitive code were removed)

Traceback (most recent call last):
  File "/Users/Wolf/Library/Python/3.5/lib/python/site-packages/requests/packages/urllib3/connection.py", line 141, in _new_conn
    (self.host, self.port), self.timeout, **extra_kw)
  File "/Users/Wolf/Library/Python/3.5/lib/python/site-packages/requests/packages/urllib3/util/connection.py", line 60, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/socket.py", line 732, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 8] nodename nor servname provided, or not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/Wolf/Library/Python/3.5/lib/python/site-packages/requests/packages/urllib3/connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "/Users/Wolf/Library/Python/3.5/lib/python/site-packages/requests/packages/urllib3/connectionpool.py", line 345, in _make_request
    self._validate_conn(conn)
  File "/Users/Wolf/Library/Python/3.5/lib/python/site-packages/requests/packages/urllib3/connectionpool.py", line 844, in _validate_conn
    conn.connect()
  File "/Users/Wolf/Library/Python/3.5/lib/python/site-packages/requests/packages/urllib3/connection.py", line 284, in connect
    conn = self._new_conn()
  File "/Users/Wolf/Library/Python/3.5/lib/python/site-packages/requests/packages/urllib3/connection.py", line 150, in _new_conn
    self, "Failed to establish a new connection: %s" % e)
requests.packages.urllib3.exceptions.NewConnectionError: <requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x108b17470>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/Wolf/Library/Python/3.5/lib/python/site-packages/requests/adapters.py", line 423, in send
    timeout=timeout
  File "/Users/Wolf/Library/Python/3.5/lib/python/site-packages/requests/packages/urllib3/connectionpool.py", line 649, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/Users/Wolf/Library/Python/3.5/lib/python/site-packages/requests/packages/urllib3/util/retry.py", line 376, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
requests.packages.urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api-cluster.pusher.com', port=443): Max retries exceeded with url: /apps/421841/events?auth_key=<Key_ID>&auth_signature=<signature>&auth_timestamp=1500003356&auth_version=1.0&body_md5=74dbf86a8478373e22d3f1cf56b07add (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x108b17470>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/Wolf/Documents/Bitcoin Market Making/VariousExchangeTrade/CrossExchangeArbitrage", line 162, in <module>
    u'bids')
  File "/Users/Wolf/Library/Python/3.5/lib/python/site-packages/pusher/pusher.py", line 117, in trigger
    channels, event_name, data, socket_id)
  File "/Users/Wolf/Library/Python/3.5/lib/python/site-packages/pusher/http.py", line 31, in __call__
    return self.client.http.send_request(self.make_request(*args, **kwargs))
  File "/Users/Wolf/Library/Python/3.5/lib/python/site-packages/pusher/requests.py", line 44, in send_request
    **self.options)
  File "/Users/Wolf/Library/Python/3.5/lib/python/site-packages/requests/sessions.py", line 488, in request
    resp = self.send(prep, **send_kwargs)
  File "/Users/Wolf/Library/Python/3.5/lib/python/site-packages/requests/sessions.py", line 609, in send
    r = adapter.send(request, **kwargs)
  File "/Users/Wolf/Library/Python/3.5/lib/python/site-packages/requests/adapters.py", line 487, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='api-cluster.pusher.com', port=443): Max retries exceeded with url: /apps/421841/events?auth_key=<KeyID>&auth_signature=<Signature_ID>&auth_timestamp=1500003356&auth_version=1.0&body_md5=74dbf86a8478373e22d3f1cf56b07add (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x108b17470>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known',))
callum-oakley commented 7 years ago

I'm not immediately sure what's going on here. Is BitPusher a normal pusher object? Can you successfully trigger events to standard pusher channels using the quick start snippets from the dashboard?

WillSewell commented 6 years ago

Closing due to lack of response. Feel free to re-open if you can provide us with more information.