Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BITSTAMP - SSL error - ClientResponseError: 404, message='Not Found' #152

Closed
xiandong79 opened this issue Sep 3, 2019 · 10 comments
Closed

Comments

@xiandong79
Copy link
Contributor

xiandong79 commented Sep 3, 2019

    BITSTAMP:
        l2_book:
            symbols: [BTC-USD, ETH-USD, XRP-USD, LTC-USD, BCH-USD, ETH-BTC, LTC-BTC, XRP-BTC, BCH-BTC]
            book_depth: 100
        trades: [BTC-USD, ETH-USD, XRP-USD, LTC-USD, BCH-USD, ETH-BTC, LTC-BTC, XRP-BTC, BCH-BTC]
SSL error in data received
protocol: <asyncio.sslproto.SSLProtocol object at 0x7fccd5219390>
transport: <_SelectorSocketTransport fd=22 read=polling write=<idle, bufsize=0>>
Traceback (most recent call last):
  File "/usr/lib/python3.7/asyncio/sslproto.py", line 526, in data_received
    ssldata, appdata = self._sslpipe.feed_ssldata(data)
  File "/usr/lib/python3.7/asyncio/sslproto.py", line 207, in feed_ssldata
    self._sslobj.unwrap()
  File "/usr/lib/python3.7/ssl.py", line 767, in unwrap
    return self._sslobj.shutdown()
ssl.SSLError: [SSL: KRB5_S_INIT] application data after close notify (_ssl.c:2609)
SSL error in data received
protocol: <asyncio.sslproto.SSLProtocol object at 0x7fccd5219588>
transport: <_SelectorSocketTransport fd=25 read=polling write=<idle, bufsize=0>>
Traceback (most recent call last):
  File "/usr/lib/python3.7/asyncio/sslproto.py", line 526, in data_received
    ssldata, appdata = self._sslpipe.feed_ssldata(data)
  File "/usr/lib/python3.7/asyncio/sslproto.py", line 207, in feed_ssldata
    self._sslobj.unwrap()
  File "/usr/lib/python3.7/ssl.py", line 767, in unwrap
    return self._sslobj.shutdown()
ssl.SSLError: [SSL: KRB5_S_INIT] application data after close notify (_ssl.c:2609)
2019-09-03 14:14:48,892 : ERROR : BITSTAMP: encountered an exception, reconnecting
Traceback (most recent call last):
  File "/home/dong/.local/lib/python3.7/site-packages/cryptofeed/feedhandler.py", line 178, in _connect
    await feed.subscribe(websocket)
  File "/home/dong/.local/lib/python3.7/site-packages/cryptofeed/exchange/bitstamp.py", line 175, in subscribe
    await self._snapshot(snaps)
  File "/home/dong/.local/lib/python3.7/site-packages/cryptofeed/exchange/bitstamp.py", line 147, in _snapshot
    results = await asyncio.gather(*[fetch(session, url) for url in urls])
  File "/home/dong/.local/lib/python3.7/site-packages/cryptofeed/exchange/bitstamp.py", line 143, in fetch
    response.raise_for_status()
  File "/usr/local/lib/python3.7/dist-packages/aiohttp/client_reqrep.py", line 942, in raise_for_status
    headers=self.headers)
aiohttp.client_exceptions.ClientResponseError: 404, message='Not Found'

with the latest code of the cryptostore and cryptofeed

This error happens after I git pull the latest code and relaunch the cryptostore program

@xiandong79 xiandong79 changed the title BITSTAMP ClientResponseError: 404, message='Not Found' BITSTAMP - SSL error - ClientResponseError: 404, message='Not Found' Sep 3, 2019
@xiandong79
Copy link
Contributor Author

xiandong79 commented Sep 3, 2019

aio-libs/aiohttp#3535

it seems that it is a Python problem.

I am using python 3.7.3

@bmoscon
Copy link
Owner

bmoscon commented Sep 3, 2019

The bug report seems to indicate you should upgrade to 3.7.4, but not sure if that will actually fix it or not

@ghost
Copy link

ghost commented Sep 9, 2019

@bmoscon

The bug report seems to indicate you should upgrade to 3.7.4, but not sure if that will actually fix it or not

Not working with 3.7.4, still got 404

f = FeedHandler()
f.add_feed(Bitstamp(channels=[L2_BOOK], pairs=['BTC-USD', 'ETH-USD'], callbacks={L2_BOOK: BookRabbit(depth=1)}))
f.run()
2019-09-09 19:10:10,160 : ERROR : BITSTAMP: encountered an exception, reconnecting
Traceback (most recent call last):
  File "/home/ubuntu/miniconda3/lib/python3.7/site-packages/cryptofeed-1.0.1-py3.7.egg/cryptofeed/feedhandler.py", line 178, in _connect
    await feed.subscribe(websocket)
  File "/home/ubuntu/miniconda3/lib/python3.7/site-packages/cryptofeed-1.0.1-py3.7.egg/cryptofeed/exchange/bitstamp.py", line 175, in subscribe
    await self._snapshot(snaps)
  File "/home/ubuntu/miniconda3/lib/python3.7/site-packages/cryptofeed-1.0.1-py3.7.egg/cryptofeed/exchange/bitstamp.py", line 147, in _snapshot
    results = await asyncio.gather(*[fetch(session, url) for url in urls])
  File "/home/ubuntu/miniconda3/lib/python3.7/site-packages/cryptofeed-1.0.1-py3.7.egg/cryptofeed/exchange/bitstamp.py", line 143, in fetch
    response.raise_for_status()
  File "/home/ubuntu/miniconda3/lib/python3.7/site-packages/aiohttp-4.0.0a0-py3.7-linux-x86_64.egg/aiohttp/client_reqrep.py", line 942, in raise_for_status
    headers=self.headers)
aiohttp.client_exceptions.ClientResponseError: 404, message='Not Found'

@xiandong79 xiandong79 reopened this Sep 9, 2019
@ghost
Copy link

ghost commented Sep 9, 2019

I can sub with 'BTC-USD' pair, but the 'ETH-USD', 'XRP-USD', 'LTC-USD'... pairs got 404 error.

@bmoscon
Copy link
Owner

bmoscon commented Sep 9, 2019

nothing i can do about this - it works for me, its likely an issue with your certs, isp, etc. Cryptofeed doesnt do any SSL handling directly, its all done via the 3rd party libraries it uses

@ghost
Copy link

ghost commented Sep 10, 2019

The old version before 8c6aa44 commit works fine for me. probably has some bug in the 8c6aa44 commit.

@ghost
Copy link

ghost commented Sep 10, 2019

urls = [f'https://www.bitstamp.net/api/order_book/{sym}' for sym in pairs]

The URL https://www.bitstamp.net/api/order_book is fine, but I can't get a response from https://www.bitstamp.net/api/order_book/ltcusd or https://www.bitstamp.net/api/order_book/ethusd, etc. I think this where the problem is.

@ghost
Copy link

ghost commented Sep 10, 2019

urls = [f'https://www.bitstamp.net/api/order_book/{sym}' for sym in pairs]

The URL 'https://www.bitstamp.net/api/order_book/{sym}' should be 'https://www.bitstamp.net/api/v2/order_book/{sym}' for the alts pair, the URL
https://www.bitstamp.net/api/v2/order_book/ltcusd work as expected. I will create a pull request to fix this.

@ghost
Copy link

ghost commented Sep 10, 2019

@bmoscon 5586d97 Its been fixed.

@bmoscon
Copy link
Owner

bmoscon commented Sep 10, 2019

merged

@bmoscon bmoscon closed this as completed Sep 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants