8000
  • fix(llm): fix boto3 metadata endpoint by ionmincu · Pull Request #491 · UiPath/uipath-langchain-python · GitHub
    [go: up one dir, main page]

    Skip to content

    fix(llm): fix boto3 metadata endpoint#491

    Draft
    ionmincu wants to merge 1 commit intomainfrom
    fix/bedrock_boto3
    Draft

    fix(llm): fix boto3 metadata endpoint#491
    ionmincu wants to merge 1 commit intomainfrom
    fix/bedrock_boto3

    Conversation

    @ionmincu
    Copy link
    Collaborator
    @ionmincu ionmincu commented Jan 28, 2026

    Fix: Prevent boto3 from attempting AWS credential lookup and IMDS connection

    Description:
    This PR fixes TimeoutError issues where UiPathChatBedrock and UiPathChatBedrockConverse were attempting to connect to the AWS EC2 Instance Metadata Service (IMDS) at 169.254.169.254.

    Root Cause:
    Even with dummy values provided for aws_access_key_id and aws_secret_access_key, the default boto3 client configuration attempts to resolve credentials and sign requests. When running in environments without explicit AWS credentials (or on non-EC2 machines where the IMDS IP is unreachable), boto3 would hang or timeout trying to fetch instance metadata.

    Since we are proxying requests through the UiPath LLM Gateway and not connecting directly to AWS, standard AWS authentication and region resolution are unnecessary.

    Changes:

    • Configured the boto3 client with botocore.config.Config(signature_version=botocore.UNSIGNED). This explicitly tells the client that requests do not need to be signed, bypassing the credential resolution chain entirely.
    • Explicitly set default region_name="none" in UiPathChatBedrock and UiPathChatBedrockConverse init methods to prevent the langchain_aws base classes from attempting to resolve a region from the environment.

    Benefit:
    Eliminates unnecessary network calls to AWS endpoints/IMDS and resolves cryptic timeout errors during client initialization.

    Development Package

    • Add this package as a dependency in your pyproject.toml:
    [project]
    dependencies = [
      # Exact version:
      "uipath-langchain==0.5.11.dev1004912339",
    
      # Any version from PR
      "uipath-langchain>=0.5.11.dev1004910000,<0.5.11.dev1004920000"
    ]
    
    [[tool.uv.index]]
    name = "testpypi"
    url = "https://test.pypi.org/simple/"
    publish-url = "https://test.pypi.org/legacy/"
    explicit = true
    
    [tool.uv.sources]
    uipath-langchain = { index = "testpypi" }

    @ionmincu ionmincu changed the title Fix/bedrock boto3 fix(llm): fix boto3 metadata endpoint Jan 28, 2026
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    1 participant

    0