Navigation

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

    Unable to deal with " Invalid return character or leading space in header: X-ClientPublicIP "

    Python SDK
    5
    8
    54
    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.
    • L
      leena.1234 last edited by

      I'm getting the error " Invalid return character or leading space in header: X-ClientPublicIP " while trying to login, place order or cancel order through Python script using SmartAPI.
      It is running fine at some times else the error is continued.
      What causing this error occurrence? Please guide

      S 1 Reply Last reply Reply Quote 0
      • S
        Surya 1 @leena.1234 last edited by

        @leena-1234

        yes this happens when one fetched trade book or order book. As I wrote in the other post, I am also waiting for the @admin and team to looking in to it.

        James Bond 1 Reply Last reply Reply Quote 0
        • James Bond
          James Bond @Surya 1 last edited by

          This post is deleted!
          1 Reply Last reply Reply Quote 0
          • A
            admin last edited by

            @leena-1234 @James-Bond @rajanprabu
            Please send us your client id to solve the issues.

            L S 2 Replies Last reply Reply Quote 0
            • L
              leena.1234 @admin last edited by

              @admin

              Thank you for your response.
              I'm using 3 client IDs in my application.
              Client IDs are: L38845, I20415, M282515

              1 Reply Last reply Reply Quote 0
              • S
                Surya 1 @admin last edited by

                @admin

                mine is bbkg1036 and bbkg1037

                Today it happed 8 times. I was fetching the order_book every 3 seconds.

                ***** STORE NOTIF: While feteching order_book
                ***** STORE NOTIF: Invalid return character or leading space in header: X-ClientPublicIP
                ***** STORE NOTIF: While feteching order_book
                ***** STORE NOTIF: Invalid return character or leading space in header: X-ClientPublicIP
                

                If you are looking in to this.. I have few more things to register.

                ORDER DELAY

                time to time there is a execution delay. I have logged the timestamp just before and after the order submission.

                First order on same day

                 print ('Before order', datetime.datetime.now(timezone('Asia/Kolkata')))
                 oid = self.angel_api.placeOrder(orderparams)
                 print ('After order', datetime.datetime.now(timezone('Asia/Kolkata')))
                

                and this is what I get

                Before order 2021-03-02 09:56:00.559882+05:30
                After order 2021-03-02 09:56:12.755383+05:30
                

                There is a 14 sec delay in submitting the order. Web screenshot here

                Screenshot 2021-03-02 at 09.55.22.png

                Second order on same day

                Before order 2021-03-02 11:07:01.003910+05:30
                After order 2021-03-02 11:07:02.050287+05:30
                ``
                
                This went well
                
                **Third order on same day**
                
                

                Before order 2021-03-02 13:48:00.286036+05:30
                After order 2021-03-02 13:48:16.498416+05:30
                ``
                Thats a whopping 16 sec delay

                Screenshot 2021-03-02 at 09.55.42.png

                Fourth order on same day

                Before order 2021-03-02 15:16:11.160462+05:30
                After order 2021-03-02 15:16:12.340260+05:30
                

                Im sitting on a Gigabit network and some orders to go well in time. Please have a look at this delays. This is very crucial for trading.

                Also im using your official python SDK and not my own headers etc.

                Thanks

                1 Reply Last reply Reply Quote 0
                • A
                  admin last edited by

                  @leena-1234 ,@rajanprabu , @rajanprabu
                  we fixed this issue in the sdk you need to reinstall sdk .Also if you observe any other issue you can post here.

                  D 1 Reply Last reply Reply Quote 0
                  • D
                    djdenish @admin last edited by

                    @admin
                    WS = WebSocket(FEED_TOKEN, CLIENT_CODE)
                    TypeError: init() missing 1 required positional argument: 'task'

                    new Error after reinstalling SDK.

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