What do I do if OSS objects cannot be downloaded?

更新时间:
复制 MD 格式

If an OSS object download fails intermittently, the most likely cause is traffic hijacking — either OSS never received the request, or OSS responded but the response was intercepted before reaching your client.

Two indicators in the HTTP response header confirm hijacking:

IndicatorHijacked responseNormal response
Server fieldEmptyAliyunOSS
Cache-Control headerMissingPresent

Diagnose the issue

Start with the OSS access log — it is faster than a packet capture and is often sufficient.

Step 1: Get the request ID from the failed download.

Obtain the request ID captured in the failed download request.

To make log queries easier, enable OSS access logging before you start troubleshooting. For instructions, see Configure logging.

Step 2: Check the OSS access log using the request ID.

Look at the client IP address recorded in the log. If the object was downloaded from an Elastic Compute Service (ECS) instance, the client IP should match the public IP address of that instance. If it does not match, the download did not go directly from ECS to OSS — either a proxy is configured on your side, or the download traffic is being hijacked.

Step 3 (if needed): Capture and analyze packets.

Use a packet capture tool (such as Wireshark or tcpdump) if the log alone does not identify the cause. Compare the response headers of a failed request against a successful one:

  • Failed download: The Server field in the response header is empty, and the Time to Live (TTL) of the TCP three-way handshake packet between the client and OSS is 64.

  • Normal download: The Server field is AliyunOSS, and the TTL is 53 (within the expected range).

Use these two signals to identify hijacking:

  • A valid OSS response always sets Server to AliyunOSS. An empty Server field means the response did not originate from OSS.

  • OSS sends responses with a default TTL of 64. Because TTL decreases by 1 at each network hop, a client receiving a response with TTL = 64 indicates the packet traveled zero hops — a strong sign of hijacking.

The following screenshot shows a captured abnormal response. The Server field is empty and the TTL (packet #1153) is 64.

p880051

The following screenshot shows a captured normal response. The Server field is AliyunOSS and the TTL is 53.

a54ef67ac4c92217300c7d93507c6cc1

Solution

If you confirm the download traffic is being hijacked:

  1. Check your network environment for proxy configurations on the client side that may be routing traffic unexpectedly.

  2. Switch to HTTPS to prevent traffic interception. For details, see How HTTPS access is implemented in OSS.