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

Error loading files with accent in name when storage type is Amazon S3 #8752

Closed
glesio opened this issue Nov 1, 2017 · 3 comments
Closed

Comments

@glesio
Copy link

glesio commented Nov 1, 2017

Description:

The current value of "ContentDisposition" metadata does not comply with the specifications of Amazon S3

"The following character sets are generally safe for use in key names:
Alphanumeric characters [0-9a-zA-Z]
Special characters !, -, _, ., *, ', (, and )"
http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html

Server Setup Information:

Server:
Version: 0.59.3
Node version: v4.8.4
Database Migration: 104
Deployment: Docker
File Upload: Amazon S3

Steps to Reproduce:

Filename Example: arquivo-com-acentuação.pdf

Relevant logs:

[34mI20171101-15:59:31.987(0) Exception while invoking method 'ufsComplete' AccessDenied: Access Denied   at Object.Future.wait (/app/bundle/programs/server/node_modules/fibers/future.js:449:15)   at [object Object].Meteor.methods.ufsComplete (/app/bundle/programs/server/packages/jalik_ufs.js:817:24)   at [object Object].methodsMap.(anonymous function) (/app/bundle/programs/server/packages/rocketchat_lib.js:1276:26)   at [object Object].methodMap.(anonymous function) (packages/rocketchat_monitoring.js:2731:30)   at maybeAuditArgumentChecks (/app/bundle/programs/server/packages/ddp-server.js:1857:12)   at /app/bundle/programs/server/packages/ddp-server.js:903:20   at [object Object].EVp.withValue (packages/meteor.js:1134:15)   at /app/bundle/programs/server/packages/ddp-server.js:902:47   at [object Object].EVp.withValue (packages/meteor.js:1134:15)   at /app/bundle/programs/server/packages/ddp-server.js:901:46   at [object Object]._.extend.protocol_handlers.method (/app/bundle/programs/server/packages/ddp-server.js:874:21)   at /app/bundle/programs/server/packages/ddp-server.js:753:85      - - - - -   at Request.extractError (/app/bundle/programs/server/npm/node_modules/aws-sdk/lib/services/s3.js:577:35)   at Request.callListeners (/app/bundle/programs/server/npm/node_modules/aws-sdk/lib/sequential_executor.js:105:20)   at Request.emit (/app/bundle/programs/server/npm/node_modules/aws-sdk/lib/sequential_executor.js:77:10)   at Request.emit (/app/bundle/programs/server/npm/node_modules/aws-sdk/lib/request.js:683:14)   at Request.transition (/app/bundle/programs/server/npm/node_modules/aws-sdk/lib/request.js:22:10)   at AcceptorStateMachine.runTo (/app/bundle/programs/server/npm/node_modules/aws-sdk/lib/state_machine.js:14:12)   at /app/bundle/programs/server/npm/node_modules/aws-sdk/lib/state_machine.js:26:10   at Request.<anonymous> (/app/bundle/programs/server/npm/node_modules/aws-sdk/lib/request.js:38:9)   at Request.<anonymous> (/app/bundle/programs/server/npm/node_modules/aws-sdk/lib/request.js:685:12)   at Request.callListeners (/app/bundle/programs/server/npm/node_modules/aws-sdk/lib/sequential_executor.js:115:18)   at Request.emit (/app/bundle/programs/server/npm/node_modules/aws-sdk/lib/sequential_executor.js:77:10)   at Request.emit (/app/bundle/programs/server/npm/node_modules/aws-sdk/lib/request.js:683:14)   at Request.transition (/app/bundle/programs/server/npm/node_modules/aws-sdk/lib/request.js:22:10)   at AcceptorStateMachine.runTo (/app/bundle/programs/server/npm/node_modules/aws-sdk/lib/state_machine.js:14:12)   at /app/bundle/programs/server/npm/node_modules/aws-sdk/lib/state_machine.js:26:10   at Request.<anonymous> (/app/bundle/programs/server/npm/node_modules/aws-sdk/lib/request.js:38:9)   at Request.<anonymous> (/app/bundle/programs/server/npm/node_modules/aws-sdk/lib/request.js:685:12)   at Request.callListeners (/app/bundle/programs/server/npm/node_modules/aws-sdk/lib/sequential_executor.js:115:18)   at callNextListener (/app/bundle/programs/server/npm/node_modules/aws-sdk/lib/sequential_executor.js:95:12)   at IncomingMessage.onEnd (/app/bundle/programs/server/npm/node_modules/aws-sdk/lib/event_listeners.js:269:13)   at emitNone (events.js:72:20)   at IncomingMessage.emit (events.js:166:7)   at endReadableNT (_stream_readable.js:923:12)   at nextTickCallbackWith2Args (node.js:511:9)   at process._tickDomainCallback (node.js:466:17)
@paulovitin
Copy link
Contributor

paulovitin commented Dec 5, 2017

I had the same problem in another project. Just encode file name with encodeURI and solve this. This solution works for me using S3 sdk.

@paulovitin
Copy link
Contributor

If ok, I could send a PR to this @glesio.

@glesio
Copy link
Author

glesio commented Dec 7, 2017

Thank you for collaboration.

@rodrigok rodrigok added this to the 0.60.0 milestone Dec 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants