Download a file from minio with OnlyOffice,but minio return 400 Bad Request

I got a file share link from minio console like this:

http://ip:port/bucketName/fileName.doc?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=IG1WBN2TQ02QJ7Z5XMC1%2F20220808%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20220808T080749Z&X-Amz-Expires=604800&X-Amz-Security-Token=eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhY2Nlc3NLZXkiOiJJRzFXQk4yVFEwMlFKN1o1WE1DMSIsImV4cCI6MzYwMDAwMDAwMDAwMCwicG9saWN5IjoiY29uc29sZUFkbWluIn0.Fkl187a8qfjVJ4C1prygtHw0–WYdjbiI2M_-B3KbuGz3LMuMS6tN1-cd5lLAyKs7Ir2yakv8ONYzCxWp-mm_Q&X-Amz-SignedHeaders=host&versionId=null&X-Amz-Signature=369045b8d5347f38d9bb6704684b397115fb6a212e6de65b4d88802d9ec87c8c

And I copy this url into browser, it works and can download a file.

But when I use OnlyOffice, it will download this file and show in it’s editor ,but OnlyOffice got a 400 error, below is the whole error:
[2022-08-08T08:09:41.265] [ERROR] nodeJS - error downloadFile:url=http://10.0.100.71:9000/pritest/333.doc?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=IG1WBN2TQ02QJ7Z5XMC1%2F20220808%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20220808T080749Z&X-Amz-Expires=604800&X-Amz-Security-Token=eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhY2Nlc3NLZXkiOiJJRzFXQk4yVFEwMlFKN1o1WE1DMSIsImV4cCI6MzYwMDAwMDAwMDAwMCwicG9saWN5IjoiY29uc29sZUFkbWluIn0.Fkl187a8qfjVJ4C1prygtHw0--WYdjbiI2M_-B3KbuGz3LMuMS6tN1-cd5lLAyKs7Ir2yakv8ONYzCxWp-mm_Q&X-Amz-SignedHeaders=host&versionId=null&X-Amz-Signature=369045b8d5347f38d9bb6704684b397115fb6a212e6de65b4d88802d9ec87c8c;attempt=3;code:undefined;connect:undefined;(id=290168968) Error: Error response: statusCode:400; headers:{"accept-ranges":"bytes","content-length":"228","content-type":"application/xml","server":"MinIO","vary":"Origin","date":"Mon, 08 Aug 2022 08:09:41 GMT"}; at Request.fResponse (/snapshot/server/build/server/Common/sources/utils.js) at Request.emit (events.js:400:28) at Request.onRequestResponse (/snapshot/server/build/server/Common/node_modules/request/request.js:1059:10) at ClientRequest.emit (events.js:400:28) at HTTPParser.parserOnIncomingClient (_http_client.js:647:27) at HTTPParser.parserOnHeadersComplete (_http_common.js:126:17) at Socket.socketOnData (_http_client.js:515:22) at Socket.emit (events.js:400:28) at addChunk (internal/streams/readable.js:290:12) at readableAddChunk (internal/streams/readable.js:265:9) at Socket.Readable.push (internal/streams/readable.js:204:10) at TCP.onStreamRead (internal/stream_base_commons.js:188:23)

It seems that minio return the xml info like this:
`<?xml version="1.0" encoding="UTF-8"?>
InvalidRequestInvalid

Request/pritest/333.docc1d6cdc2-a914-4d73-87c9-3348fe1131a5`

So hows can I work with this situation?
Thanks!

Hello,
You should look for the reason of why minio replies with error 400 in minio logs. Also you can try executing wget http://file-download-link from your Document Server and see if it can be downloaded.

我也遇到了这个问题,onlyoffice在读取minio的预签名的文件时,会提示400,由于minio返回的错误是xml,所以看onlyoffice后台没有具体的报错。
然后根据onlyoffice日志中的请求文件链接,在onlyoffice所在服务器上用 wget ,是能请求到文件的。
后来根据多次调试 ,发现有可能是 %2F 的问题,minio的预签名的文件url中是带有 %2F的。只要带了这个符号,哪怕访问公开的minio的文件,也是返回400。
所以是onlyoffice 中请求的问题?

https://forum.onlyoffice.com/t/downloading-error/11761/7
后来参考这个文章,把Authorization改为 AuthorizationJwt就好了

那,问题已解决好吗?

是的,问题已经解决了

您好,好的,感谢您的分享