Skip to content

sift.client.ApiException: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) #82

Open

Description

@ashwinv11

Hello there!

We're seeing some 104 Connection Reset errors from the v205 Events POST endpoint. We're using version 5.0.1 of the SDK. It looks like this is an issue with the underlying calls to requests. Is this a known issue? What's the best way to handle these exceptions?

Thanks!

Activity

  1. vincent-sift commented on Apr 26, 2022

    @vincent-sift

    Hello @ashwinv11 thanks for letting use know.

    1. Can you provide some more context on the issues that you are encountering?
    2. What is the name of the customer that you are integrating?
    3. What is your error rate?

    Thanks :)

  2. StevenLudwig commented on May 18, 2022

    @StevenLudwig

    Hello!
    I have the same problem, we are using asynchronous microservices where we are tracking events with Sift sdk with python language, I am controlling the problem with a retry when it fails but the error rate is very high. It looks like the sift sdk is not 'ready' and keeps crashing when still being used... the error trace is coming from the sift sdk connection layer

  3. vincent-sift commented on May 19, 2022

    @vincent-sift

    Thanks @StevenLudwig we are investigating this issue.

  4. ashwinv11 commented on Jun 8, 2022

    @ashwinv11
    Author

    Hi @vincent-sift just reached out to support with some additional information. Thanks!

  5. vincent-sift commented on Jun 8, 2022

    @vincent-sift

    Thanks @ashwinv11. I am following up with the engineering team as well.

  6. ashwinv11 commented on Jul 7, 2022

    @ashwinv11
    Author

    Hi there, is there any update on this one? 🙏🏾 Are there any recommendations on how to handle this until it's fixed? Should we be retrying API calls if we get this error?

  7. vincent-sift commented on Jul 20, 2022

    @vincent-sift

    @ashwinv11 we are working on getting this work scheduled. Our current suggestion is to retry these requests when you get these exceptions. Thanks for your patience.

  8. ashwinv11 commented on Nov 11, 2022

    @ashwinv11
    Author

    Hey @vincent-sift any update on this?

  9. viaskal-sift commented on Jun 2, 2023

    @viaskal-sift
    Contributor

    @ashwinv11 a few questions:

    1. Which version of Python do you use?
    2. Please, provide a code snippet of how they init a Sift client in the Python code (without credentials)
    3. Do you create a session object manually, or use the Sift's default one? If you create Session by your own please provide a code snippet or parameters. Also, do you use own timeout or rely on the Sift's default one (2 sec)?
    4. What is the exactly version of requests lib?
    5. Do you use any proxy when calling Sift?

    Thanks!

  10. ashwinv11 commented on Jun 2, 2023

    @ashwinv11
    Author

    Hey @viaskal-sift sure!

    Python version – 3.9.16
    Requests lib version – 2.25.1

    Here's an example of how we have it setup. Looks like we set a longer timeout than the default, and don't build the session object manually. We don't use any proxy when calling Sift.

    import sift
    
    client = sift.Client(SIFT_SCIENCE_API_KEY, timeout=3)
    
    def send_to_sift(data):
        try:
            response = client.track('$create_order', data, return_workflow_status=True)
            if response and not response.is_ok():
                logger.error('...')
        except Exception:
            logger.exception('..')
            return None
        return response

    Hope this helps!

  11. viaskal-sift commented on Jun 23, 2023

    @viaskal-sift
    Contributor

    @ashwinv11 Could you pls try to add some pre-configuration before creating a Sift Client using the code snipped below? Basically, it will configure the Session object particularly and only for the Sift Client, and only requests to the Sift API will be affected by that.

    session = requests.Session()
    adapter = HTTPAdapter(max_retries=3, pool_connections=5, pool_maxsize=5)
    session.mount("https://", adapter)
    
    session.timeout = timeout.Timeout(total=10, connect=10, read=10)
    client = sift.Client(api_key=API_KEY, session=session)
    
  12. viaskal-sift commented on Jul 10, 2023

    @viaskal-sift
    Contributor

    @ashwinv11 did you have a chance to try this one? Thanks!

  13. stephenflynn commented on Jul 12, 2023

    @stephenflynn

    @ashwinv11 did you have a chance to try this one? Thanks!

    Hi Viaskal, we're hoping to tackle this guy soon.

  14. viaskal-sift commented on Aug 1, 2023

    @viaskal-sift
    Contributor

    @stephenflynn any updates from your side?

  15. jmdsifty commented on Oct 4, 2023

    @jmdsifty

    @ashwinv11 did you have a chance to try this one? Thanks!

    Hi Viaskal, we're hoping to tackle this guy soon.

    Hi @stephenflynn wanted to check if @viaskal-sift 's recommendation was able to resolve the issue? Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions