We have a vault token accessor which is returned successfully in a lookup, but when we attempt to revoke the token vault returns a 400 token not found
. We tried a tidy command but vault says it found no accessors without valid tokens. How can we clean up this accessor?
$ vault token lookup -accessor XXXXXXXXYYYYYYYYZZZZZZZZZ
Key Value
--- -----
accessor XXXXXXXXYYYYYYYYZZZZZZZZZ
creation_time 1685700500
creation_ttl 168h
display_name token
entity_id n/a
expire_time 2023-06-09T10:08:20.508020417Z
explicit_max_ttl 0s
id n/a
issue_time 2023-06-02T10:08:20.508034297Z
meta [XXXXXXXXYYYYYYYYZZZZZZZZZ]
num_uses -1
orphan true
path auth/token/create/XXXXXXX
policies [XXXXXXXXYYYYYYYYZZZZZZZZZ]
renewable true
role xxxxxxxxxxxxx
ttl 72h36m19s
type service
revoke:
$ vault token revoke -accessor XXXXXXXXYYYYYYYYZZZZZZZZZ
Error revoking token: Error making API request.
URL: POST https://vault.example.com:8200/v1/auth/token/revoke-accessor
Code: 400. Errors:
* token not found
Tidy output:
2023-06-06T09:45:02.015Z [INFO] token: beginning tidy operation on tokens
2023-06-06T09:45:02.098Z [INFO] token: checking if accessors contain valid tokens: progress=500 percent_complete=53.88768898488121
2023-06-06T09:45:02.139Z [INFO] token: number of entries scanned in parent prefix: count=1
2023-06-06T09:45:02.139Z [INFO] token: number of entries deleted in parent prefix: count=0
2023-06-06T09:45:02.139Z [INFO] token: number of tokens scanned in parent index list: count=9
2023-06-06T09:45:02.139Z [INFO] token: number of tokens revoked in parent index list: count=0
2023-06-06T09:45:02.139Z [INFO] token: number of accessors scanned: count=926
2023-06-06T09:45:02.139Z [INFO] token: number of deleted accessors which had empty tokens: count=0
2023-06-06T09:45:02.139Z [INFO] token: number of revoked tokens which were invalid but present in accessors: count=0
2023-06-06T09:45:02.139Z [INFO] token: number of deleted accessors which had invalid tokens: count=0
2023-06-06T09:45:02.139Z [INFO] token: number of deleted cubbyhole keys that were invalid: count=0
2023-06-06T09:45:02.139Z [INFO] token: finished tidy operation on tokens