Skip to content
This repository has been archived by the owner on Jul 20, 2020. It is now read-only.

Nonce small #26

Closed
alexeykarnachev opened this issue Aug 22, 2017 · 4 comments
Closed

Nonce small #26

alexeykarnachev opened this issue Aug 22, 2017 · 4 comments

Comments

@alexeykarnachev
Copy link
Contributor

Hi
After wss.authenticate() I got the following traceback:

DEBUG:btfxwss.connection:_on_message(): Received new message {"event":"auth","status":"FAILED","chanId":0,"code":10114,"msg":"nonce: small"} at 1503428552.745091
DEBUG:btfxwss.connection:_system_handler(): Received a system message: {'chanId': 0, 'msg': 'nonce: small', 'event': 'auth', 'code': 10114, 'status': 'FAILED'}
DEBUG:btfxwss.connection:_system_handler(): Distributing {'chanId': 0, 'msg': 'nonce: small', 'code': 10114, 'status': 'FAILED'} to _response_handler..
DEBUG:btfxwss.connection:_response_handler(): Passing {'chanId': 0, 'msg': 'nonce: small', 'code': 10114, 'status': 'FAILED'} to client..
DEBUG:btfxwss.connection:_start_timers(): Resetting timers..
DEBUG:btfxwss.connection:_stop_timers(): Timers stopped.
ERROR:btfxwss.queue_processor:Dtype 'auth' does not have a response handler!

After changing the 'nonce = str(int(time.time() * 1000))' to 'nonce = str(int(time.time() * 1000000))' in client.py (line 467) all works fine

@deepbrook
Copy link
Collaborator

That's odd - were you able to reproduce this issue constantly, or sporadically? I've never had an issue with it before.
Thanks for reporting!

@alexeykarnachev
Copy link
Contributor Author

It's a time to time behavior. Now I've changed back the multiplier to 1000 and it works. I think the problem was on the client side. Maybe I've sent more than one requests with the same nonce, but it's strange

@deepbrook
Copy link
Collaborator

It may be indeed that you sent out several requests within one second, since the nonce converts the timestamp to an integer first. This could only be avoided by some form of queuing for request calls. I'll have a look at it.

deepbrook pushed a commit that referenced this issue Aug 28, 2017
@deepbrook
Copy link
Collaborator

I just added your fix from above. I don't know why I didn't before, adding a queue for request calls is utter nonesense 😃 , That's what happens when you try to work in vacation mode.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants