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

WARN message is suddenly printed on each mc calls #5076

Closed
xtian-socgen opened this issue Nov 5, 2024 · 3 comments · Fixed by #5077
Closed

WARN message is suddenly printed on each mc calls #5076

xtian-socgen opened this issue Nov 5, 2024 · 3 comments · Fixed by #5077

Comments

@xtian-socgen
Copy link

This is related to the PR #4989 which was merged 4 months ago.
Related code is: cmd/main.go#L511-L521.

IMHO, this is very bad for the user experience.
At least, please make this option an opt-in, even though I still don't see any reason to keep it.

Expected behavior

Do not print WARN messages not related to mc command.
There is no reason to print a WARN when I mc ls if not related to the ls itself.

Actual behavior

When I use mc ls, I now have a WARN message reporting the certificate will expire soon (in 2 months).
This is not relevant, as there is nothing I can do here.

[0] > mc ls www/mybucket/myfile
[2024-10-16 12:19:45 CEST] ...

== WARN: `xxx.xxx.xxx` certificate will expire in 2025-01-25 10:16:45 +0000 UTC. Renew soon to avoid outage.

Hopefully, this is not yet happening for Amazon S3 or with the -json flag.

Steps to reproduce the behavior

mc --version

[0] > mc --version
mc version RELEASE.2024-10-08T09-37-26Z (commit-id=cf128de2cf42e763e7bd30c6df8b749fa94e0c10)
Runtime: go1.22.8 linux/amd64
Copyright (c) 2015-2024 MinIO, Inc.
License GNU AGPLv3 <https://www.gnu.org/licenses/agpl-3.0.html>

System information

@xtian-socgen xtian-socgen changed the title WARN message is suddenly printed on each mc calls (see PR #4989) WARN message is suddenly printed on each mc calls Nov 5, 2024
klauspost added a commit to klauspost/mc that referenced this issue Nov 5, 2024
@harshavardhana
Copy link
Member

harshavardhana commented Nov 5, 2024

IMHO, this is very bad for the user experience.
At least, please make this option an opt-in, even though I still don't see any reason to keep it.

why? - this is an opinion; provide an explanation technically why this is not the right thing to provide.

@xtian-socgen
Copy link
Author

Let's say it differently, I didn't want to be rude :)

This is the same as if curl started to warn me each time I curl an https site that the certificate will expire in 2 months (1 year for a 10 years certificate), even if I'm not in verbose or debug mode. This will definitely degrade the user experience of all users of curl.

As I'm not the s3 administrator, this is not relevant, and because the certificate will only be changed a few days before its expiration, this is giving a bad user experience showing an unnecessary warning for nothing.

Of course I could redirect the stderr to /dev/null to prevent this, however I'll lose error messages because of this, which is not god either, as stderr is not meant to be used as a debug/verbose output unless specifically specified.

And finally, if or when this will happen for Amazon S3, the whole world using mc will see this warning.

I guess the original idea was to be able to identify that the certificate will expire "soon", but mc is not the right tool to check these sort of things.
There are plenty of other ways to do that, including using openssl tool to get expiration in days.

@harshavardhana
Copy link
Member

mc and curl are not the same.

mc is used for administrative purposes, and in our experience, we have seen our customers go without noticing expiring certificates, which eventually causes an outage.

That's why comparing mc with curl is just hyperbole, invalid, and lacks understanding of what mc is.

Amazon S3 won't expire in such a manner, and let's hope not, but it would be nice to know if it ever experiences an outage like this.

However, we built mc for MinIO, which serves that purpose well for our customers, so the PR has been sent here to tune this down to 28 days instead.

flydt added a commit to flydt/mc that referenced this issue Nov 16, 2024
* remove s390x support

* Add basic RPC metrics via `mc support top rpc` (minio#5060)

Example:
```
λ mc support top rpc myminio
      SERVER            CONCTD  PING    OUT Q   RECONNS STR IN  STR OUT MSG IN  MSG OUT
 To  127.0.0.1:9001       5     0.5ms     0        0    -> 20    0 ->   60007    60089
From 127.0.0.1:9001       5     0.5ms     0        0     -> 0    20 ->  60089    60002
 To  127.0.0.1:9002       5     0.0ms     0        0     -> 0    4 ->   34209    33937
From 127.0.0.1:9002       5     0.5ms     0        0     -> 4    0 ->   33938    34209
 To  127.0.0.1:9003       5     0.0ms     0        0     -> 0    4 ->   99379   101165
From 127.0.0.1:9003       5     0.0ms     0        0     -> 4    0 ->   101166   99379
 To  127.0.0.1:9004       5     0.5ms     0        0     -> 0    4 ->   33784    33029
From 127.0.0.1:9004       5     0.0ms     0        0     -> 4    0 ->   33030    33784
 To  127.0.0.1:9005       5     0.0ms     0        0     -> 0    4 ->   33515    33135
From 127.0.0.1:9005       5     0.5ms     0        0     -> 4    0 ->   33136    33515
 To  127.0.0.1:9006       5     0.0ms     0        0     -> 0    4 ->   33627    33161
From 127.0.0.1:9006       5     0.0ms     0        0     -> 4    0 ->   33162    33627
```

There is already server support for metrics.

* Report errors and better file names for mc support inspect  (minio#5062)

Check the returned stream for errors and show them. Don't upload/keep pointless data

Use the request alias to create a better file name...

Example:

```
λ mc support inspect play/testbucket/testdat/**
mc: <ERROR> Unable to download file data. GetRawData: No files matched the given pattern.
```

Previously the error would just be ignored.

```
λ mc support inspect --airgap play/testbucket/testdata/**
File data successfully downloaded as inspect-play_testbucket_testdata.enc
```

Previously all files would be called `inspect-data.enc`, which would just be difficult to distinguish.

* Add support rpc JSON replay. (minio#5064)

Add realtime replay of captured JSON data.

Example:
```
λ mc support top rpc --json myminio >rpc.json

λ mc support top rpc -in=rpc.json
```

* Add string/json output string mc pipe (minio#5065)

This commit adds a string message and json output to mc pipe.  The
implementation is heavily inspired by the one in mc cp, just adapted to
the different semantics of pipe.

* Mark batch job status properly (minio#5066)

Client side overall status was always shown as `in-progress` even if
job was successful or failed.

Signed-off-by: Shubhendu Ram Tripathi <[email protected]>

* Make the profiler easier to use (minio#5068)

* Bump github.com/golang-jwt/jwt/v4 from 4.5.0 to 4.5.1 (minio#5074)

Bumps [github.com/golang-jwt/jwt/v4](https://github.com/golang-jwt/jwt) from 4.5.0 to 4.5.1.
- [Release notes](https://github.com/golang-jwt/jwt/releases)
- [Changelog](https://github.com/golang-jwt/jwt/blob/main/VERSION_HISTORY.md)
- [Commits](golang-jwt/jwt@v4.5.0...v4.5.1)

---
updated-dependencies:
- dependency-name: github.com/golang-jwt/jwt/v4
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Only warn if less than 28 days to cert expires (minio#5077)

Fixes minio#5076 as much as reasonable.

* lint: Fix new detected lint complaints (minio#5080)

* heal: Simplify bucket healing status (minio#5079)

Avoid using the drive count concept to pick a color for a bucket healing
result. This was straightforward when we were healing a bucket per erasure 
set, but now it becomes more complex to show a result.

Pick green if everything is okay, yellow if a bucket is missing in a
drive, red for any other drive state (unformatted, offline, ..), and
grey for any weird situation.

---------

Signed-off-by: Shubhendu Ram Tripathi <[email protected]>
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Harshavardhana <[email protected]>
Co-authored-by: Klaus Post <[email protected]>
Co-authored-by: Michael Fenn <[email protected]>
Co-authored-by: Shubhendu <[email protected]>
Co-authored-by: dorman <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Anis Eleuch <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants