Exception occurred while executing operation Kubernetes Get Call.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2025 11:27 AM
Olá,
estou com um problema e preciso de ajuda:
Exception occurred while executing operation Kubernetes Get Call. Custom operation Failed to run script due to the following error: JAVASCRIPT_CODE_FAILURE: com.snc.sw.exception.CommandFailureException: Permission issues with azure cli while getting the bearer token , verify if the azure cli is configured. (script_include:AKSTokenGenerator; line 23)
Minhas credenciais são registradas com o tipo AZURE, com o "ID do locatário", "ID do cliente" e "Chave secreta" sendo passados.
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2025 07:21 AM
Hello @lucasgferra,
The error "Exception occurred while executing operation Kubernetes Get Call in ServiceNow" when running a Kubernetes discovery typically indicates an issue with accessing or retrieving data from the Kubernetes cluster. This could stem from various problems, including incorrect credentials, permission issues, or problems with the Kubernetes configuration itself.
Here's a breakdown of potential causes and troubleshooting steps:
1. Authentication and Authorization Issues:
-
Incorrect Credentials:Verify that the Kubernetes credentials configured in ServiceNow are accurate and have the necessary permissions to access the cluster and namespaces.
-
Service Account Privileges:Ensure the service account associated with the credentials has sufficient rights to perform the required operations, such as listing namespaces, pods, and other resources.
-
Bearer Token Issues:If using a bearer token for authentication, confirm that it's valid and hasn't expired. Check the ServiceNow documentation or related KB articles (e.g., KB0811716) for specific instructions on using bearer tokens.
2. Namespace-Related Problems:
-
Incorrect Namespace Specification:If a specific namespace is provided in the discovery schedule, double-check its correctness. If you intend to discover the entire cluster, ensure the namespace parameter is either left blank or set to "*", according to ServiceNow Community forum advice.
-
No Namespaces Found:If the discovery pattern is failing to find any namespaces, verify that the cluster has namespaces configured and that the provided credentials have the necessary permissions to list them.
3. Configuration and Connectivity:
-
Configuration Data:Review the configuration data for the Kubernetes endpoint in ServiceNow. Ensure that the API server URL, certificate, and other relevant settings are correct.
-
Network Connectivity:Verify that ServiceNow can reach the Kubernetes API server. Check for any firewall rules or network configurations that might be blocking communication.
4. Discovery Pattern Issues:
-
Pattern Logs:Examine the discovery pattern logs for more detailed error messages. These logs can provide specific clues about where the script is failing and what the root cause might be.
-
Custom Operation Errors:If the error mentions a "Custom operation Failed to run script", it could indicate an issue with the JavaScript code within the discovery pattern. Carefully review the script for errors, such as undefined variables or incorrect logic.
Troubleshooting Steps:
- Verify Credentials: Double-check the credentials and ensure they have the necessary permissions.
- Check Namespace: Confirm that the namespace configuration is correct or that you are discovering the entire cluster.
- Review Configuration: Examine the Kubernetes endpoint configuration in ServiceNow for accuracy.
- Test Network Connectivity: Ensure ServiceNow can reach the Kubernetes API server.
- Examine Pattern Logs: Look for detailed error messages in the discovery pattern logs.
- Consult Documentation: Refer to ServiceNow documentation and community forums for specific guidance related to Kubernetes discovery.
By systematically addressing these potential causes, you can identify and resolve the "Exception occurred while executing operation Kubernetes Get Call" error and successfully complete your Kubernetes discovery in ServiceNow.
If this is helpful, please hit the thumbs up button and accept the correct solution by referring to this solution in future it will be helpful to them.
Thanks & Regards,
Abbas Shaik