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

fix: translate tier add errors properly #16191

Merged
merged 1 commit into from
Dec 8, 2022

Conversation

harshavardhana
Copy link
Member

Description

fix: translate tier add errors properly

Motivation and Context

avoid logs such as these

Dec 08 09:55:07 play minio[4034686]: API: AddTier()
Dec 08 09:55:07 play minio[4034686]: Time: 09:55:07 UTC 12/08/2022
Dec 08 09:55:07 play minio[4034686]: DeploymentID: f2b80bd5-02a4-455d-b268-b20fb3a1d93b
Dec 08 09:55:07 play minio[4034686]: RequestID: 172EC8CFF481F70E
Dec 08 09:55:07 play minio[4034686]: RemoteHost: 127.0.0.1
Dec 08 09:55:07 play minio[4034686]: Host: 127.0.0.1:9000
Dec 08 09:55:07 play minio[4034686]: UserAgent: MinIO (linux; amd64) madmin-go/2.0.0
Dec 08 09:55:07 play minio[4034686]: Error: unsupported tier type (*errors.errorString)
Dec 08 09:55:07 play minio[4034686]:        objectLocation=cmd.auditObjectOp{Name:"config/tier-config.bin", Pool:1, Set:1, Disks:[]string{"/home/play/data1", "/home/play/data2", "/home/play/data3", "/home/play/>
Dec 08 09:55:07 play minio[4034686]:        6: internal/logger/logger.go:258:logger.LogIf()
Dec 08 09:55:07 play minio[4034686]:        5: cmd/api-errors.go:2211:cmd.toAPIErrorCode()
Dec 08 09:55:07 play minio[4034686]:        4: cmd/admin-handler-utils.go:251:cmd.toAdminAPIErrCode()
Dec 08 09:55:07 play minio[4034686]:        3: cmd/admin-handler-utils.go:238:cmd.toAdminAPIErr()
Dec 08 09:55:07 play minio[4034686]:        2: cmd/tier-handlers.go:111:cmd.adminAPIHandlers.AddTierHandler()
Dec 08 09:55:07 play minio[4034686]:        1: net/http/server.go:2109:http.HandlerFunc.ServeHTTP()

How to test this PR?

Add an invalid tier type

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Optimization (provides speedup with no functional changes)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • Fixes a regression (If yes, please add commit-id or PR # here)
  • Unit tests added/updated
  • Internal documentation updated
  • Create a documentation update request here

@minio-trusted
Copy link
Contributor

Mint Automation

Test Result
mint-large-bucket.sh ✔️
mint-fs.sh ✔️
mint-erasure.sh ✔️
mint-dist-erasure.sh ✔️
mint-compress-encrypt-dist-erasure.sh ✔️
mint-pools.sh ✔️
Deleting image on docker hub
Deleting image locally

@krisis
Copy link
Member

krisis commented Dec 8, 2022

@harshavardhana the error is logged so because the error errTierTypeUnsupported wasn't checked for in toAdminAPIErr function. The underlying issue is that madmin-go should have returned madmin.ErrTierTypeUnsupported error on unmarshalling the tier config. Once we fix the madmin-go issue correctly, we can do away with these duplicate errors in cmd package.

@harshavardhana harshavardhana merged commit 4bc367c into minio:master Dec 8, 2022
@harshavardhana harshavardhana deleted the do-not-print branch December 8, 2022 19:18
@bh4t bh4t added the bugfix label May 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants