okxapi / python-okx

383 stars 150 forks source link

response.status_code: 504 #10

Closed Hearty07 closed 8 months ago

Hearty07 commented 1 year ago

print('response.status_code:', response.status_code) print('response.json.code:', response.json()['code']) print('response.json.msg:', response.json()['msg'])

得到一个504的错误码,这个错误码在https://www.vkhwabf.cn/docs-v5/zh/#error-code-rest-public 中没有给出说明,并且导致后面索引okxapi级别的'code'时候出错。应该是这个response中的json不包含code和msg,但是错误码没有504代码也没有给出响应示例。

okxapi commented 1 year ago

应该不是预期内的报错,所以不是标准返回(没有code,msg) 可以提供一下这个请求和报错的具体信息看看

Hearty07 commented 1 year ago

到目前为止只遇到过一次,后面没有复现。code msg信息没有被打出来。后面复现了再说吧,目前是没有问题了。倒是服务器经常出现“Service temporarily unavailable. Please try again later”

toolmanlife commented 1 year ago

这种一般是nginx返回的

Pborz commented 1 year ago

print('response.status_code:', response.status_code) print('response.json.code:', response.json()['code']) print('response.json.msg:', response.json()['msg'])

得到一个504的错误码,这个错误码在https://www.vkhwabf.cn/docs-v5/zh/#error-code-rest-public 中没有给出说明,并且导致后面索引okxapi级别的'code'时候出错。应该是这个response中的json不包含code和msg,但是错误码没有504代码也没有给出响应示例。

你好,请问当前最近你有碰到出现这个websocket错误吗

WsConnectManager reactor.run error;e: WsConnectManager reactor.run error;e: [{'channel': 'books', 'instId': 'BTC-USDT-SWAP'}] subscribing [{'channel': 'orders', 'instType': 'ANY'}] subscribing WsClientFactory execute clientConnectionLost. Reason: [Failure instance: Traceback (failure with no frames): <class 'twisted.internet.error.ConnectionDone'>: Connection was closed cleanly. ],retried 1 times WsClientFactory execute clientConnectionLost. Reason: [Failure instance: Traceback (failure with no frames): <class 'twisted.internet.error.ConnectionDone'>: Connection was closed cleanly. ],retried 1 times

okxapi commented 1 year ago

Closing this as it's a one time issue

Pborz commented 1 year ago

Closing this as it's a one time issue

大哥你close干嘛啊😂跑不起来啊!还有您的okx-sample-market-maker-main统统都是依赖这个的,您可以给一些方向我们也帮忙解决呀

Pborz commented 1 year ago

https://github.com/twisted/twisted/issues/11881

我问过了 是您里面涉及到reactor多线程那里不能直接多个启动。不过至于为啥第一轮也连不上,真的是显示'twisted.internet.error.ConnectionDone'>: Connection was closed cleanly.

Pborz commented 1 year ago

修正一下,重复启动reactor这里还好,真正的问题点貌似锁定了,是所调用的connectSSL有问题

25