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

logger: do not interpret encoded url in error as format string #7110

Merged
merged 2 commits into from Jan 24, 2019

Conversation

kannappanr
Copy link
Contributor

@kannappanr kannappanr commented Jan 18, 2019

Description

While logging an error, it interprets encoded url in the error as a format string.

Motivation and Context

API: SYSTEM()
Time: 14:42:31 PST 01/16/2019
Error: Post http://minio-02:9000/minio/storage/v2/media/nvme5/test/appendfile?file-path=342e7d74-206b-4cd6-9143-955e73e6835d%!F(MISSING)part.1&volume=.minio.sys%!F(MISSING)tmp: EOF
       1: cmd/bitrot.go:185:cmd.(*bitrotWriter).Append()
       2: cmd/erasure-encode.go:48:cmd.(*parallelWriter).Append.func1()

Regression

No

How Has This Been Tested?

I tested this by modifying the minio binary, to log an error
logger.LogIf(context.Background(), errors.New("%s test"))

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added unit tests to cover my changes.
  • I have added/updated functional tests in mint. (If yes, add mint PR # here: )
  • All new and existing tests passed.

Error logger interprets encoded url in the error as a format string.
@codecov
Copy link

codecov bot commented Jan 18, 2019

Codecov Report

Merging #7110 into master will increase coverage by 0.18%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7110      +/-   ##
==========================================
+ Coverage   52.18%   52.37%   +0.18%     
==========================================
  Files         265      275      +10     
  Lines       32858    42959   +10101     
==========================================
+ Hits        17146    22498    +5352     
- Misses      13631    18378    +4747     
- Partials     2081     2083       +2
Impacted Files Coverage Δ
cmd/http/conn_bug_21133.go 66.66% <0%> (-8.34%) ⬇️
cmd/gateway-main.go 15.53% <0%> (-7.35%) ⬇️
main.go 50% <0%> (-7.15%) ⬇️
pkg/madmin/utils.go 16.66% <0%> (-7.15%) ⬇️
cmd/config-dir.go 40.74% <0%> (-7.09%) ⬇️
cmd/globals.go 55.88% <0%> (-7.09%) ⬇️
cmd/auth-handler.go 67.89% <0%> (-6.01%) ⬇️
cmd/lock-rpc-server.go 30.76% <0%> (-6%) ⬇️
cmd/service.go 21.42% <0%> (-5.85%) ⬇️
cmd/server-rlimit.go 54.16% <0%> (-5.84%) ⬇️
... and 242 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 55ef51a...ce55943. Read the comment docs.

Copy link
Member

@harshavardhana harshavardhana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@minio-ops
Copy link

Error running mint automation
+ mkdir -p 7110-ce55943/gopath/src/github.com/minio
+ git clone --quiet https://github.com/minio/minio.git 7110-ce55943/gopath/src/github.com/minio/minio
fatal: unable to access 'https://github.com/minio/minio.git/': Could not resolve host: github.com; Unknown error

@kannappanr kannappanr merged commit 8ee8ad7 into minio:master Jan 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants