For a deeper look into our Elektron API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
3 0 0 4

utf8 codec can't decode byte 0xf7 in position 21: invalid start byte

hostname = "'MY_HOST1'"

and

user = "my_user"


And error is the same for impacted ads:


################################################################################

websocket-client version: 1.8.0

################################################################################

Connecting to WebSocket wss://MY_HOST1:15000/WebSocket ...

--- request header ---

GET /WebSocket HTTP/1.1

Upgrade: websocket

Host: MY_HOST1:15000

Origin: https://MY_HOST1:15000

Sec-WebSocket-Key: 6h9vNh0+SY2zRgZg25kS2Q==

Sec-WebSocket-Version: 13

Connection: Upgrade

Sec-WebSocket-Protocol: tr_json2

User-Agent: Python



-----------------------

--- response header ---

HTTP/1.1 101 Switching Protocols

Upgrade: websocket

Connection: Upgrade

Sec-WebSocket-Protocol: tr_json2

Sec-WebSocket-Accept: HTtmpsexkcAFTQB78GAx2xFJAqw=

'utf-8' codec can't decode byte 0xa7 in position 21: invalid start byte

'utf-8' codec can't decode byte 0xa7 in position 21: invalid start byte - goodbye

WebSocket Closed

#technologypython apiwebsocketsrefinitiv-data-libraries
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
Accepted
27k 65 17 14

Hello @CarloJason.Arcega

I have checked the case 1332037x, I cannot find any information about the Python version, WebSocket version: 1.6.1 and refinitiv.data Module version: 1.6.0 on the case. Where did you get this information?

By the way, does the client connects to the RTO (I saw you mentioned the Machine-ID on the case), or the deployed ADS with the SSL Accelerator? I did a quick tested with the Python 3.7.16/WebSocket-Client 1.8.0 using both RTO - market_price_rdpgw_authentication.py (connect to WSS ADS on the Cloud) and RTDS - market_price.py (connect to local ADS). They work fine and can connect to ADS successfully.

rto-connection.png

rtds-connection.png

Note: I do not have the deployed ADS with SSL Accelerator in my environment.

Please be informed that we, Developer Relations can help with the LSEG APIs general usage questions only. For this kind of question, we can help to verify if the client's source code uses a valid Real-Time WebSocket API specification. If the client already uses a valid code, but the problem is still persisting. I strongly suggest you contact the ADS support team as the WebSocket API is the server-side API.


rto-connection.png (211.0 KiB)
rtds-connection.png (44.0 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
27k 65 17 14

Hello @CarloJason.Arcega

I am assuming that you are connecting to the local deployed ADS. Can you replicate the issue with the Python market_price.py example? Please also give us more detail about your environment such as:

  • Python version
  • OS
  • ADS version
  • I am noticing your application was trying to connect to "wss://MY_HOST1:15000/WebSocket". Does your ADS is deployed behind the SSL Accelerator?

I did a quick test with the market_price.py example with Python 3.10.14, websocket-client 1.8.0, connect to my local ADS 3.7.3.L1 (ws://127.0.0.1:15000/WebSocket). The example can connect and consume data successfully.

python-2.png


python-2.png (52.8 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
3 0 0 4

Python version: 3.7.16 (default, Jan 17 2023, 16:06:28) [MSC v.1916 64 bit (AMD64)]

Websocket version: 1.6.1

refinitiv.data Module version: 1.6.0


hostname = "'MY_HOST1'"
and user = "my_user"

And error is the same for impacted ads:

################################################################################

websocket-client version: 1.8.0

################################################################################

Connecting to WebSocket wss://MY_HOST1:15000/WebSocket ...

--- request header ---

GET /WebSocket HTTP/1.1

Upgrade: websocket

Host: MY_HOST1:15000

Origin: https://MY_HOST1:15000

Sec-WebSocket-Key: 6h9vNh0+SY2zRgZg25kS2Q==

Sec-WebSocket-Version: 13

Connection: Upgrade

Sec-WebSocket-Protocol: tr_json2

User-Agent: Python

-----------------------

--- response header ---

HTTP/1.1 101 Switching Protocols

Upgrade: websocket

Connection: Upgrade

Sec-WebSocket-Protocol: tr_json2

Sec-WebSocket-Accept: HTtmpsexkcAFTQB78GAx2xFJAqw=

'utf-8' codec can't decode byte 0xa7 in position 21: invalid start byte

'utf-8' codec can't decode byte 0xa7 in position 21: invalid start byte - goodbye

WebSocket Closed

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
3 0 0 4

To recap, this case was initiated to investigate the cause of an error message encountered during the warmhandshake with ADS


We did not received any clear information on the following points:

1. Were you able to reproduce the issue on your end?

2. Did you test it on various versions of the API?

3. What about the ADS? Where and how are the header messages generated? Is this the same of all ADS versions?

4. What is the mechanism behind these messages, and can this be controlled or configured somehow?

5. Is this a recognized bug?

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
3 0 0 4

To recap, this case was initiated to investigate the cause of an error message encountered during the warmhandshake with ADS


We did not received any clear information on the following points:

1. Were you able to reproduce the issue on your end?

2. Did you test it on various versions of the API?

3. What about the ADS? Where and how are the header messages generated? Is this the same of all ADS versions?

4. What is the mechanism behind these messages, and can this be controlled or configured somehow?

5. Is this a recognized bug?

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
27k 65 17 14

Hello @CarloJason.Arcega

We, Developer Advocate are not the ADS support team, so I strongly suggest you contact the case to the ADS support team to investigate the issue on the ADS server side.

You can contact the team via https://myaccount.lseg.com/en/helpandsupport website.

ads-support.png


ads-support.png (24.6 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.