Skip to content

⚠️ Critical Issue: Intermittent Timeouts on api-data.line.me from AWS Lambda #933

@evan-hitobito

Description

@evan-hitobito

System Information

  • Python version: 3.9+
  • SDK version: line-bot-sdk-python v3.x
  • Environment: AWS Lambda (Amazon Linux 2 / Amazon Linux 2023)
  • Region: Confirmed in ap-northeast-1, potentially others.

Expected Behavior

The set_rich_menu_image method should successfully upload binary data to the LINE Data API within a standard request timeout (usually < 5s), matching the reliability of the standard Messaging API.

Current Behavior

While JSON-based calls to api.line.me work flawlessly, binary uploads to api-data.line.me frequently hang indefinitely until the Lambda execution environment times out. This suggests a network-level bottleneck or IP-based filtering specifically targeting the data-heavy endpoint.

Endpoint Purpose Status in Lambda
api.line.me Messaging / Profiling (JSON) Stable
api-data.line.me Rich Menu Image Upload (Binary) Hangs / Timeouts

Steps to Reproduce

  1. Initialize MessagingApiDataApi in an AWS Lambda function.
  2. Call set_rich_menu_image with a standard valid PNG/JPEG (e.g., 800KB).
  3. Set Lambda timeout to 30s+.
  4. Result: The function logs a timeout error or ConnectTimeoutError despite the image size being well within limits.

External References:

Logs

[ERROR] Runtime.ExitError: Client.Timeout exceeded while awaiting headers
- OR -
[ERROR] urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api-data.line.me', port=443): 
Max retries exceeded with url: /v2/bot/richmenu/xxx/content (Caused by ConnectTimeoutError)

Potential Root Cause: IP Throttling / WAF Filtering

There is significant evidence suggesting that AWS Lambda public egress IP ranges are being throttled or flagged by LINE's ingress security layers (WAF/DDoS protection) specifically for the api-data.line.me domain.

  1. Behavioral Analysis: The connection "hangs" without a 403 Forbidden or 429 Too Many Requests. This usually indicates packet dropping or extreme rate-limiting at the firewall level before the application layer is reached.
  2. Infrastructure Conflict: Because Lambda uses a shared pool of public IPs, a "noisy neighbor" on AWS might have triggered a block that is now affecting the entire Lambda IP range for this data-intensive endpoint.

Requested Action for LINE Developers

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions