Missing heartbeat on the public feed [FIXED]

Added by fredrik about 1 month ago

Connect works fine on the public feed and the login message is sent without any errors. But no data is received on the communication channel, SSL_pending and SSL_read always return 0! Is the connection closed by the server?

However, everything works fine on the private feed, the hearbeat is continuously received!


Replies (8)

RE: Missing heartbeat on the public feed - Added by Roger about 1 month ago

I've got the same problem on the test system. The public test feed server shuts down the connection after I send the login command. The private test feed server works just fine.

RE: Missing heartbeat on the public feed - Added by Roger about 1 month ago

The bug can be reproduced with the Python example in Nordnet's Github:

https://github.com/nordnet/next-api-v2-examples/tree/master/python3

Here's the printouts and stack trace from test_program.py:

Checking NEXT API status...
<< HTTP request GET /next/2/ {
"message": "",
"system_running": true,
"timestamp": 1586238615445,
"valid_version": true
}
Logging in NEXT API...
<< HTTP request POST /next/2/login {
"country": "SE",
"environment": "exttest",
"expires_in": 300,
"private_feed": {
"encrypted": true,
"hostname": "priv.api.test.nordnet.se",
"port": 443
},
"public_feed": {
"encrypted": true,
"hostname": "pub.api.test.nordnet.se",
"port": 443
},
"session_key": "37422169c8befc293cac987b16abfad9bf8fc149"
}

Connecting to feed pub.api.test.nordnet.se:443...

Starting receiving from socket...

<< Sending cmd to feed: {'cmd': 'login', 'args': {'session_key': '37422169c8befc293cac987b16abfad9bf8fc149', 'service': 'NEXTAPI'}}
<< Sending cmd to feed: {'cmd': 'subscribe', 'args': {'t': 'price', 'm': 11, 'i': '101'}}
Exception in thread Thread-1:
Traceback (most recent call last):
File "E:\progs\Python3.8.2\lib\threading.py", line 932, in _bootstrap_inner
self.run()
File "E:\progs\Python3.8.2\lib\threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File ".\test_program.py", line 145, in receive_message_from_socket
buffer = do_receive_from_socket(socket, buffer)
File ".\test_program.py", line 129, in do_receive_from_socket
new_data = socket.recv(1024).decode('utf-8')
File "E:\progs\Python3.8.2\lib\ssl.py", line 1226, in recv
return self.read(buflen)
File "E:\progs\Python3.8.2\lib\ssl.py", line 1101, in read
return self._sslobj.read(len)
ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host
Traceback (most recent call last):
File ".\test_program.py", line 210, in <module>
main()
File ".\test_program.py", line 197, in main
console_input = input()
KeyboardInterrupt

RE: Missing heartbeat on the public feed - Added by Joel about 1 month ago

I get the exact same error. Have you gotten any new information regarding this or did you find a solution?

RE: Missing heartbeat on the public feed - Added by fredrik about 1 month ago

No updates and I still see the problem. I also sent a message on to make sure they got the information but I got no response.

RE: Missing heartbeat on the public feed - Added by fredrik about 1 month ago

I've talked to them and they said that they are going to take a look at it.

But another thing that was mentioned is that the Next API is currently closed for new customers. It will, however, be opened again but they could not say when!

RE: Missing heartbeat on the public feed - Added by Nordnet_Support about 1 month ago

Sorry for the issues. Can you try again now? We have made some changes to our test system.

JSON udpates from public feed

{
"data": {},
"type": "heartbeat"
}

JSON udpates from public feed

{
"data": {
"ask_volume": 501,
"i": "101",
"m": 11,
"tick_timestamp": 1587376784011,
"trade_timestamp": 1587376655315
},
"type": "price"
}

JSON udpates from public feed

{
"data": {
"ask": 90.0,
"ask_volume": 10,
"i": "101",
"m": 11,
"tick_timestamp": 1587376785511,
"trade_timestamp": 1587376655315
},
"type": "price"
}

JSON udpates from public feed

{
"data": {},
"type": "heartbeat"
}

RE: Missing heartbeat on the public feed [FIXED] - Added by fredrik about 1 month ago

Yes, it is working. Thanks for the updates!

RE: Missing heartbeat on the public feed [FIXED] - Added by Roger about 1 month ago

@Nordnet_Support: Thank you, heartbeats are working now on the public feed!

It's still not possible to place orders on the test system, could you please have a look at that problem? The bug is documented in this thread:

https://api.test.nordnet.se/boards/2/topics/2980

(1-8/8)