Common Fault Locating

During the OBS running, a connection exception "Connection Timeout" occurs.

  1. The network connection timed out due to a three-way handshake failure occurred during the TCP connection establishment. In this scenario, rectify the fault of the network between the client and OBS.
    1. On the client for accessing OBS, check whether the service address and port of OBS are correctly configured.
    2. Check whether the OBS network is well connected by using a curl or wget command.
  2. OBS detects that the signatures do not match and returns error SignatureDoesNotMatch.
    1. Check whether the OBS domain name configured on the client is consistent with the OBS domain name in actual use.
    2. Check whether the AK/SK configuration on the client is correct.

OBS Returns a 403 Error

  • Signature error

After receiving an HTTP/HTTPS request, OBS obtains the specified headers or the query parameters using the signature calculation method and constructs StringToSign, and then calculates the signature and compares it with the client signature to check whether they are identical.

The server returns a 403 error if:

  1. The headers used by the client for calculating signatures differ from those in the HTTP message. For example, the value of Date used by the client is the time for signature calculation and that used by OBS is the request time.
  2. The signature calculation rules of the client and those of OBS are different. When OBS prompts a signature error, the StringToSign used by OBS for signature calculation will be contained in the message body and returned to the client.

The following is an example error. After receiving a request and detecting the signatures unmatched, OBS returns the StringToSign used by the client for signature calculation as the <StringToSign> element. The client uses the OBS-returned information and reviews the calculation process to locate the fault.

<Error>
  <Code>SignatureDoesNotMatch</Code>
  <Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message>
  <RequestId>BF26000001644584C8706D0A72B15B3B</RequestId>
  <HostId>tOumRKZ6scsAf+JDHrVDTAHehSWiCapYoJk8NubeelNQu5IqtPpsd42ICClPnJSG</HostId>
  <AccessKeyId>UDSIAMSTUBTEST000003</AccessKeyId>
  <SignatureProvided>amgvrLdL0N1XKBUAiWodhGkbpow=</SignatureProvided>
  <StringToSign>GET


Thu, 28 Jun 2018 08:31:27 GMT
/bucket02/?cors</StringToSign>
  <StringToSignBytes>47 45 54 0a 0a 0a 54 68 75 2c 20 32 38 20 4a 75 6e 20 32 30 31 38 20 30 38 3a 33 31 3a 32 37 20 2b 30 30 30 30 0a 2f 62 75 63 6b 65 74 30 32 2f 3f 63 6f 72 73</StringToSignBytes>
</Error>
  • Other errors

After receiving an HTTP/HTTPS request, OBS checks the time when the request is sent by a client. If the time difference between the client and the server exceeds 15 minutes, the server returns error 403.

Incorrect MD5 Value of the Object to Be Uploaded

In APIs for uploading an object, Content-MD5 header can carry the MD5 value of the object to be uploaded. After receiving the request, the server checks whether the MD5 value of the received object is consistent with that of the client. If no, a data error occurs, and the server rejects the upload and the error message BadDigest is displayed.

MD5 is the Base64-encoded 128-bit MD5 digest of the HTTP message according to RFC 1864.

For example, if the preceding content is 1234567890, the calculation method for the Content-Md5 of the character string is as follows:

Calculate the binary array (128 bits) encrypted by MD5, and perform Base64 coding on this binary (rather than encoding the 32-bit character string).

import base64,hashlib
hash = hashlib.md5()
hash.update("1234567890")
base64.b64encode(hash.digest())

The result is 6Afx/PgtEy+bsBjKZzihnw==

Server Returns a 5xx Error

To facilitate fault locating and handling, OBS creates a unique requestID for each request and returns the requestID to the client as the value of header x-obs-request-id. If an error occurs, print this header and the message body which may help you for troubleshooting.