Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RocketChat 3.0.4 does not allow .zip uploads (HTTP 400) #17011

Open
ghost opened this issue Mar 25, 2020 · 16 comments
Open

RocketChat 3.0.4 does not allow .zip uploads (HTTP 400) #17011

ghost opened this issue Mar 25, 2020 · 16 comments

Comments

@ghost
Copy link

ghost commented Mar 25, 2020

Uploading of .pdf, .jpeg or .doc works but when I try to upload a ZIP archive, I get a HTTP 400 response back for the POST request from the back-end. Site URL is set correctly, I tried GridFS as well as local file-system, tried allow unauthroized uploads, etc. - this all did not help.

Btw I am running RocketChat via docker-compose in docker containers.

Any help is appreciated.

@introspection3
Copy link

Sir,my version 2.4.11 is working fine. You can try just as below
image

Could you give me a hand.
#17020

run docker-compose with multiple instances will meet a strange but ' MongoError: ns not found', 'Errors like this can cause oplog processing errors.'

@buchey8070
Copy link

buchey8070 commented Mar 26, 2020

EDIT: if I allow every file type, the upload works. So some issue on the file check?

Same issue here - without docker.
Yesterday updated to 3.0.x - Screenshots are working fine, zip-Uploads aren't.

Configured same media types, increased upload size, nothing helped either.

Got some infos from the debug logs:

API ➔ debug post rooms.upload/:rid threw an error: Error: File type is not accepted. [error-invalid-file-type] at Filter.validateFileUpload [as onCheck] (app/file-upload/server/lib/FileUpload.js:93:10) at Filter.check (packages/jalik:ufs/ufs-filter.js:98:57) at FileUploadClass.insert (app/file-upload/server/lib/FileUpload.js:535:11) at FileUploadClass.insertSync (packages/meteor.js:306:21) at DDPCommon.MethodInvocation.<anonymous> (app/api/server/v1/rooms.js:122:35) at packages/dispatch_run-as-user.js:211:14 at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1234:12) at Object.Meteor.runAsUser (packages/dispatch_run-as-user.js:210:33) at Object.post (app/api/server/v1/rooms.js:120:27) at app/api/server/api.js:343:82 at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1234:12) at Object._internalRouteActionHandler [as action] (app/api/server/api.js:343:39) at Route.share.Route.Route._callEndpoint (packages/nimble_restivus/lib/route.coffee:150:32) at packages/nimble_restivus/lib/route.coffee:59:33 at packages/simple_json-routes.js:98:9 API ➔ debug Failure { statusCode: 400, body: { success: false, error: 'File type is not accepted. [error-invalid-file-type]', stack: undefined, errorType: 'error-invalid-file-type' } }

@ghost
Copy link
Author

ghost commented Mar 27, 2020

Yes, same here. when I clear the list of allowed mime-types I can upload a ZIP file. Seems to be a mime-type mismatch (in combination with a broken error feedback loop).

@JeroenAdam
Copy link

JeroenAdam commented Jun 3, 2020

Same here, uploading of .pdf works while .zip returns HTTP 400 Bad gateway. This issue for some users, while not for other users. Issue seems not related to client devices after many tests.
Solved for me by downgrading from v3.12 to v3.02.

@hans4rc
Copy link

hans4rc commented Jun 9, 2020

same here

when i upload a zip file, i get the dialog correctly with no error message
image

but then i get this error message
image

Upgrade from 2.4.11 to 3.3.0 last week

I tested this mime types = application/x-zip and application/zip

for now i use rar

@codeneno
Copy link

codeneno commented Jun 21, 2020

it's application/x-zip-compressed, so sorry

@hans4rc
Copy link

hans4rc commented Jun 21, 2020

RC 3.3.0 - 1.15.0-beta.3411

Test with application/x-zip – Google Chrome, Edge, FireFox
image

Test with application/x-zip-compressed – Google Chrome, Edge, FireFox
image

Test with application/zip – Google Chrome, Edge, FireFox
image

**When I put a zip in RC, everything still looks ok. The error message only appears when I click on Send/Upload. **

@codeneno
Copy link

sir,we as using 3.3.3 with application/x-zip-compressed,
every thing is fine

@hans4rc
Copy link

hans4rc commented Jun 22, 2020

Hi codeneno, thanks for the reply, the error is reproducible on other computers. I will upgrade to 3.3.3

@codeneno
Copy link

you are welcome

@codeneno
Copy link

codeneno commented Jun 22, 2020

@hans4rc how many users do you have? we just want to know how to support more than 8k people

@hans4rc
Copy link

hans4rc commented Jun 22, 2020

At present we have 146 users here.

@hans4rc
Copy link

hans4rc commented Jun 22, 2020

Very interesting!
Upgraded to 3.3.3
Tested on various computers

application/zip = ok

application/x-zip = failed

application/x-zip-compressed = failed

application/zip,application/x-zip,application/x-zip-compressed = ok
application/zip,application/x-zip,application/x-zip-comoressed = ok even with typing error

So, THE correct and only working MIME type is application/zip!

@codeneno
Copy link

haha,it's a small bug

@github-actions
Copy link
Contributor

github-actions bot commented Oct 7, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stat: stale Stale issues will be automatically closed if no activity label Oct 7, 2020
@hans4rc
Copy link

hans4rc commented Oct 7, 2020

At the moment i use version 3.4.2

I have set the following values for the compressed media types:
application/x-compressed-zip
application/x-rar-compressed
application/octet-stream
application/x-zip-compressed
application/zip
multipart/x-zip

And it works fine!

Thie issue can be closed.

@github-actions github-actions bot removed the stat: stale Stale issues will be automatically closed if no activity label Oct 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants