20 May 2021 11:09 PM
I am getting an empty result for this command:
oc get secret $(oc get sa dynatrace-kubernetes-monitoring -o jsonpath='{.secrets[1].name}' -n dynatrace) -o jsonpath='{.data.token}' -n dynatrace
Looks like the secret "dynatrace-kubernetes-monitoring-dockercfg-8c4xg" does not contain the parameter '.data.token'
I tried extracting the value from the 'metadata.annotations.openshift.io/token-secret.value' parameter but it says it contains a malformed base64
Trying to repair the malformed base64, I am not able to get a bearer token that the dynatrace integration would "like". Error is "invalid bearer token"
Solved! Go to Solution.
21 May 2021 05:50 PM
Hi rhaddad,
Regarding the "Invalid Bearer Token", you might want to check your ActiveGate logs to ensure there are no issues when trying to reach to this API (trying to authorize). It could be firewall rules or a proxy that might be causing this.
Regards,
Moe
21 May 2021 10:50 PM
Moe, you're right/ The API is not publicly accessible. Thank you for pointing that out.
24 May 2021 09:32 PM
the API accessibility does not seem to be the issue here since I can replicate this on AWS.
24 May 2021 10:19 PM
Are you using any Cluster Management Platform like Rancher? Docker EE? Also, please check and ensure there are no white spaces in the token.
25 May 2021 12:22 AM - edited 25 May 2021 12:23 AM
No cluster management is being used. The issue is that the .data.token is coming back empty so the command is not decoding anything. Can you post a sample token so I know what the format looks like? thanks
24 May 2021 09:32 PM
Tried the same procedure on AWS and I am hitting the same exact error. The API is definitely accessible there.
25 May 2021 08:45 PM
There are some issues with this particular command as sometimes the token is the first secret and sometimes it is the second secret. Try the command again to get the first secret (zero indexed):
oc get secret $(oc get sa dynatrace-kubernetes-monitoring -o jsonpath='{.secrets[0].name}' -n dynatrace) -o jsonpath='{.data.token}' -n dynatrace
26 May 2021 02:18 PM
Thanks Mike. That resolved the issue.