Skip to content

Websocket error on testnet for userdata stream #143

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

Closed
7 of 14 tasks
GauthamramRavichandran opened this issue Jan 21, 2021 · 4 comments
Closed
7 of 14 tasks

Websocket error on testnet for userdata stream #143

GauthamramRavichandran opened this issue Jan 21, 2021 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@GauthamramRavichandran
Copy link

GauthamramRavichandran commented Jan 21, 2021

  • I have searched for other issues with the same problem or similar feature requests.

Select one:

  • Bug
  • Feature Request
  • Technical Help
  • Other

Environment

  • Are you using the module on a VPS or other Cloud hosting?
  • Are you using the module on a Raspberry Pi?
  • Desktop

What kind of internet connection do you have?

Broadband with >80Mbps network speed

Operating System? (include version)

  • macOS
  • Windows
  • Linux (Ubuntu 20.04)

Options

  • stream_buffer
  • process_stream_data

Which endpoint do you connect?

binance.org-testnet

Python Version Requirement

  • I am using Python 3.6.1 or above

Exact Python Version?

python 3.8.5

Pip Version?

20.0.1

Dependencies

Run pip list > pip_list.txt and upload the file.

UNICORN Binance WebSocket API Version?

Installed the latest version,

Description of your issue

Got this error, AttributeError: 'BinanceWebSocketApiRestclient' object has no attribute 'path_userdata'

I tried this example with only one stream in testnet exchange "binance.org-testnet"

@GauthamramRavichandran
Copy link
Author

Any progress?

@oliver-zehentleitner
Copy link
Member

Could you please provide the full error trace?

@GauthamramRavichandran
Copy link
Author

I don't have access to the desktop (one mentioned in issue desc.)

Below traceback is from this config:
OS: MacOS Big Sur
Arch: M1
Python: 3.9.1
pip: 20.3.3
unicorn-binance-websocket-api: 1.28.0

Exception in thread Thread-4:
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/[email protected]/3.9.1_6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/threading.py", line 954, in _bootstrap_inner
    self.run()
  File "/opt/homebrew/Cellar/[email protected]/3.9.1_6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/threading.py", line 892, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/gauthamramravichandran/PycharmProjects/sample-proj/env/lib/python3.9/site-packages/unicorn_binance_websocket_api/unicorn_binance_websocket_api_manager.py", line 433, in _create_stream_thread
    loop.run_until_complete(socket.start_socket())
  File "/opt/homebrew/Cellar/[email protected]/3.9.1_6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/Users/gauthamramravichandran/PycharmProjects/sample-proj/env/lib/python3.9/site-packages/unicorn_binance_websocket_api/unicorn_binance_websocket_api_socket.py", line 63, in start_socket
    async with BinanceWebSocketApiConnection(self.manager,
  File "/Users/gauthamramravichandran/PycharmProjects/sample-proj/env/lib/python3.9/site-packages/unicorn_binance_websocket_api/unicorn_binance_websocket_api_connection.py", line 72, in __aenter__
    uri = self.manager.create_websocket_uri(self.channels,
  File "/Users/gauthamramravichandran/PycharmProjects/sample-proj/env/lib/python3.9/site-packages/unicorn_binance_websocket_api/unicorn_binance_websocket_api_manager.py", line 1167, in create_websocket_uri
    response = self.get_listen_key_from_restclient(stream_id, api_key, api_secret, symbols=symbols)
  File "/Users/gauthamramravichandran/PycharmProjects/sample-proj/env/lib/python3.9/site-packages/unicorn_binance_websocket_api/unicorn_binance_websocket_api_manager.py", line 1690, in get_listen_key_from_restclient
    response = self.restclient.get_listen_key(stream_id)
  File "/Users/gauthamramravichandran/PycharmProjects/sample-proj/env/lib/python3.9/site-packages/unicorn_binance_websocket_api/unicorn_binance_websocket_api_restclient.py", line 282, in get_listen_key
    response = self._request(method, self.path_userdata)
AttributeError: 'BinanceWebSocketApiRestclient' object has no attribute 'path_userdata'
====================== unicorn-binance-websocket-api_1.28.0-python_3.9.1 ======================
 exchange: binance.org-testnet
 uptime: 2 seconds since 2021-02-02, 15:53:52 UTC
 streams: 1
 subscriptions: 0
 current_receiving_speed: 0 B/s
 average_receiving_speed: 0.0 B/s (per day 0.0 gB)
 highest_receiving_speed: 0 B/s (reached at 2021-02-02, 15:53:52 UTC)
 total_receives: 0
 total_received_bytes: 0 (0 B)
 total_transmitted_payloads: 0
 process_ressource_usage: cpu=0.0%, memory=42.59 mB, threads=4
 ---------------------------------------------------------------------------------------------
               stream_id              |   stream_label  |  last  |  average  |  most  | recon
 ---------------------------------------------------------------------------------------------
 32ecad7e-9381-4534-9160-b3583cf43966 | Alice           |      0 |       0.0 |      0 |      0 
 ---------------------------------------------------------------------------------------------
 all_streams                                            |      0 |       0.0 |      0 |      0 
===============================================================================================

Websocket continues to print these stats anyway, so web socket is working (I guess), haven't tested that yet

@oliver-zehentleitner
Copy link
Member

hm, binance dex has an other syntax then cex user data streams.

look here and try again please: https://github.com/oliver-zehentleitner/unicorn-binance-websocket-api/blob/d5af8999b965e20037a322253478efb0133a0aa3/example_binance_dex.py#L79

I will try to make a better exception handling

oliver-zehentleitner added a commit that referenced this issue Apr 13, 2021
Seven-112 pushed a commit to Seven-112/unicorn-binance-websocket-api that referenced this issue May 16, 2023
Seven-112 pushed a commit to Seven-112/unicorn-binance-websocket-api that referenced this issue May 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants