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
- Initialize
MessagingApiDataApi in an AWS Lambda function.
- Call
set_rich_menu_image with a standard valid PNG/JPEG (e.g., 800KB).
- Set Lambda timeout to 30s+.
- 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.
- 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.
- 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
System Information
line-bot-sdk-pythonv3.xap-northeast-1, potentially others.Expected Behavior
The
set_rich_menu_imagemethod 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.mework flawlessly, binary uploads toapi-data.line.mefrequently 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.api.line.meapi-data.line.meSteps to Reproduce
MessagingApiDataApiin an AWS Lambda function.set_rich_menu_imagewith a standard valid PNG/JPEG (e.g., 800KB).ConnectTimeoutErrordespite the image size being well within limits.External References:
Logs
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.medomain.Requested Action for LINE Developers
ap-northeast-1) are being subjected to aggressive filtering onapi-data.line.me.