Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Feb 13, 2026. It is now read-only.

fix: token is invalid for admin heal when minio is distErasure at windows#21092

Merged
harshavardhana merged 1 commit intominio:masterfrom
jiuker:fix-token-is-valid-error-for-admin-heal
Apr 1, 2025
Merged

fix: token is invalid for admin heal when minio is distErasure at windows#21092
harshavardhana merged 1 commit intominio:masterfrom
jiuker:fix-token-is-valid-error-for-admin-heal

Conversation

@jiuker
Copy link
Contributor

@jiuker jiuker commented Apr 1, 2025

Community Contribution License

All community contributions in this pull request are licensed to the project maintainers
under the terms of the Apache 2 license.
By creating this pull request I represent that I have the right to license the
contributions to the project maintainers under the Apache 2 license.

Description

Start minio that is distErasure with yaml

version: v1
address: ':9000'
pools: # Specify the nodes and drives with pools
  -
    - 'http://127.0.0.1:9000/D:/workspace/go/src/minio/site/{0...1}'
    - 'http://127.0.0.1:9001/D:/workspace/go/src/minio/site/{2...3}'
version: v1
address: ':9001'
pools: # Specify the nodes and drives with pools
  -
    - 'http://127.0.0.1:9000/D:/workspace/go/src/minio/site/{0...1}'
    - 'http://127.0.0.1:9001/D:/workspace/go/src/minio/site/{2...3}'
  1. create bucket mytest
  2. cp some file into mytest
  3. mc admin heal minio9000/mytest
$ mc.exe admin info minio9000
●  127.0.0.1:9000
   Uptime: 1 hour 
   Version: <development>
   Network: 2/2 OK 
   Drives: 2/2 OK 
   Pool: 1

●  127.0.0.1:9001
   Uptime: 1 hour 
   Version: <development>
   Network: 2/2 OK 
   Drives: 2/2 OK 
   Pool: 1

┌──────┬───────────────────────┬─────────────────────┬──────────────┐
│ Pool │ Drives Usage          │ Erasure stripe size │ Erasure sets │
│ 1st  │ 5.4% (total: 1.5 TiB) │ 4                   │ 1            │
└──────┴───────────────────────┴─────────────────────┴──────────────┘

5.2 KiB Used, 1 Bucket, 2 Objects, 12 Versions, 1 Delete Marker
4 drives online, 0 drives offline, EC:2

Motivation and Context

Now we get this:

$ mc.exe admin heal minio9000/mytest 
mc.exe: <ERROR> Unable to display heal status. Client token mismatch.

For we always return token:index back for globalIsDistErasure:true

minio/cmd/admin-heal-ops.go

Lines 332 to 335 in 734d1e3

clientToken := h.clientToken
if globalIsDistErasure {
clientToken = fmt.Sprintf("%s:%d", h.clientToken, GetProxyEndpointLocalIndex(globalProxyEndpoints))
}

But we just parse token with _index here.
func parseRequestToken(token string) (subToken string, nodeIndex int) {
if token == "" {
return token, -1
}
i := strings.Index(token, getKeySeparator())
if i < 0 {
return token, -1
}
nodeIndex, err := strconv.Atoi(token[i+1:])
if err != nil {
return token, -1
}
subToken = token[:i]
return subToken, nodeIndex
}

Window getKeySeparator() return _

How to test this PR?

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

@jiuker jiuker changed the title fix: token is invalid for admin heal fix: token is invalid for admin heal when minio have mutil pools Apr 1, 2025
@jiuker jiuker changed the title fix: token is invalid for admin heal when minio have mutil pools fix: token is invalid for admin heal when minio is distErasure Apr 1, 2025
@jiuker jiuker marked this pull request as draft April 1, 2025 04:35
@jiuker jiuker closed this Apr 1, 2025
@jiuker jiuker reopened this Apr 1, 2025
@jiuker jiuker force-pushed the fix-token-is-valid-error-for-admin-heal branch from 5f48ca9 to ec9d488 Compare April 1, 2025 07:30
@jiuker jiuker changed the title fix: token is invalid for admin heal when minio is distErasure fix: token is invalid for admin heal when minio is distErasure at windows Apr 1, 2025
@jiuker jiuker marked this pull request as ready for review April 1, 2025 07:31
fix: token is invalid for admin heal

fix: token is invalid for admin heal
@jiuker jiuker force-pushed the fix-token-is-valid-error-for-admin-heal branch from ec9d488 to 6269809 Compare April 1, 2025 07:32
@harshavardhana harshavardhana merged commit e0c8738 into minio:master Apr 1, 2025
22 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants