minio / mc

Unix like utilities for object store
https://min.io/download
GNU Affero General Public License v3.0
2.86k stars 548 forks source link

Getting Error: Expected element type <Error> but have <html> #1160

Closed gavin-lai closed 9 years ago

gavin-lai commented 9 years ago

Hi, I am accessing a S3 compatible object storage, works fine with s3cmd in Linux, I am trying in Windows with mc, I get the following with mc ls command: mc: Unable to list target https://URL Expected element type but have

Any ideas. Thanks

harshavardhana commented 9 years ago

mc: Unable to list target https://URL Expected element type but have

HI Gavin, can you post --debug output with "mc --debug https://URL" ?

harshavardhana commented 9 years ago

Also are you using signature v4 or v2 authentication with S3 compatible storage? mc does signature v4 by default to enable signature v2 you have to use the following

 2. Add host configuration for a URL, using s3 api v2. For security reasons turn off bash history
      $ set +o history
      $ mc config host add s3.amazonaws.com BKIKJAA5BMMU2RHO6IBB V7f1CwQqAcwo80UEIJEjc5gVQUSSx5ohQ9GSrr12 S3v2
      $ set -o history
gavin-lai commented 9 years ago

the S3v2 option give me errors

harshavardhana commented 9 years ago

the S3v2 option give me errors

can you post the "--debug" output? - also can you paste your "mc version" ?

gavin-lai commented 9 years ago

mc: GET http://URL?delimiter=%2F&max-keys=1000 HT TP/1.1 Host: URL User-Agent: Minio/2015-09-05T23:43:46.472424767Z (mc; windows; amd64) Authorization: AWS4-HMAC-SHA256 Credential= y/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature =REDACTED X-Amz-Content-Sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b78 52b855 X-Amz-Date: 20151005T162036Z Accept-Encoding: gzip

mc: HTTP/1.0 502 Bad Gateway Connection: close Cache-Control: no-cache Connection: close Content-Type: text/html

mc: Response Time: 314ms

mc: Unable to list target `https://URL'. expected element type but have (4) ...C:/mygo/src/github.com/minio/mc/ls-main.go:116 main.mainList(..) Tags: https://URL ...C:/mygo/src/github.com/minio/mc/ls-main.go:126 main.doListCmd(..) Tags: https://URL ...C:/mygo/src/github.com/minio/mc/ls.go:129 main.doList(..) (1) ...C:/mygo/src/github.com/minio/mc/ls.go:123 main.doList(..) (0) ...C:/mygo/src/github.com/minio/mc/pkg/client/s3/s3.go:304 s3.(*s3Client).l istInRoutine(..) Host:TR1LS432897 | OS:windows | Arch:amd64 | Lang:go1.5 | Mem:1.1MB/4.5MB | Hea p:1.1MB/1.9MB

gavin-lai commented 9 years ago

I replace all addresses with URL mc version Sat, 05 Sep 2015 23:43:46 GMT

gavin-lai commented 9 years ago

Is there a manual way to add S3v2 in the configuration file?

harshavardhana commented 9 years ago

mc version Sat, 05 Sep 2015 23:43:46 GMT

Ah this release version doesn't support S3v2 yet, can you download the latest from

mc update experimental

This command will show you a link to download the latest binary, we have some more changes coming into mc before we are going to make a new proper release.

The sever is sending back 502 Bad Gateway error without any other error elements, upon error mc tries to decode it into a proper S3ErrorResponses. I will add a fix to show a proper error when it cannot decode.

harshavardhana commented 9 years ago

Is there a manual way to add S3v2 in the configuration file?

I will update the experimental code once again today.. give me couple of hrs to update it. I will paste the link here.

gavin-lai commented 9 years ago

Experimental output: mc: HEAD http://URL/ HTTP/1.1 Host: URL User-Agent: Minio/Tue, 22 Sep 2015 21:15:45 GMT (mc; windows; amd64) Authorization: AWS REDACTED:REDACTED Date: Mon, 05 Oct 2015 16:45:35 GMT

mc: HTTP/1.0 502 Bad Gateway Connection: close Cache-Control: no-cache Connection: close Content-Type: text/html

mc: Response Time: 127.0254ms

mc: Unable to list target `https://URL/'. 502 Bad Gateway (2) ...C:/mygo/src/github.com/minio/mc/ls-main.go:118 main.mainList(..) Tags: https://URL/ ...C:/mygo/src/github.com/minio/mc/ls.go:111 main.doList(..) Tags: https://URL/ ...C:/mygo/src/github.com/minio/mc/pkg/client/s3v2/s3v2.go:192 s3v2.(*s3Client).Stat(..) Host:TR1LS432897 | OS:windows | Arch:amd64 | Lang:go1.5.1 | Mem:867kB/4.7MB | Heap:867kB/2.0MB

harshavardhana commented 9 years ago

Working on getting a new windows binary, will let you know once its uploaded.

harshavardhana commented 9 years ago

Working on getting a new windows binary, will let you know once its uploaded.

https://dl.minio.io:9000/updates/experimental/2015/Oct/windows-amd64/mc.exe

or

C:\ mc update experimental

Let me know how it goes, also can you tell me which s3 compatible storage are you using? also can you provide s3cmd debug output?

C:\ s3cmd -d ls 
gavin-lai commented 9 years ago

This binary works. I am using CenturyLink Cloud Object Storage.

harshavardhana commented 9 years ago

This binary works. I am using CenturyLink Cloud Object Storage.

Okay looks like the issue is with CenturyLink middleware we saw issues where a HTTP server cannot understand between relative and absolute requests since according to RFC http both are supported and valid.

GET http://URL/resource
Host: URL
GET /resource
Host: URL

The new release will default to catering for solutions which do not work without relative.

Thanks for being patient!

gavin-lai commented 9 years ago

Would it be possible to display the time and speed summary at the end of the transfer in quiet mode?

harshavardhana commented 9 years ago

Would it be possible to display the time and speed summary at the end of the transfer in quiet mode?

The accounting of transfer and speed summary is done by an external package right now which provides us the way to display progress bar, in quiet mode it can be achieved though shouldn't be a problem.

Please open another issue - we can get it done..

harshavardhana commented 9 years ago

Going to close this for now.. reopen if you have further problems and thanks for testing out mc. Feel free to open any feature requests as you seem fit.. we will take a look.

lock[bot] commented 4 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.