Navigation

    SmartAPI Forum
    • Register
    • Login
    • Search
    • Categories
    • Popular
    • Groups
    • FAQs
    • API Docs

    ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x0000024771931880>, 'Connection to apiconnect.angelbroking.com timed out. (connect timeout=7)'))

    General Discussion
    0
    20
    139
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      Moderator_2 @techbytecache last edited by

      HI @techbytecache

      Please share which SDK version is consumed at your end.

      Regards,
      SmartAPI team

      T 2 Replies Last reply Reply Quote 0
      • T
        techbytecache @Moderator_2 last edited by

        @Moderator_2 it is 1.3.5

        1 Reply Last reply Reply Quote 0
        • T
          techbytecache @Moderator_2 last edited by

          @Moderator_2 Please update how to fix this. My SDK version is 1.4.1

          Today again I got multiple errors. I have set timeout to 30 seconds in SmartConnect.py still getting these errors.

          [E 240409 09:18:46 smartConnect:210] Error occurred while making a POST request to https://apiconnect.angelbroking.com/rest/secure/angelbroking/order/v1/getLtpData. Headers: {'Content-type': 'application/json', 'X-ClientLocalIP xxxxxxxxxxxxxxxxxxxxxx Response: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
          [E 240409 09:41:33 smartConnect:210] Error occurred while making a GET request to https://apiconnect.angelbroking.com/rest/secure/angelbroking/order/v1/getOrderBook. Headers: {'Content-type': 'application/json', 'X-ClientLocalIP xxxxxxxxxxxxxxxxxxxxxx Response: HTTPSConnectionPool(host='apiconnect.angelbroking.com', port=443): Max retries exceeded with url: /rest/secure/angelbroking/order/v1/getOrderBook?%7B%7D (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x0000016197836610>, 'Connection to apiconnect.angelbroking.com timed out. (connect timeout=30)'))
          [E 240409 09:43:40 smartConnect:210] Error occurred while making a GET request to https://apiconnect.angelbroking.com/rest/secure/angelbroking/order/v1/getOrderBook. Headers: {'Content-type': 'application/json', 'X-ClientLocalIP xxxxxxxxxxxxxxxxxxxxxx Response: HTTPSConnectionPool(host='apiconnect.angelbroking.com', port=443): Read timed out. (read timeout=30)
          [E 240409 09:45:22 smartConnect:210] Error occurred while making a POST request to https://apiconnect.angelbroking.com/rest/secure/angelbroking/historical/v1/getCandleData. Headers: {'Content-type': 'application/json', 'X-ClientLocalIP xxxxxxxxxxxxxxxxxxxxxx Response: ('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))
          [E 240409 10:08:00 smartConnect:210] Error occurred while making a POST request to https://apiconnect.angelbroking.com/rest/secure/angelbroking/order/v1/getLtpData. Headers: {'Content-type': 'application/json', 'X-ClientLocalIP xxxxxxxxxxxxxxxxxxxxxx Response: HTTPSConnectionPool(host='apiconnect.angelbroking.com', port=443): Max retries exceeded with url: /rest/secure/angelbroking/order/v1/getLtpData (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x000001619795E250>, 'Connection to apiconnect.angelbroking.com timed out. (connect timeout=30)'))
          [E 240409 10:11:50 smartConnect:210] Error occurred while making a POST request to https://apiconnect.angelbroking.com/rest/secure/angelbroking/order/v1/getLtpData. Headers: {'Content-type': 'application/json', 'X-ClientLocalIP xxxxxxxxxxxxxxxxxxxxxx Response: HTTPSConnectionPool(host='apiconnect.angelbroking.com', port=443): Max retries exceeded with url: /rest/secure/angelbroking/order/v1/getLtpData (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x000001619795E150>, 'Connection to apiconnect.angelbroking.com timed out. (connect timeout=30)'))
          [E 240409 10:12:44 smartConnect:210] Error occurred while making a POST request to https://apiconnect.angelbroking.com/rest/secure/angelbroking/historical/v1/getCandleData. Headers: {'Content-type': 'application/json', 'X-ClientLocalIP xxxxxxxxxxxxxxxxxxxxxx Response: HTTPSConnectionPool(host='apiconnect.angelbroking.com', port=443): Read timed out. (read timeout=30)
          [E 240409 10:17:56 smartConnect:210] Error occurred while making a POST request to https://apiconnect.angelbroking.com/rest/secure/angelbroking/historical/v1/getCandleData. Headers: {'Content-type': 'application/json', 'X-ClientLocalIP xxxxxxxxxxxxxxxxxxxxxx Response: HTTPSConnectionPool(host='apiconnect.angelbroking.com', port=443): Read timed out. (read timeout=30)
          [E 240409 10:26:23 smartConnect:210] Error occurred while making a POST request to https://apiconnect.angelbroking.com/rest/secure/angelbroking/historical/v1/getCandleData. Headers: {'Content-type': 'application/json', 'X-ClientLocalIP xxxxxxxxxxxxxxxxxxxxxx Response: HTTPSConnectionPool(host='apiconnect.angelbroking.com', port=443): Max retries exceeded with url: /rest/secure/angelbroking/historical/v1/getCandleData (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x00000161954A87D0>, 'Connection to apiconnect.angelbroking.com timed out. (connect timeout=30)'))

          J 1 Reply Last reply Reply Quote 0
          • J
            jaideep siddula @techbytecache last edited by

            @techbytecache
            It seems there was an error with making a POST request to the specified URL (https://apiconnect.angelbroking.com/rest/secure/angelbroking/historical/v1/getCandleData). The error message indicates a connection timeout issue, suggesting that the connection to apiconnect.angelbroking.com took longer than the specified timeout period (30 seconds in this case).

            Error Type: ConnectTimeoutError
            Host: apiconnect.angelbroking.com
            Port: 443 (standard HTTPS port)
            URL Path: /rest/secure/angelbroking/historical/v1/getCandleData
            Request Type: POST
            Headers: {'Content-type': 'application/json', 'X-ClientLocalIP': 'xxxxxxxxxxxxxxxxxxxxxx'}
            Possible reasons could be

            Retry: Sometimes, the error could be transient. Simply retrying the request after a short delay might succeed.

            Check Network Connection: Ensure that the network connection from your end is stable and there are no issues with connectivity.

            Server Status: Check if the server (apiconnect.angelbroking.com) is operational and not experiencing any downtime or maintenance.

            Increase Timeout: If this issue persists, you might consider increasing the timeout value in your request to allow more time for the connection to establish.

            Contact Support: If none of the above steps work, you may need to contact the support team of angelbroking.com for further assistance, as the issue might be specific to their infrastructure.

            Hope this helps.

            Regards,
            Jaideep Siddula

            T 1 Reply Last reply Reply Quote 0
            • T
              techbytecache @jaideep siddula last edited by

              @jaideep-siddula I understand what you are saying and meaning of the error but that doesn't answer why every other day we get TimeOut errors from your servers. You can see from my logs it happened multiple times yesterday. Also want to share it worked very well today with no timeout whole day. You need to look at increasing your infra etc to be able to take on the incoming traffic without getting unresponsive.

              J 1 Reply Last reply Reply Quote 0
              • J
                jaideep siddula @techbytecache last edited by

                @techbytecache
                Time Out Error is raised when the code is executed. The error can be tackled if you're good at handling exceptions and make the code work according to your use case. This comes handy building any application. We can not really depend on the infrastructure of the communication systems. They are bound to fail at times. In this example, you can change in the time out to 15 seconds, instead of 7 seconds which is the default. Cheers!

                Mnagesh T 2 Replies Last reply Reply Quote 0
                • Mnagesh
                  Mnagesh @jaideep siddula last edited by

                  @jaideep-siddula yes timeout error is occurring frequently and it is annoying in spite of talking care of rate limites and exception handling.
                  @Moderator_2
                  @Moderator_1

                  Now I am full time Algo Trader and successfully developed my own Apps for my personal use.

                  J 1 Reply Last reply Reply Quote 0
                  • J
                    jaideep siddula @Mnagesh last edited by

                    @Mnagesh
                    Hope you're doing well. You could simply use try, except, finally(If you're using python) statement in your code. So, when a error is raised, the code tries again instead of raising it and ending the program. Hope this helps.

                    T 1 Reply Last reply Reply Quote 0
                    • T
                      techbytecache @jaideep siddula last edited by

                      @jaideep-siddula You missed in my post I mentioned " I have set timeout to 30 seconds in SmartConnect.py still getting these errors." You are right infra may fail but should not fail this frequently for such critical financial applications. I got timeout errors 9 times on 12th April. Your timeouts may cause losses and may result in heavy losses if the position is not exited on time. And since this error is happening with a lot of folks who are using Angel APIs it is for sure something on Angel side which needs improvement if you want customers to stick with you.

                      Mnagesh 1 Reply Last reply Reply Quote 1
                      • T
                        techbytecache @jaideep siddula last edited by techbytecache

                        @jaideep-siddula You folks don't read user posts properly. See @Mnagesh has already mentioned "in spite of talking care of rate limites and exception handling"

                        1 Reply Last reply Reply Quote 0
                        • Mnagesh
                          Mnagesh @techbytecache last edited by

                          @techbytecache
                          why 30 sec ?
                          0.35 sec is enough to match the rate limit
                          30 sec is too delayed and not suite for intraday traders .

                          Now I am full time Algo Trader and successfully developed my own Apps for my personal use.

                          J 1 Reply Last reply Reply Quote 0
                          • J
                            jaideep siddula @Mnagesh last edited by

                            @Mnagesh @techbytecache @Moderator_2

                            What I think is yes, there is scope for improvement in the API. I totally agree with you. I am just wondering, have you tried APIs from any other brokers? Would be happy if you shared your experience.

                            Regards,
                            Jaideep Siddula

                            1 Reply Last reply Reply Quote 0
                            • Mnagesh
                              Mnagesh last edited by

                              @techbytecache said in ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x0000024771931880>, 'Connection to apiconnect.angelbroking.com timed out. (connect timeout=7)')):

                              "

                              e6a9dd7d-c3ff-462b-bef1-43e43fe37134-image.png

                              this error comes very frequently . kindly fix .
                              in spite of taking care of exemption handling and rate limits still we get this types of error during getcandels or ltp !

                              @Moderator_1
                              @Moderator_2

                              Now I am full time Algo Trader and successfully developed my own Apps for my personal use.

                              M 1 Reply Last reply Reply Quote 0
                              • M
                                Moderator_1 @Mnagesh last edited by

                                Hello @Mnagesh @techbytecache @jaideep-siddula ,

                                Apologies for the inconvenience. Rest assured, we are working on this issue for a fix.

                                Thank you

                                Regards
                                SmartAPI Team

                                1 Reply Last reply Reply Quote 0
                                • First post
                                  Last post