Skip to content

Add helpful log output to aid with troubleshooting of vault login.#56

Open
damienjoldersma-rakuten wants to merge 1 commit into
rundeck-plugins:masterfrom
damienjoldersma-rakuten:add-helpful-log-output-for-loging-troubleshooting
Open

Add helpful log output to aid with troubleshooting of vault login.#56
damienjoldersma-rakuten wants to merge 1 commit into
rundeck-plugins:masterfrom
damienjoldersma-rakuten:add-helpful-log-output-for-loging-troubleshooting

Conversation

@damienjoldersma-rakuten
Copy link
Copy Markdown

@damienjoldersma-rakuten damienjoldersma-rakuten commented Mar 11, 2024

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:

[2024-03-11T02:07:26,527] WARN  vault-storage [qtp689905739-81] - Error logging into Vault: Encountered error while authenticating with approle: Vault responded with HTTP status code: 400
Response body: {"errors":["invalid role ID"]}
[2024-03-11T02:12:48,291] WARN  vault-storage [pool-12-thread-1] - Error logging into Vault: Encountered error while authenticating with approle: Vault responded with HTTP status code: 400
Response body: {"errors":["invalid secret id"]}

…so, do not ignore and do not just swallow login exceptions.
@fdevans fdevans requested review from a team and Copilot March 18, 2026 20:40
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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");
}
@fdevans fdevans changed the title Add helpful log output to aid with troulbeshooting of vault login. Add helpful log output to aid with troubleshooting of vault login. Mar 24, 2026
@fdevans
Copy link
Copy Markdown
Contributor

fdevans commented Mar 24, 2026

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants