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

Plugin deregister always reports it succeeds but actually fails. #18963

Closed
joel-rieke opened this issue Feb 2, 2023 · 3 comments
Closed

Plugin deregister always reports it succeeds but actually fails. #18963

joel-rieke opened this issue Feb 2, 2023 · 3 comments
Labels
bug Used to indicate a potential bug core/plugin

Comments

@joel-rieke
Copy link

joel-rieke commented Feb 2, 2023

Describe the bug
Deregistering a plugin that has either been corrupted, removed, overwritten fails.... It seems there either ought to be a --force option for deregister or it should succeed at being removed.

To Reproduce
Steps to reproduce the behavior:

  1. Manually delete a plugin from the plugin folder when vault is offline..
  2. Run the usual:
    vault secret disable...
    vault plugin deregister
  3. vault plugin list
    -- Notice plugin is still in the list!!

Expected behavior
plugin should be deregistered...

Environment:

  • Vault Server Version (retrieve with vault status):
  • Key Value

Seal Type shamir
Initialized true
Sealed false
Total Shares 1
Threshold 1
Version 1.3.6
Cluster Name vault-cluster-
Cluster ID
HA Enabled false

  • Vault CLI Version (retrieve with vault version):
    Vault v1.3.6

  • Server Operating System/Architecture:
    Linux ...-microsoft-standard-WSL2 ..1 SMP Wed Nov 23 01:01:46 UTC 2022 x86_64 GNU/Linux

Vault server configuration file(s):
kind of irrelevant although most relevant part is probably...

storage "file" {
  path    = "./vault/data"
}
<redacted>....
plugin_directory = "/home/<redacted>/plugins/"

**Additional context**
This is a dev environment...
@joel-rieke joel-rieke changed the title Plugin deregister always succeeds but actually fails. Plugin deregister always reports it succeeds but actually fails. Feb 2, 2023
@ccapurso ccapurso added bug Used to indicate a potential bug core/plugin labels Feb 3, 2023
@hsimon-hashicorp
Copy link
Contributor

Hello! Could you let us know more about what you mean by "while vault is offline"? Is the process not running at all, or is Vault in a sealed state? If you could provide more detailed repro steps, I'd appreciate it.

@joel-rieke
Copy link
Author

Thanks. It is not running and it is sealed. It's been awhile since I filed this so remembering more details could be a challenge. But it may have come down to permissions on linux. Also, this is probably most likely to affect a plugin developer developing things locally as they are getting started maybe?

  1. Run vault as user x (in my case it might have been root or sudo).
  2. Register plugin as user x.
  3. Come back some other day and run vault as user y (non root).
  4. Deregister plugin with vault running as user y.
    -- I think at this point it appears to have 'deleted' it... but it didn't
  5. Manually deleting it from the plugin dir also doesn't work (for obvious reasons).

Expected:
What I really think is that Vault should recognize what's going on and report that it is unable to actually deregister the plugin for permissions reasons. As a newer plugin developer it was pretty confusing and took me awhile to figure out what was going on.

Workaround:
As sudo do some manual cleanup and permissions changing in the data directory (I shouldn't ever do this, but I'm a developer and like to hack, so I did)

Other observations:
I noticed the data directory can get into interesting mixed permissions state which is probably not good for Vault's inner working states.

@joel-rieke
Copy link
Author

Closing since this must have been a self imposed issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Used to indicate a potential bug core/plugin
Projects
None yet
Development

No branches or pull requests

3 participants