Error 400 - Error: DownloadFileAsync. Exception: AmazonS3 Storage exception

Hi, I’m getting this error:

Error: DownloadFileAsync. Exception: AmazonS3 Storage exception: The specified key does not exist. Bucket ‘aspose.cloud-filestorage-prod’, FilePath ‘889410/ce9cb89f-f04a-4c3b-99d1-dd6107ac719f/buffer.bin’.

When running my program. It usually worked, and I didn’t change anything on my application. Any hints where to start looking?

Thanks,
Christoph

Screenshot 2024-07-04 at 5.39.16 PM.png (240.1 KB)

Screenshot 2024-07-04 at 5.39.37 PM.png (216.6 KB)

fyi, it seems it does happen erratically:

image.png (321.4 KB)

@tilal.ahmad , have you seen this before?

Thanks!
Christoph

We apologize for the inconvenience. Our storage system is currently undergoing temporary maintenance and migration. We are working diligently to restore normal service.

Thanks for the update and please update me as soon as it’s fixed so we can resume our service also.

Thanks,
Christoph

Has this been fixed?

@cburgdorfer
Can you confirm the file exists in dashboard?
Thanks.

@cburgdorfer
According to your snapshot image.png, it looks like the file buffer.bin got removed in 2024-07-03, and it reports 400 ERR when you try to access it again in 2024-07-04.

Thanks @lex.chou for your reply. I will continue to research. Although this should be as intended, the file should only be there temporarily for a few minutes max. So these might be different buffer.bin files from two different sessions.

Hi @lex.chou , I am getting this error now:
image.png (303.2 KB)

Any ideas what could be wrong?

Could it have anything to do with this issue?

@cburgdorfer

Can you share how to replicate this?

And please still use https://api.aspose.cloud/connect/token for authentication, we have fixed the authentication-related bug.

By using this cURL request:

*   Trying 100.21.50.252:443...
* Connected to api.aspose.cloud (100.21.50.252) port 443 (#0)
* ALPN: offers h2
* ALPN: offers http/1.1
*  CAfile: /etc/ssl/certs/ca-certificates.crt
*  CApath: /etc/ssl/certs
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
* ALPN: server accepted h2
* Server certificate:
*  subject: CN=*.aspose.cloud
*  start date: Aug  4 00:00:00 2024 GMT
*  expire date: Sep  2 23:59:59 2025 GMT
*  subjectAltName: host "api.aspose.cloud" matched cert's "*.aspose.cloud"
*  issuer: C=US; O=Amazon; CN=Amazon RSA 2048 M03
*  SSL certificate verify ok.
* Using HTTP2, server supports multiplexing
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* h2h3 [:method: PUT]
* h2h3 [:path: /v3.0/3d/storage/file/artwork_VCn4fkgsdkkZfI9jUwyL.usdz]
* h2h3 [:scheme: https]
* h2h3 [:authority: api.aspose.cloud]
* h2h3 [accept: */*]
* h2h3 [authorization: Bearer eyJhbGc... Bearer eyJhbGciO... (received via https://id.aspose.cloud/connect/token)]
* h2h3 [content-length: 538648]
* h2h3 [content-type: multipart/form-data; boundary=------------------------1730498d8479b692]
* Using Stream ID: 1 (easy handle 0x55a5f2078420)
> PUT /v3.0/3d/storage/file/artwork_VCn4fkgsdkkZfI9jUwyL.usdz HTTP/2
Host: api.aspose.cloud
accept: */*
authorization: Bearer eyJhbGciO... (received via https://id.aspose.cloud/connect/token)]
content-length: 538648
content-type: multipart/form-data; boundary=------------------------1730498d8479b692

* Connection state changed (MAX_CONCURRENT_STREAMS == 128)!
* We are completely uploaded and fine
< HTTP/2 401 
< date: Wed, 07 Aug 2024 12:43:19 GMT
< content-type: application/json
< x-debug-request-method: PUT
< x-debug-request-uri: /v3.0/3d/storage/file/artwork_VCn4fkgsdkkZfI9jUwyL.usdz
< x-debug-uri: /v3.0/3d/storage/file/artwork_VCn4fkgsdkkZfI9jUwyL.usdz
< x-debug-scheme: http
< 
* HTTP/2 stream 0 was not closed cleanly: INTERNAL_ERROR (err 2)
* Connection #0 to host api.aspose.cloud left intact

I am receiving the token via:

    private function generateAsposeToken()
    {
        $token = null;
        $ch = curl_init();

        curl_setopt($ch, CURLOPT_URL, 'https://id.aspose.cloud/connect/token');
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_POSTFIELDS, "grant_type=client_credentials&client_id=" . $this->clientCredential['client_id'] . "&client_secret=" . $this->clientCredential['client_secret']);

        $headers = array();
        $headers[] = 'Content-Type: application/x-www-form-urlencoded';
        $headers[] = 'Accept: application/json';
        curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

        $result = curl_exec($ch);
        if (curl_errno($ch)) {
            $this->error[] =  ' -Error:' . curl_error($ch);
        } else {
            if ($tk_class = json_decode($result)) {
                $token = trim($tk_class->access_token);
            } else {
                $this->error[] = 'error getting token';
            }
        }

        curl_close($ch);

        if ($token)
            return $token;
        return false;
    }

Do you have an idea what the issue could be?

@cburgdorfer

Have you tried:

        curl_setopt($ch, CURLOPT_URL, 'https://api.aspose.cloud/connect/token');

?

Oh, that seems to work again, thanks so much!!

The original issue is still there, though:

image.png (41.6 KB)
image.png (33.5 KB)

These two files (gltf/bin) should be created after a successful upload of the USDZ

image.png (28.1 KB)

using this command:

    private function convertToGLTFViaAspose($token, $fileBaseName)
    {
        $usdzFileName = "$fileBaseName.usdz";
        $gltfFileName = "$fileBaseName.gltf";

        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, "https://api.aspose.cloud/v3.0/3d/saveas/newformat?name=$usdzFileName&newformat=gltf2&newfilename=$gltfFileName&IsOverwrite=true");
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_POST, 1);

        $headers = array();
        $headers[] = 'Accept: application/json';
        $headers[] = "Authorization: Bearer $token";
        $headers[] = 'Content-Type: application/x-www-form-urlencoded';

        curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

        $result = curl_exec($ch);

        if (curl_errno($ch)) {
            //printing Curl Error
            $this->error[] =  '- Error:' . curl_error($ch);
            $result = false;
        } elseif (empty($result)) {
            $result = 'Convertsion to gltf completed successfully';
        } else {
            $this->error[] = json_decode($result);
            $result = false;
        }

        curl_close($ch);
        return $result;
    }

I might have found the issue to be a racing condition. I’ll try to find out more, and if it wasn’t a racing condition, I’ll post it here.

@cburgdorfer
It’s good to hear that, you might need to use a session id in your file name for each operations to avoid racing condition.