Other Notable Issues
If you have any questions during development, post them on the Issues page of GitHub. For details about parameters and usage of each API, see the API Reference
SignatureDoesNotMatch
HTTP Code: 403 Error Code: SignatureDoesNotMatch
Possible causes are as follows:
- The SK input into ObsClient initialization is incorrect. Solution: Make sure that the SK is correct.
- This problem is caused by a bug in the OBS Java SDK of an earlier version. Solution: Upgrade the SDK to the latest version.
- OBS Java SDK 2.1.x versions are incompatible with the dependent library Apache HttpClient. Solution: Use the libraries of fixed versions: httpcore-4.4.4 and httpclient-4.5.3.
MethodNotAllowed
HTTP Code: 405 Error Code: MethodNotAllowed
This error occurs because a feature on which the ObsClient API depends has not been rolled out on the requested OBS server. Contact the OBS O&M team for further confirmation.
BucketAlreadyOwnedByYou
HTTP Code: 409 Error Code: BucketAlreadyOwnedByYou
In OBS, a bucket name must be globally unique. Solution: If this error occurs when the ObsClient.createBucket is called, check whether the bucket exists. You can use either of the following methods to check whether a bucket exists:
Method 1 (recommended): Call ObsClient.listBuckets to query the list of all buckets that you own and check whether the bucket exists.
Method 2: Call ObsClient.headBucket to check whether the bucket exists.
ObsClient.headBucket can query only buckets in the current region, while ObsClient.listBuckets can query buckets in all regions.
BucketAlreadyExists
HTTP Code: 409 Error Code: BucketAlreadyExists
In OBS, a bucket name must be globally unique. Solution: If this error occurs when ObsClient.createBucket is called, it indicates that the bucket has been created by another user. Use another bucket name and try again.
Connection Timeout
HTTP Code: 408 Caused by: java.net.ConnectException: Connection timed out: connect at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method) at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:85)
Possible causes are as follows:
- The endpoint input into ObsClient initialization is incorrect. Solution: Verify to make sure that the endpoint is correct.
- The network between the OBS client and OBS server is abnormal. Solution: Check the health status of the network.
- The OBS domain name resolved by DNS is inaccessible. Solution: Contact the OBS O&M team.
Read/Write Timeout
HTTP Code: 408 Error Code:RequestTimeOut Caused by: java.net.SocketTimeoutException: timeout at okio.Okio$4.newTimeoutException(Okio.java:232) at okio.AsyncTimeout.exit(AsyncTimeout.java:285) at okio.AsyncTimeout$2.read(AsyncTimeout.java:241)
Possible causes are as follows:
- The network latency between the OBS client and OBS server is too long. Solution: Check the health status of the network.
- The network between the OBS client and OBS server is abnormal. Solution: Check the health status of the network.
Abnormal Returned Value -1
HTTP Code: -1
Possible causes are as follows:
- The OBS Java SDK of an earlier version is used and a connection timeout or read/write timeout occurs. Solution: See the solutions for connection timeout and read/write timeout.
- This problem is caused by a bug in the OBS Java SDK of an earlier version. Solution: Download the latest SDK from here.
- The server returns an abnormal result. As a result, an unexpected error occurs when the SDK resolves the returned result. Solution: Obtain the request ID returned by OBS server from the log and contact the OBS O&M team.
Unable to Obtain Error Codes from ObsException
Possible causes are as follows:
- An error is reported when ObsClient.getBucketMetadata or ObsClient.getObjectMetadata is called. In this scenario, the server does not return an error code because the request method used in the background is HEAD. Solution: Call ObsException.getResponseCode to obtain the HTTP status code to analyze the possible cause. For example, 403 indicates that the user does not have the access permission, and 404 indicates that the bucket or object does not exist. If the cause cannot be located, obtain the request ID returned by the OBS server from ObsException and contact the OBS O&M team.
- The IP address of the endpoint obtained after DNS resolution during ObsClient initialization is not a valid IP address of the OBS server. Solution: Check whether the endpoint configuration is correct. If the endpoint configuration is correct, contact the OBS O&M team.
UnknownHostException
Caused by: java.net.UnknownHostException: bucketname.unknowndomain.com at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:901) at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1293)
Possible causes are as follows:
- The endpoint input during ObsClient initialization is incorrect. Solution: Verify to make sure that the endpoint is correct.
- DNS cannot resolve the OBS domain name. Solution: Contact the OBS O&M team.
NullPointException
Exception in thread "main" java.lang.NullPointerException at com.obs.services.internal.RestStorageService.isCname(RestStorageService.java:1213) at com.obs.services.ObsClient.doActionWithResult(ObsClient.java:2805)
Possible causes are as follows:
- ObsClient.close is called to close ObsClient and then another ObsClient API is called. Solution: Call ObsClient.close to release resources only before exiting the application.
- This problem is caused by a bug in the OBS Java SDK of an earlier version. Solution: Download the latest SDK from here.
Connection Leakage
A connection to xxx was leaked. Did you forget to close a response body?
This error occurs when ObsClient.getObject is not properly closed after it is called to obtain the data flow of the object to be downloaded. Solution: Make sure that the ObsObject.getObjectContent.close method is called in the finally statement block to close the connection.
Problem in SDK Version Upgrade
The third-party dependency of the SDK of an earlier version (2.1.x) is not completely compatible with that of the new SDK (3.x). If a program startup error occurs after the earlier version is upgraded to the new version, refer to Resolving Dependency Missing and Dependency Conflict to rectify the fault. If the fault persists, contact the OBS O&M team.
Others
For details, see FAQs.
Last Article: Resolving Dependency Missing and Dependency Conflict
Next Article: Bucket Management
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.