* Made session list ignore broken sessions
- `mc session list` - skips partial sessions[1]
- `mc session clear all` - doesn't clear partial sessions.
The idea is to prevent the user from clearing all sessions without
realising that there were partial sessions.
When there is one or more partial sessions, clear each one of them individually
as follows,
`mc session clear <broken-session-id>` - clears the partial sessions.
[1] - partial session - a session with missing `.data` file in the sessions directory.
N B The presence of partial sessions indicate some underlying bug in session mangement
code. This PR provides relief for users in the event of such a bug.
* Added comments to session helper functions and to be provide context
* Ignore BucketEmpty error for top-level listing
This is relevant in the case of non-fs backend like s3, play etc.
* Used ToGoError() to get Error interface from *probe.Error
* Create only one custom transport for all S3 clients
Closes#1721
* Moved back to http.DefaultTransport
... because ResponseHeaderTimeout may fail `mc mirror` in slow networks
* Removed setting of http.Client Timeout for mc
Fixes#1719
* Moved mcDefaultTransport closer to use
* Set ResponseHeaderTimeout to 3 secs
* Vendored in changes from github.com/minio/minio-go
* Fixed CI build errors due to API changes, post vendoring
* Fixed unit tests w.r.t the change from insecure to secure in minio.NewV{2,4} API
Due to a golang bug need to add specific code to handle this
properly when the response body has ContentLength of '0'
Ref for more info : https://github.com/golang/go/issues/13942.
This is a valid case of 'ls', without this change.
```
$ mc ls localhost
mc: <ERROR> Unable to stat ‘localhost’. Bucket name cannot be empty.
```
What we need to ideally see is if server is not available is
```
$ mc ls localhost
mc: <ERROR> Unable to list folder. Get http://localhost:9000/: dial tcp [::1]:9000: getsockopt: connection refused
```
The reasoning is that we are not providing query
params through 'mc' and we don't need to handle it
specially. Since all paths are absolute with only
delimiter of '/' all other characters should be allowed
including '?'.
For this same reason now newURL is called newClientURL.
Fixes#1677
- Minio Client validates only config host add parameters
Not the config file. Use the same utils to validate config file
if HostURL is wrong.
/storage?googleapis?com for host /storage?googleapis?com is not valid. Could not parse it
if API is wrong.
S3v2iasdasd API for host https://www.google.com is not Valid. It is not part of any of the following APIs:
1. S3v4
2. S3v2
If the version is wrong.
Config version 9 does not match GlobalMCConfiguration 8.
Example:
mc: <ERROR> Config version 9 does not match GlobalMCConfiguration 8.
S3v2asda API for host httpsasdkasd is not Valid. It is not part of any of the following APIs:
1. S3v4
2. S3v2
URL httpsasdkasd for host httpsasdkasd is not valid. Could not parse it.