Problem description
The access to a symbolic link to which another symbolic link points fails.
Causes
You initiated a request to access a symbolic link, but the object to which the symbolic link points is also a symbolic link. As a result, the error is returned.
Examples
For example, you initiate the following request:
GET /link-to-link HTTP/1.1
Host: oss-example.oss-cn-hangzhou.aliyuncs.com
Date: Wed, 02 Jan 2019 13:28:38 GMT
Authorization: OSS qn6q**************:77Dv****************In the preceding request, the link-to-link object that you want to access is a symbolic link, and the object to which link-to-link points is also a symbolic link. As a result, the error is returned.
Solutions
Call the GetSymlink operation to query the path of the object to which a symbolic link points. Sample code:
GET /link-to-link?symlink HTTP/1.1
Host: oss-example.oss-cn-hangzhou.aliyuncs.com
Date: Wed, 02 Jan 2019 13:28:38 GMT
Authorization: OSS qn6q**************:77Dv****************A response similar to the following result is returned:
HTTP/1.1 200 OK
Server: AliyunOSS
Date: Wed, 02 Jan 2019 13:28:38 GMT
Last-Modified: Wed, 01 Jan 2019 13:28:38 GMT
Content-Length: 0
Connection: keep-alive
x-oss-request-id: 5650BD7****FB30443962F9A
x-oss-symlink-target: link-to-jpg
ETag: "A797938C31D59EDD08D86188F6D5****"The value of the x-oss-symlink-target field indicates that the object to which link-to-link points is link-to-jpg. In this case, you can call the GetSymlink operation to query the path of the object to which link-to-jpg points. Sample code:
GET /link-to-jpg?symlink HTTP/1.1
Host: oss-example.oss-cn-hangzhou.aliyuncs.com
Date: Wed, 02 Jan 2019 13:28:38 GMT
Authorization: OSS qn6q**************:77Dv****************In this example, the following result is returned:
HTTP/1.1 200 OK
Server: AliyunOSS
Date: Wed, 02 Jan 2019 13:28:38 GMT
Last-Modified: Wed, 01 Jan 2019 13:28:38 GMT
Content-Length: 0
Connection: keep-alive
x-oss-request-id: 5650BD7****FB30443962F9A
x-oss-symlink-target: oss.jpg
ETag: "A797938C31D59EDD08D86188F6D5****"The result indicates that link-to-jpg is a symbolic link that points to oss.jpg. This way, link-to-link is a symbolic link that points to another symbolic link. The error is returned for the GetObject or HeadObject request on objects like link-to-link. You must make sure that the symbolic link that you want to access does not point to another symbolic link.