This repository has been archived by the owner. It is now read-only.

Fineuploader shows Upload failed after successful uploading to s3 #2017

Open
truthSeekr opened this Issue Jun 22, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@truthSeekr
Copy link

truthSeekr commented Jun 22, 2018

Type of issue

  • Bug report
  • Feature request

Uploader type

  • Traditional
  • S3
  • Azure

Note: Support requests cannot be accepted due to lack of time.

I cant say its my bad code or bug

Bug Report

Fine Uploader version

{example: 5.16.2}

Browsers where the bug is reproducible

Firefox

Operating systems where the bug is reproducible

Linux for sure

Exact steps required to reproduce the issue

For example:

  1. upload file chunked way

All relevant Fine Uploader-related code that you have written

var s3Uploader = new qq.s3.FineUploader({
element: document.getElementById("uploader"),
autoUpload: false,
debug: true,
objectProperies: {
    host: "http://s3.eu-west-2.amazonaws.com",
    acl: 'private',
    // key: function(fileId) {
    //     return 'folder/within/bucket/' + this.getUuid(fileId);
    // },
    region: "eu-west-2"

},
request: {
    accessKey: "access",
    endpoint: "http://s3.eu-west-2.amazonaws.com/xxx/test",
    customHeaders: {
        'Access-Control-Allow-Origin': "http://localhost:3000",
        'Access-Control-Allow-Credentials': "true"
    }

},
signature: {
    endpoint: "/get_signature",
    version: 4,
    host: "http://s3.eu-west-2.amazonaws.com",
    region: "eu-west-2",
    customHeaders: {
            'X-CSRF-Token': $('meta[name="csrf-token"]').attr('content')
            // 'Authorization': AWS4-HMAC-SHA256 Credential=access/20150830/us-east-1/iam/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature=5d672d79c15b13162d9279b0855cfba6789a8edb4c82c400e06b5924a6f2b5d7
    }
},
uploadSuccess: {
    endpoint: "/dashboard"
},
iframeSupport: {
    localBlankPagePath: "success.html"
},
chunking: {
    enabled: true,
    concurrent: {
        enabled: true
    }

},
resume: {
    enabled: true
},
retry: {
    enableAuto: true,
    showButton: true
},
validation: {
    itemLimit: 1,
    // sizeLimit: 524243,//1048576, //1mb
    acceptFiles: ["image/*"]
    // allowedExtension: 
},
cors: {
    //all requests are expected to be cross-domain requests
    expected: true,

    //if you want cookies to be sent along with the request
    sendCredentials: true
},
callbacks: {
    onSubmit: function(id, filename){

    }
}});}

Detailed explanation of the problem

The upload is successful, I can see the file in my bucket but fineupload cant manage to verify if this was indeed success. chunk indexes are still marked as in progress so i belive this is a problem

Errors Im getting
XML processing error
([Fine Uploader 5.16.2] File ID 0 has no more chunks to send and these chunk indexes are still marked as in-progress: [1,4] util.js:236:16 XML processing error: active item not found Obszar: http://s3.eu-west-2.amazonaws.com/xxx/test/8097845f-238b-4f7f-a230-e414febac146.jpg?partNumber=4&uploadId=hvy67lKG.0i5iOfus3oYbMg7l9cYxzSlHIL2gpRlkt8tk1LKhPEGKTJbg1laGHjpl3u.oHDRQPfv2_GYE3mprNqwjdEEU_wxkrzihbPpyJjW5gL4smyJhUHnuGBblzjH Numer wiersza: 1, kolumna 1:)

And after last chunk sended
[Fine Uploader 5.16.2] Complete response status 200, body = <?xml version="1.0" encoding="UTF-8"?> <CompleteMultipartUploadResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Location>http://s3.eu-west-2.amazonaws.com/bucketname/test%2F039f4dbc-d90f-462e-a426-6420a8cc0ef0.jpg</Location><Bucket>bucketname</Bucket><Key>test/039f4dbc-d90f-462e-a426-6420a8cc0ef0.jpg</Key><ETag>&quot;f785362cd9c53f730b66f5044b0b17b0-2&quot;</ETag></CompleteMultipartUploadResult> util.js:236:16 [Fine Uploader 5.16.2] Wrong bucket in response to Complete Multipart Upload request for 0. util.js:241:20 [Fine Uploader 5.16.2] Received response status 200 with body: <?xml version="1.0" encoding="UTF-8"?> <CompleteMultipartUploadResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Location>http://s3.eu-west-2.amazonaws.com/bucketname/test%2F039f4dbc-d90f-462e-a426-6420a8cc0ef0.jpg</Location><Bucket>bucketname</Bucket><Key>test/039f4dbc-d90f-462e-a426-6420a8cc0ef0.jpg</Key><ETag>&quot;f785362cd9c53f730b66f5044b0b17b0-2&quot;</ETag></CompleteMultipartUploadResult> util.js:236:16 [Fine Uploader 5.16.2] Problem finalizing chunks for file ID 0 - undefined

I think this is related and for me problem persist in newest version
#1530

in function handleCompleteRequestComplete
bucketEls[0].textContent !== bucket

bucketEls[0].textContent = bucketname
bucket = bucketname.s3.eu-west-2.amazonaws.com

so no matter what it will always be false
why it doesnt take the bucketname from configuration ?

On the begining there was:
objectProperties: { acl: "private", bucket: qq.bind(function(id) { return qq.s3.util.getBucket(this.getEndpoint(id)); }, this),
is it on purpose ? why bucket property should be based on endpoint ? Can I change it or I will ruin something ?

@rnicholus

This comment has been minimized.

Copy link
Member

rnicholus commented Jun 29, 2018

If you see an issue in the codebase, please open up a PR with your proposed fix. Thanks.

@truthSeekr

This comment has been minimized.

Copy link

truthSeekr commented Jun 29, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.