Error in connecting to ticker

ERROR:websocket:Handshake status 403 Forbidden -±± {‘date’: ‘Tue, 04 Feb 2025 07:34:16 GMT’, ‘transfer-encoding’: ‘chunked’, ‘connection’: ‘keep-alive’} -±± None - goodbye

Using v3 ticker latest python sdk. it is happening today.

Hi @Kislay
The new WebSocket V3 permits only one connection per access token. Please ensure that you are maintaining a single connection.

If multiple connections are detected, you will receive a 403 Forbidden status.

Thank you.

I am using single connection only.I restarted my app and I got this error.

Previous connection should be closed by server if a user tries to establish a new connection, as it happens when restarting program.

Can you share your 6 digit user id so we can investigate this further.

I’m facing the same issue with v3 websocket, can you please check? user id - 176522. Does upstox browser login count towards active websocket connection?
Java error - Market feed socket closed, statusCode : 1002, reason Invalid status code received: 403 Status line: HTTP/1.1 403 Forbidden

Hi @amol
The new WebSocket V3 permits only one connection per access token. Please ensure that you are maintaining a single connection.

If multiple connections are detected, you will receive a 403 Forbidden status.

We have also reviewed the logs and found that you successfully established a connection to the v3 WebSocket around 9:32 AM. However, all subsequent connection attempts failed with a 403 error.

Thank you!

Did you get a chance to look into my logs?

Same thing happened today.

@Kislay,

We have reviewed your logs for today and found that you successfully established a connection at 08:53 AM. However, subsequent connection requests received a 403 Forbidden response.

Please ensure that you are restarting the application correctly. A proper shutdown and restart will terminate the TCP connection, allowing the server-side connection to close properly.

If you are unable to achieve this from your local application, try forcefully closing the TCP connection from your local machine.

For example, if you are using a macOS laptop, you can follow these steps in the terminal:

  1. Run nslookup wsfeeder-api.upstox.com to retrieve a list of server IP addresses.
  2. Run netstat -an | grep ESTABLISHED to display a list of active TCP connections. Identify and copy the IP address of the Upstox server you are connected to via WebSocket.
  3. Run lsof -i :<server_port_number> | grep <server_ip_address> to obtain the process ID associated with the WebSocket connection.
  4. Run kill -9 <process_id> to forcefully terminate the WebSocket connection.

A similar approach can be applied to other operating systems.

Thank you!

1 Like

This step doesn’t list any upstox server ip address, although I am getting 403 right now at this time.