Add helpful log output to aid with troubleshooting of vault login.#56
Open
damienjoldersma-rakuten wants to merge 1 commit into
Conversation
…so, do not ignore and do not just swallow login exceptions.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to improve troubleshooting of Vault/Rundeck integration by surfacing previously hidden login/lookup failures via additional log output in the Vault storage plugin.
Changes:
- Add additional log statements around Vault token lookup and login flows.
- Stop silently ignoring exceptions during
loginVault()and log them instead. - Add warning-level logging for caught exceptions during
lookup().
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Comment on lines
+318
to
321
| log.info("Beginning Vault lookup..."); | ||
| try { | ||
| log.info("Will try to lookup self..."); | ||
| LookupResponse lookupSelf = getVaultClient().auth().lookupSelf(); |
Comment on lines
341
to
343
| } | ||
| log.info("Finished Vault lookup succesfully."); | ||
| } |
| log.log(Level.WARNING, "Caught Exception: " + e.getMessage(), e); | ||
| e.printStackTrace(); | ||
| } | ||
| log.info("Finished Vault lookup succesfully."); |
Comment on lines
333
to
340
| e.printStackTrace(); | ||
| } | ||
| } catch (ConfigurationException e) { | ||
| log.log(Level.WARNING, "Caught ConfigurationException: " + e.getMessage(), e); | ||
| e.printStackTrace(); | ||
| } catch (Exception e) { | ||
| log.log(Level.WARNING, "Caught Exception: " + e.getMessage(), e); | ||
| e.printStackTrace(); |
Comment on lines
345
to
357
| private void loginVault(VaultClientProvider provider){ | ||
| log.info("Logging into Vault..."); | ||
| try{ | ||
| log.info("Getting Vault Client from provider"); | ||
| vaultClient = provider.getVaultClient(); | ||
| log.info("Calling vaultClient logical"); | ||
| vault = vaultClient.logical(); | ||
| } | ||
| catch (Exception ignored){ | ||
|
|
||
| catch (Exception e){ | ||
| log.log(Level.WARNING, "Error logging into Vault: " + e.getMessage(), e); | ||
| } | ||
| log.info("Logged into Vault successfully"); | ||
| } |
Contributor
|
@damienjoldersma-rakuten - Thank you for the PR. If you are able to address the CoPilot feedback we can consider moving this forward in the review process. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I had some trouble with setting up Vault and Rundeck integration - I was receiving a NullPointerException in the logs with no other information to help me understand the problem of my misconfiguration.
This pull request will help others in troulbeshooting misconfiguration or other Vault / Rundeck integration problems. Basically it changes the plugin to not ignore and not to just swallow login exceptions.
Here are some example of the exception output that was being hidden, which were essential in understanding to resolve the misconfiguration: