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

mc ls no longer work with GCS since 2019-12-17T23-26-28Z #3073

Closed
wsxiaoys opened this issue Feb 8, 2020 · 10 comments
Closed

mc ls no longer work with GCS since 2019-12-17T23-26-28Z #3073

wsxiaoys opened this issue Feb 8, 2020 · 10 comments

Comments

@wsxiaoys
Copy link

wsxiaoys commented Feb 8, 2020

Expected behavior

mc ls google/... worked.

Actual behavior

mc: Unable to list folder. A header or query you provided requested a function that is not implemented.
(1) ls.go:132 cmd.doList(..) Tags: [https://storage.googleapis.com/ps-gcs/]
(0) client-s3.go:1906 cmd.(*s3Client).listInRoutine(..)
Commit:b70a79e39bbd | Release-Tag:RELEASE.2020-01-25T03-02-19Z | Host:jupyter-meng | OS:linux | Arch:amd64 | Lang:go1.13.6 | Mem:2.1 MB/72 MB | Heap:2.1 MB/66 MB

mc --version

mc version RELEASE.2020-01-25T03-02-19Z

@kannappanr
Copy link
Collaborator

@wsxiaoys Thanks for reporting the issue, we will take a look and get back to you.

@kannappanr
Copy link
Collaborator

@wsxiaoys It is working as expected with this release. Can you please verify that mc config host list gcs prints the accesskey and secret key that you expect. Most probably those creds are not part of the alias. Based on the executable name, mc creates a folder in the home folder and each binary name will have it's own config.json file. You might have to add those creds to that alias again.

@jonassvatos
Copy link

I can confirm this bug, which appeared in RELEASE.2019-12-17T23-26-28Z.
Since this version, accessing data on GCS is impossible (upload is possible though).
Just try it for yourself:
(both releases have their respective configs with the same access credentials)

RELEASE.2019-10-09T22-54-57Z

$  ./mc.RELEASE.2019-10-09T22-54-57Z ls --json gcs/test1582795099
{
 "status": "success",
 "type": "file",
 "lastModified": "2020-02-27T10:19:12.098+01:00",
 "size": 9,
 "key": "testfile",
 "etag": "blabla"
}

RELEASE.2019-12-17T23-26-28Z

$ ./mc.RELEASE.2019-12-17T23-26-28Z ls --json gcs/test1582795099
{
 "status": "error",
 "error": {
  "message": "Unable to list folder.",
  "cause": {
   "message": "A header or query you provided requested a function that is not implemented.",
   "error": {
    "Code": "NotImplemented",
    "Message": "A header or query you provided requested a function that is not implemented.",
    "BucketName": "",
    "Key": "",
    "RequestID": "",
    "HostID": "",
    "Region": ""
   }
  },
  "type": "error",
  "sysinfo": {
   "host.arch": "amd64",
   "host.cpus": "32",
   "host.lang": "go1.13.5",
   "host.name": "blabla",
   "host.os": "linux",
   "mem.heap.total": "66 MB",
   "mem.heap.used": "2.5 MB",
   "mem.total": "72 MB",
   "mem.used": "2.5 MB"
  }
 }
}

@harshavardhana
Copy link
Member

harshavardhana commented Feb 27, 2020

This is because GCS doesn't implement encoding--type=url for their ListObjectsV2 implementation or may be metadata=true field is ignored.

@manigandham
Copy link

We've run into the same issue, latest release doesn't list files on GCS.

@harshavardhana
Copy link
Member

@lsde can you provide --debug output?

@manigandham
Copy link

Here's our debug output if this helps:

mc ls --json --debug gs/dbfiles-1
mc: <DEBUG> GET /dbfiles-1/?location= HTTP/1.1
Host: storage.googleapis.com
User-Agent: MinIO (linux; amd64) minio-go/v6.0.49 mc/2020-02-25T18:10:03Z
Authorization: AWS4-HMAC-SHA256 Credential=**REDACTED**/20200303/us-east-1/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=**REDACTED**
X-Amz-Content-Sha256: UNSIGNED-PAYLOAD
X-Amz-Date: 20200303T074535Z
Accept-Encoding: gzip
mc: <DEBUG> HTTP/1.1 200 OK
Content-Length: 81
Alt-Svc: quic=":443"; ma=2592000; v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000
Cache-Control: private, max-age=0
Content-Type: application/xml; charset=UTF-8
Date: Tue, 03 Mar 2020 07:45:35 GMT
Expires: Tue, 03 Mar 2020 07:45:35 GMT
Server: UploadServer
X-Goog-Metageneration: 9
X-Guploader-Uploadid: AEnB2UqQx_KfFFpTG4a05k6l5Vrttp6PiD1LU0gYVeRrFNeURLRpOvWNbc6THp3_wIoloUobmU_JIqTiFiqttj5w8TlFIUo5FogHKjrQVo0guM_lGbftq9E
mc: <DEBUG> Response Time:  144.900019ms
mc: <DEBUG> HEAD / HTTP/1.1
Host: dbfiles-1.storage.googleapis.com
User-Agent: MinIO (linux; amd64) minio-go/v6.0.49 mc/2020-02-25T18:10:03Z
Authorization: AWS4-HMAC-SHA256 Credential=**REDACTED**/20200303/US/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=**REDACTED**
X-Amz-Content-Sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
X-Amz-Date: 20200303T074535Z
mc: <DEBUG> HTTP/1.1 200 OK
Content-Length: 1198
Alt-Svc: quic=":443"; ma=2592000; v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000
Cache-Control: private, max-age=0
Content-Type: application/xml; charset=UTF-8
Date: Tue, 03 Mar 2020 07:45:35 GMT
Expires: Tue, 03 Mar 2020 07:45:35 GMT
Server: UploadServer
X-Goog-Metageneration: 9
X-Guploader-Uploadid: AEnB2Uq2ZNFhVqsIXiqG6353lcudosw-fwXGZYK_SlaM-sUc14F6HtaBbiGI_5eMAtI3TZlqAKEQ2G-VTgTHN1wG-E7XS5tOUA
mc: <DEBUG> Response Time:  138.03758ms
mc: <DEBUG> HEAD / HTTP/1.1
Host: dbfiles-1.storage.googleapis.com
User-Agent: MinIO (linux; amd64) minio-go/v6.0.49 mc/2020-02-25T18:10:03Z
Authorization: AWS4-HMAC-SHA256 Credential=**REDACTED**/20200303/US/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=**REDACTED**
X-Amz-Content-Sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
X-Amz-Date: 20200303T074535Z
mc: <DEBUG> HTTP/1.1 200 OK
Content-Length: 1198
Alt-Svc: quic=":443"; ma=2592000; v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000
Cache-Control: private, max-age=0
Content-Type: application/xml; charset=UTF-8
Date: Tue, 03 Mar 2020 07:45:35 GMT
Expires: Tue, 03 Mar 2020 07:45:35 GMT
Server: UploadServer
X-Goog-Metageneration: 9
X-Guploader-Uploadid: AEnB2Uro83A7EztRZOAlsPs7We1192_0rGzqIgVZKvN-o5zPErf0G4GE2JeHmzXMBVj_c2S3P_ilP-GbcpCX4OZWeu5TpZx2i4CSLYXIPtg1D56alhg1Oqk
mc: <DEBUG> Response Time:  65.256384ms
mc: <DEBUG> GET /?delimiter=%2F&encoding-type=url&fetch-owner=true&list-type=2&prefix= HTTP/1.1
Host: dbfiles-1.storage.googleapis.com
User-Agent: MinIO (linux; amd64) minio-go/v6.0.49 mc/2020-02-25T18:10:03Z
Authorization: AWS4-HMAC-SHA256 Credential=**REDACTED**/20200303/US/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=**REDACTED**
X-Amz-Content-Sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
X-Amz-Date: 20200303T074535Z
Accept-Encoding: gzip
mc: <DEBUG> HTTP/1.1 400 Bad Request
Content-Length: 239
Alt-Svc: quic=":443"; ma=2592000; v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000
Cache-Control: private, max-age=0
Content-Type: application/xml; charset=UTF-8
Date: Tue, 03 Mar 2020 07:45:35 GMT
Expires: Tue, 03 Mar 2020 07:45:35 GMT
Server: UploadServer
X-Guploader-Uploadid: AEnB2UrHpj2NX4Au24NGE608QejC3rglpOFmRyTGCi1jWER_0AILJmiTeEGkrTX8oSd4lUp-WXeA1AwDUW-4ajOL2041RWnedSvm0duLi6f2UTC-D6vMpAM
<?xml version='1.0' encoding='UTF-8'?><Error><Code>NotImplemented</Code><Message>A header or query you provided requested a function that is not implemented.</Message><Details>GET ?list-type is not implemented for buckets</Details></Error>mc: <DEBUG> Response Time:  46.834087ms
{"status":"error","error":{"message":"Unable to list folder.","cause":{"message":"A header or query you provided requested a function that is not implemented.","error":{"Code":"NotImplemented","Message":"A header or query you provided requested a function that is not implemented.","BucketName":"","Key":"","RequestID":"","HostID":"","Region":"","Server":"UploadServer"}},"type":"error","trace":[{"line":1922,"file":"client-s3.go","func":"cmd.(*s3Client).listInRoutine"},{"line":132,"file":"ls.go","func":"cmd.doList","env":{"Tags":["https://storage.googleapis.com/dbfiles-1/"]}}],"sysinfo":{"host.arch":"amd64","host.cpus":"16","host.lang":"go1.13.7","host.name":"d2f8943f5255","host.os":"linux","mem.heap.total":"66 MB","mem.heap.used":"2.3 MB","mem.total":"72 MB","mem.used":"2.3 MB"}}}

@harshavardhana
Copy link
Member

This looks like GCS S3 layer doesn't implement AWS S3 compatible ListObjectsV2 implementation

harshavardhana added a commit to harshavardhana/mc that referenced this issue Mar 3, 2020
@harshavardhana
Copy link
Member

FWIW #3101 should address this - NOTE: this is not a bug in mc as such - it is just that GCS S3 layer has some catching up to do regarding their S3 compatibility.

@manigandham
Copy link

Here are the GCS docs for reference.

List Objects via the S3 Interoperability: https://cloud.google.com/storage/docs/xml-api/get-bucket-list

cesnietor added a commit to cesnietor/mc that referenced this issue Apr 2, 2020
* Fix zh_CN doc about policy errors (minio#2927)

* Fix Windows config path (minio#2898)

Remove '.exe' (case insensitive) from executable name for consistent config folder.

Potentially breaking: If people (for whatever reason) used 'mc.exe', this will potentially break their setup.

* Fix removing empty prefixes  with `mc rm ` command (minio#2912)

Fixes: 2909

* Add --type flag to `mc admin console` (minio#2914)

This allows filtering error logs by type

* Update mc to use secure-io package (minio#2931)

* Refactor mc cp and make session optional. (minio#2910)

Now `mc cp --recursive --continue` creates copy session on failure or
resumes if previous failed session is found.

Fixes minio#2893

* continue flag: Fix inconsistent punctuation in usage text (minio#2933)

* fix mc cp termination on signals (minio#2934)

* Adapt new changes in StorageInfo (minio#2889)

* Fix arrow signs to use more common U+2191 & U+2193 (minio#2942)

* Avoid index out of range errors (minio#2943)

Fixes minio#2941

* Fix typo in error message (minio#2945)

Change the error message from `Cannot remove new user` to 
`Cannot remove <User>`, when a non-existent user is removed.

* Add options to preserve filesystem attributes (minio#2938)

* mc admin config set/get/del/history/help (minio#2835)

Related to minio/minio#8392

* print disk usage as a plain integer when formatting as json (minio#2946)

* Fix the storage prints for xl/fs disks in `admin info server` (minio#2947)

* Fix config history to list in git style format (minio#2951)

```
~ mc admin config history list -n 2 myminio
RestoreId: df0ebb1e-69b0-4043-b9dd-ab54508f2897
Date: Mon, 04 Nov 2019 17:27:27 GMT

region name="us-east-1" state="on"
region name="us-east-1" state="on"
region name="us-east-1" state="on"
region name="us-east-1" state="on"

RestoreId: ecc6873a-0ed3-41f9-b03e-a2a1bab48b5f
Date: Mon, 04 Nov 2019 17:28:23 GMT

region name=us-east-1 state=off
```

* add lock command (minio#2880)

`lock` command enables to set, get and clear object lock configuration
of given bucket.

* update to latest minio (minio#2956)

* Fix encrypt-key flag parsing (minio#2955)

* update to latest minio (minio#2957)

* Rectify usage section of policy help (minio#2959)

* help command is now part of `mc admin config get/set` (minio#2961)

* mirror object lock configuration to dest bucket (minio#2964)

if bucket does not exist on the target side.

* Add default values in 'get' (minio#2962)

* Add mirror command to compare metadata and copy (minio#2965)

mirror now uses the newly introduced
ListObjectsV2WithMetadata API in minio-go

* Handle PutObjectRetention notification events correctly (minio#2966)

* Retention command to apply retention to objects with a Prefix (minio#2963)

* Fix totalSize and totalCounts calculation (minio#2969)

* Add import/export command (minio#2974)

* Add support for auto-complete in 'mc admin config' commands (minio#2975)

* Remove duplicated API method(s) for object retention (minio#2973)

* Fix progress bar update regression (minio#2976)

Regression introduced in cf6defe

* Update export command to print disabled sub-sys as comments (minio#2978)

* Add finalized command line options (minio#2979)

* Avoid re-parsing config history elements (minio#2981)

* change target to name in config help (minio#2983)

* fix: Source content can be nil when updating progress bar (minio#2984)

* Continue mirroring inspite of error events (minio#2986)

* watch: Add site wide level support (minio#2987)

* Continue listing upon error during diff and mirror (minio#2988)

* Support for multi master sites (minio#2991)

* Retry mirror forever on watch (minio#2992)

* Fix multi-master setup help text (minio#2993)

* Do full scan diff+mirror in multi-site mirror mode (minio#2994)

* update minio-go to master (minio#2995)

* Avoid mirror fatalIf in multi-master (minio#2998)

* Mirror with fallback list in multimaster mode, copy missing files (minio#2999)

* Fix mirroring of PutObjectRetention event (minio#3004)

* Multi-master only run single startMirror at a time (minio#3003)

Also randomize the sleep appropriately based
on Unix() time source.

* mc sql: Use compression parameter (minio#2996)

The compression parameter is not actually used, but always guessed from the file extension.

Only guess the compression type if it is not explicitly set.

Uploading a file called `out.csv.geezipd`:

Before:
```
λ mc sql -e="SELECT * from s3object LIMIT 1" --compression=GZIP --csv-input "rd=\n,fh=USE,fd=;" local/test/out.csv.geezipd
�""���k↔��Xs��W.v�      ��)��{2#��,r���:�|D▲�.��f♫��→�i�p�2l�♫��ʭ���Q��v▲�5ر�c
```
(content actually not ungzipped)

After:
```
λ mc sql -e="SELECT * from s3object LIMIT 1" --compression=GZIP --csv-input "rd=\n,fh=USE,fd=;" local/test/out.csv.geezipd
"281,1285,159625,159627,2637,20000827.0117590018,1239029,1663,-6.7535419,1533,0.53597438,8"
```

We leave validation of the compression value to the server.

* Replace Timestamp separator   (minio#3002)

Replace time stamp separator to use `-`

* New admin info (minio#2982)

* Stops showing usage info if Bucket#=0 (minio#3007)

* Extraneous line in 'mc admin info' output (minio#3010)

* cp: Only use session when -c is passed (minio#2989)

* Upgrade to new Listen bucket API (minio#3008)

* fix: ignore APINotImplemented errors from filesystem (minio#3018)

* Update to latest minio/minio (minio#3020)

* Mirror: Generate STag and ETag on destination only in Multimaster mode (minio#3021)

* Update mc dependencies to recent dep change on MinIO (minio#3026)

* Use colorjson to indent json properly in cp (minio#3030)

Additionally also do not initialize progress bar in json
or quiet mode in mirror.

Fixes minio#3029
Fixes minio#3017

* fix default flag behaviour in du command (minio#3031)

- `mc du` without args should print help like other `mc` commands
- `mc du` should behave like `du -h --max-depth=1` as default
- optional `--recursive` if they want capacity for each folder.
fixes minio#2871

* Add lock and retention docs (minio#3034)

* Only rename config directories (minio#3032)

If the user placed an `mc.exe` in the user directory and wasn't used it, it would be renamed.

* fix: crash in cp when cpURLs return error (minio#3035)

* fix: du to ignore too many recursive symlinks (minio#3033)

* fix: update docs for --attr command (minio#3040)

Also canonicalize metadata headers automatically
before, minio-go consumes it.

* retention: Error out early when url argument does not point to S3 server (minio#3041)

* fix: update minio-go to support snowball data-transfer (minio#3042)

* cp: add missing } in help template (minio#3047)

* Update pkg/madmin to support multiple profilers (minio#3048)

* admin/console: Fix a crash in console string generation (minio#3049)

* fix: best effort save permissions always (minio#3050)

* upgrade to latest server to remove replace tags (minio#3051)

* fix: update admin docs for latest changes (minio#3054)

* fix: handle symlinks by reading/following as needed (minio#3053)

Avoid using filepath.EvalSymlinks and let the caller
fail appropriately for symlinks.

Fixes minio#3011

* check for bucket exists in 'admin heal' (minio#3059)

* Ensure 64bit alignment on 32bit builds for atomics (minio#3065)

Keep elements that are used with atomic.* functions as first element
of struct because it guarantees 64bit alignment on 32 bit machines.
atomic.* functions crash if operand is not aligned at 64bit.
See golang/go#599

* add the `mc admin kms` subcommands (minio#2882)

This commit adds the first set of KMS admin
commands.

For new there is only the
`mc admin kms key status <endpoint> [key-ID]` command
that can be used to fetch status information for a
KMS master key. Listing and rotation commands are
planed.

* Fix go.sum file missing entries (minio#3071)

* add debug support for 'config host add' (minio#3076)

* Fix crash in mc admin console (minio#3079)

Fixes : minio#3078

* use latest minio-go version (minio#3080)

* allow mirror to copy zero byte file (minio#3084)

this PR also cleans up code and avoids
extra calls for source target

* go mod tidy (minio#3081)

* honor prefix for object and directory names in 'rm -r' (minio#3012)

* fix go mod tidy again

* added pkg/disk/stat_freebsd.go (minio#3090)

* fix handling of directories in Stat (minio#3092)

Fixes minio#3089
Fixes minio#3091

* retention - cleanup unused code (minio#3094)

* Use listObjectsV1 for GCS S3 implementation (minio#3101)

Fixes minio#3073

* Support arm32, 386 compilation: (minio#3103)

* deprecate 'mc session' documentation (minio#3104)

* Add support of threads & goroutines profiling type (minio#3108)

* fix go mod tidy

* Update minio-go to bring some fixes (minio#3106)

* resolve build issues on illumos (minio#3098)

* Update docs for mc admin update (minio#3110)

* fix: Make sure Ctrl-C cancels `mc cp` right away (minio#3113)

* mc cp -continue: Fix escape/colorization of JSON (minio#3116)

* info: Fix showing offline nodes in the pretty output (minio#3112)

Also do some simplification in the code.

* Secret key prompt (minio#3083)

* heal: Show scheduled next healing (minio#3111)

mc admin heal alias command will show the next healing time.

Also, show 'Never completed' when the server returns zero last healing activity

* mc cp: Fix prefix handling in TypeC (minio#3115)

for copy from filesystem to objectstorage.

Avoid prefixing dirname to file on target side
when doing a `mc cp /tmp/dir myminio/bucket --r`
to make `mc mirror` and `mc cp` behavior consistent

* info: Add missing new lines in the output (minio#3119)

* fix for incorrect mtime handling (minio#3121)

* mc retention: add --recursive and --bypass flags. (minio#3100)

--bypass flag allows overriding governance if user
has override permissions

* cleanup legacy metadata handling (minio#3118)

* Add global context and adapt context change in admin API (minio#3125)

This commit adds a new global context, monitors os signals
and cancels the global context in such cases to exit
on going process gracefully.

It will also update minio-go and adapts the code with
the new context changes in the admin API.

* Add tag command (minio#3117)

* cleanup tag command (minio#3126)

* Add legalhold command (minio#3095)

* mc watch windows URL/absolute path event path (minio#3133)

* Onboard Diagnostics (minio#3114)

Also colorize JSON output in all admin commands

* Make BuildS3Config public (minio#3132)

* add build trimpaths to remove gopath (minio#3137)

* add --disable-multipart flag in cp (minio#3135)

* set S3Client struct as public

* set s3client struct as public to be used by mcs

Co-authored-by: yiranzai <wuqingdzx@gmail.com>
Co-authored-by: Klaus Post <klauspost@gmail.com>
Co-authored-by: poornas <poornas@users.noreply.github.com>
Co-authored-by: Harshavardhana <harsha@minio.io>
Co-authored-by: Bala FA <bala.gluster@gmail.com>
Co-authored-by: Ashish Kumar Sinha <ashi.sinha.87@gmail.com>
Co-authored-by: Praveen raj Mani <praveen@minio.io>
Co-authored-by: Nitish Tiwari <nitish@minio.io>
Co-authored-by: kannappanr <30541348+kannappanr@users.noreply.github.com>
Co-authored-by: Wesley Collin Wright <deinlebenandern@gmail.com>
Co-authored-by: Krishna Srinivas <634494+krishnasrinivas@users.noreply.github.com>
Co-authored-by: Anis Elleuch <vadmeste@users.noreply.github.com>
Co-authored-by: BigUstad <priyank.raj@gatech.edu>
Co-authored-by: ebozduman <ersan.bozduman@gmail.com>
Co-authored-by: Maël Valais <mael.valais@gmail.com>
Co-authored-by: Reinhard Koehn <rkoehn@users.noreply.github.com>
Co-authored-by: Andreas Auernhammer <aead@mail.de>
Co-authored-by: Dmitry Wagin <dmitry.wagin@ya.ru>
Co-authored-by: Kody A Kantor <kody.kantor@gmail.com>
Co-authored-by: Jeffrey Clark <h0tw1r3@users.noreply.github.com>
Co-authored-by: Sidhartha Mani <wlan0@users.noreply.github.com>
Co-authored-by: Daniel Valdivia <hola@danielvaldivia.com>
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

6 participants