console icon indicating copy to clipboard operation
console copied to clipboard

double slash when put objects from console

Open hsinhoyeh opened this issue 1 year ago • 2 comments

Hi,

I got some issues when uploading files via console. MINIO version: RELEASE.2022-06-17T02-00-35Z, refer to console version v0.18.1

====behaviour====

  • condition:
upload file name: 1.jpg
under the root path of the bucket (i.e. the prefix should be empty string) named mytestbucet
  • what I expected:

as the prefix is empty, it could be skipped during POST API call on the console

POST https://myminio.com/console/api/v1/buckets/mytestbucet/objects/upload \
--data-raw $'------WebKitFormBoundary xxxx...xxx--\r\n'
  • what I got:

instead of getting an empty prefix, I got a prefix with a leading shash ("/"), this makes the signature verification fail.

POST https://myminio.com/console/api/v1/buckets/mytestbucet/objects/upload?prefix=Lw== \
--data-raw $'------WebKitFormBoundary xxxx...xxx--\r\n'

with the message:

code: 500
detailedMessage: "The request signature we calculated does not match the signature you provided. Check your key and signing method."
message: "an error occurred, please try again"

Attach some logs form ingress

172.18.0.1 - - [22/Jul/2022:07:18:06 +0000] "PUT /mytestbucet//1.jpg HTTP/1.1" 403 437 "-" "MinIO (linux; amd64) minio-go/v7.0.28" 74055 0.016 [minio-service-9000] [] 10.244.0.67:9000 437 0.016 403 79e291a8a2e03c2315bae318abe9c92f

====Why this is out of expectation====

when uploading the file to the default path of a bucket, the prefix should be an empty string, not a leading slash shown here. Having a leading slash could make no difference on the server side (in terms of delivering files) but I got an invalid signature message due to this. I believe the double slash makes the signature wrong.

hsinhoyeh avatar Jul 22 '22 07:07 hsinhoyeh

are you trying to upload using Console UI or writing some custom code here using swagger API?

harshavardhana avatar Aug 06 '22 05:08 harshavardhana

are you trying to upload using Console UI or writing some custom code here using swagger API?

I am uploading via console UI, the log I posted above are copied from browser's developer console.

hsinhoyeh avatar Aug 07 '22 14:08 hsinhoyeh

#2305 is a dupe, but that has more config info and logs from the reverse proxy that might help with diagnostics.

ravindk89 avatar Sep 09 '22 16:09 ravindk89