Giter Site home page Giter Site logo

Reading Multi part error about seaweedfs HOT 21 CLOSED

seaweedfs avatar seaweedfs commented on July 30, 2024
Reading Multi part error

from seaweedfs.

Comments (21)

devinrsmith avatar devinrsmith commented on July 30, 2024

This may be b/c my master and volumes where different versions... updating to latest will update soon.

from seaweedfs.

devinrsmith avatar devinrsmith commented on July 30, 2024

Updated everything to 0.68 still has issues, going back to 0.67.

from seaweedfs.

chrislusf avatar chrislusf commented on July 30, 2024

There is a very recent change on parsing multipart uploads.

from seaweedfs.

chrislusf avatar chrislusf commented on July 30, 2024

Related to this? #56

from seaweedfs.

devinrsmith avatar devinrsmith commented on July 30, 2024

Back to 0.67, things working again.

from seaweedfs.

yourchanges avatar yourchanges commented on July 30, 2024

@devinrsmith Could you PLEASE give the request payload or the example to show how the multipart uploads failed?

from seaweedfs.

yourchanges avatar yourchanges commented on July 30, 2024

@devinrsmith by the way, the tons of the error logs is needed too.

And our product env run the master bench very well without any issues.

from seaweedfs.

devinrsmith avatar devinrsmith commented on July 30, 2024

I've rolled back to 0.67 for the time, but I'll see if I can't get a dump of what was sent over the wire later. It should be a pretty standard multipart post I think. I don't think the error logs will help too much as it's just the same thing repeated over and over.

https://gist.github.com/devinrsmith/a55b55e2ac12d50c4559

from seaweedfs.

yourchanges avatar yourchanges commented on July 30, 2024

There is a way to cause into "dead-for" loop, the request payload didn't have a 'filename' properties in dispositionParams parsed from the Content-Disposition. Or you just submit a non-multipart form request to server?

for example:

------------gL6KM7cH2ae0Ij5ae0KM7ae0ae0gL6
Content-Disposition: form-data; name="file"; [filename="IMG_1840.JPG" ---miss ]
Content-Type: application/octet-stream

@devinrsmith could you give the some client javascript code(or the command line) to show how to submit the form

from seaweedfs.

chrislusf avatar chrislusf commented on July 30, 2024

Right. Previous version allows empty file names.

from seaweedfs.

yourchanges avatar yourchanges commented on July 30, 2024

@chrislusf but it seems not RFC(See https://www.ietf.org/rfc/rfc1867.txt ) RECOMMAND if the filename is empty, in the java world "commons-upload.jar" also check the filename to judge a multi-part item DO a file item

And mentioned in #56 , the "Previous version" it will just save the normal form item value into storage(for example: a user name value, even it's not a file), and I think this should be avoid.

So the weedfs should aways fetch the upload file data from a NAMED form item such as : "file"

from seaweedfs.

chrislusf avatar chrislusf commented on July 30, 2024

The previous version supports bare blob. This is because weedfs is more a key~blob store, not necessarily a file with filename.

I suggest we still support uploads with empty filename.

from seaweedfs.

devinrsmith avatar devinrsmith commented on July 30, 2024

Yep, this must be it. I'm not setting filename.

from seaweedfs.

yourchanges avatar yourchanges commented on July 30, 2024

But I think the weedfs is a HTTP file server too, it runs well, and it should handle these clients such as jquery uploadify tool's request.

"support uploads with empty filename" is fine, but "save the normal form item value into storage" should be avoid too.

Lets improve it

from seaweedfs.

chrislusf avatar chrislusf commented on July 30, 2024

Not saying we should not support other tools. But we still can support empty file names.

from seaweedfs.

yourchanges avatar yourchanges commented on July 30, 2024

@chrislusf the improved code: needle.go L64-L84:

    part, fe := form.NextPart()
for {
    if fe != nil {
        glog.V(0).Infoln("Reading Multi part [ERROR]", fe)
        e = fe
        return
    }

    if part.FileName() != "" {
        break //found the first <file type> multi-part
    }

    part2, fe := form.NextPart()

    //no more multi-part items, we take the last multi-part item as the target
    if fe == io.EOF {
        break
    } else {
        part = part2
    }
}

[EDIT: the solution does not work, because the internal reader has been moved to next cased the ioutil.ReadAll(part) method failed]

from seaweedfs.

chrislusf avatar chrislusf commented on July 30, 2024

Haven't tested it but looks good. Send a pull request please.

from seaweedfs.

yourchanges avatar yourchanges commented on July 30, 2024

ok, I'll do it later, it's 03:14 am, Jan 16 in China, I'm going to sleep now.

from seaweedfs.

chrislusf avatar chrislusf commented on July 30, 2024

@devinrsmith Maybe you can confirm the fix?

from seaweedfs.

devinrsmith avatar devinrsmith commented on July 30, 2024

Has a binary been compiled? I can check it out tomorrow.

from seaweedfs.

chrislusf avatar chrislusf commented on July 30, 2024

No compiled binary published yet. But I can send you the binary if you need it. Closing this. My local test seems good.

from seaweedfs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.