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

-Dplugin.com.thoughtworks.gocd.secretmanager.vault.log.level=debug does not increase log level #52

Open
etSpark opened this issue Dec 8, 2020 · 1 comment

Comments

@etSpark
Copy link

etSpark commented Dec 8, 2020

Troubleshooting error responses from a remote vault server is almost impossible with the provided logs.

Having a go-server running with parameter -Dplugin.com.thoughtworks.gocd.secretmanager.vault.log.level=debug doesn't seem to increase the log level.

What would be of very interest would be the body of the request made against the vault server, headers inclusive, as well as the full response with headers. This would help to understand how queries are made and if there was a wrong path provided etc.

sample stacktrace:

ERROR [110@MessageListener for WorkFinder] Executor:127 - Failed to lookup secret from vault.
com.bettercloud.vault.VaultException: Vault responded with HTTP status code: 403
Response body: {"errors":["1 error occurred:\n\t* permission denied\n\n"]}

    at com.bettercloud.vault.api.Logical.read(Logical.java:98)
    at com.bettercloud.vault.api.Logical.read(Logical.java:74)
    at com.thoughtworks.gocd.secretmanager.vault.SecretConfigLookupExecutor.execute(SecretConfigLookupExecutor.java:51)
    at com.thoughtworks.gocd.secretmanager.vault.SecretConfigLookupExecutor.execute(SecretConfigLookupExecutor.java:33)
    at cd.go.plugin.base.executors.secrets.LookupExecutor.execute(LookupExecutor.java:28)
    at cd.go.plugin.base.dispatcher.RequestDispatcher.lambda$dispatch$0(RequestDispatcher.java:41)
    at java.base/java.util.Optional.map(Unknown Source)
    at cd.go.plugin.base.dispatcher.RequestDispatcher.dispatch(RequestDispatcher.java:41)
    at com.thoughtworks.gocd.secretmanager.vault.VaultPlugin.handle(VaultPlugin.java:59)
    at com.thoughtworks.go.plugin.infra.DefaultPluginManager.lambda$submitTo$0(DefaultPluginManager.java:134)
    at com.thoughtworks.go.plugin.infra.FelixGoPluginOSGiFramework.executeActionOnTheService(FelixGoPluginOSGiFramework.java:208)
    at com.thoughtworks.go.plugin.infra.FelixGoPluginOSGiFramework.doOn(FelixGoPluginOSGiFramework.java:164)
    at com.thoughtworks.go.plugin.infra.DefaultPluginManager.submitTo(DefaultPluginManager.java:131)
    at com.thoughtworks.go.plugin.access.PluginRequestHelper.submitRequest(PluginRequestHelper.java:49)
    at com.thoughtworks.go.plugin.access.secrets.v1.SecretsExtensionV1.lookupSecrets(SecretsExtensionV1.java:101)
    at com.thoughtworks.go.plugin.access.secrets.SecretsExtension.lookupSecrets(SecretsExtension.java:79)
    at com.thoughtworks.go.server.service.SecretParamResolver.lambda$lookupAndUpdateSecretParamsValue$0(SecretParamResolver.java:89)
    at java.base/java.util.HashMap.forEach(Unknown Source)
    at com.thoughtworks.go.server.service.SecretParamResolver.resolve(SecretParamResolver.java:80)
    at com.thoughtworks.go.server.service.SecretParamResolver.resolve(SecretParamResolver.java:66)
    at com.thoughtworks.go.server.service.BuildAssignmentService.lambda$createWork$2(BuildAssignmentService.java:298)
    at com.thoughtworks.go.server.transaction.TransactionTemplate.lambda$execute$1(TransactionTemplate.java:31)
    at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)
    at com.thoughtworks.go.server.transaction.TransactionTemplate.execute(TransactionTemplate.java:28)
    at com.thoughtworks.go.server.service.BuildAssignmentService.lambda$createWork$3(BuildAssignmentService.java:288)
    at com.thoughtworks.go.server.transaction.TransactionTemplate.transactionSurrounding(TransactionTemplate.java:60)
    at com.thoughtworks.go.server.service.BuildAssignmentService.createWork(BuildAssignmentService.java:272)
    at com.thoughtworks.go.server.service.BuildAssignmentService.assignWorkToAgent(BuildAssignmentService.java:181)
    at com.thoughtworks.go.server.service.BuildAssignmentService.assignWorkToAgent(BuildAssignmentService.java:160)
    at com.thoughtworks.go.server.messaging.scheduling.WorkFinder.onMessage(WorkFinder.java:60)
    at com.thoughtworks.go.server.messaging.scheduling.WorkFinder.onMessage(WorkFinder.java:32)
    at com.thoughtworks.go.server.messaging.activemq.JMSMessageListenerAdapter.runImpl(JMSMessageListenerAdapter.java:84)
    at com.thoughtworks.go.server.messaging.activemq.JMSMessageListenerAdapter.run(JMSMessageListenerAdapter.java:64)
    at java.base/java.lang.Thread.run(Unknown Source)
@arvindsv
Copy link
Member

arvindsv commented Dec 8, 2020

You're right. There doesn't seem to be extra logging. If you'd like to add it here and elsewhere, here is an example. Lines 10, 16 and 39 are probably going to be useful.

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

No branches or pull requests

2 participants