Ce contenu n'est pas disponible dans la langue sélectionnée.
Chapter 6. Jobs
Troubleshoot issues with jobs.
6.1. Issue - Jobs are failing when run against localhost Copier lienLien copié sur presse-papiers!
With Ansible Automation Platform 2 and its containerized execution environments, the usage of localhost has changed. For more information, see Converting playbooks for AAP 2 in the Red Hat Ansible Automation Platform Upgrade and Migration Guide.
6.2. Issue - Jobs are failing with “ERROR! couldn’t resolve module/action” error message Copier lienLien copié sur presse-papiers!
Jobs are failing with the error message “ERROR! couldn’t resolve module/action 'module name'. This often indicates a misspelling, missing collection, or incorrect module path”.
This error can happen when the collection associated with the module is missing from the execution environment.
The recommended resolution is to create a custom execution environment and add the required collections inside of that execution environment. For more information about creating an execution environment, see Using Ansible Builder in Creating and Consuming Execution Environments.
Alternatively, you can complete the following steps:
Procedure
-
Create a
collectionsfolder inside of the project repository. Add a
requirements.ymlfile inside of thecollectionsfolder and add the collection:collections: - <collection_name>
6.3. Issue - Jobs are failing with “Timeout (12s) waiting for privilege escalation prompt” error message Copier lienLien copié sur presse-papiers!
This error can happen when the timeout value is too small, causing the job to stop before completion. The default timeout value for connection plugins is 10.
To resolve the issue, increase the timeout value by completing one of the following procedures.
The following changes will affect all of the jobs in automation controller. To use a timeout value for a specific project, add an ansible.cfg file in the root of the project directory and add the timeout parameter value to that ansible.cfg file.
Add ANSIBLE_TIMEOUT as an environment variable in the automation controller UI
- Go to automation controller.
-
From the navigation panel, select
. Under Extra Environment Variables add the following:
{ "ANSIBLE_TIMEOUT": 60 }
Add a timeout value in the [defaults] section of the ansible.cfg file by using the CLI
Edit the
/etc/ansible/ansible.cfgfile and add the following:[defaults] timeout = 60
Running ad hoc commands with a timeout
To run an ad hoc playbook in the command line, add the
--timeoutflag to theansible-playbookcommand, for example:# ansible-playbook --timeout=60 <your_playbook.yml>
6.4. Issue - Jobs in automation controller are stuck in a pending state Copier lienLien copié sur presse-papiers!
After launching jobs in automation controller, the jobs stay in a pending state and do not start.
There are a few reasons jobs can become stuck in a pending state. For more information about troubleshooting this issue, see Playbook stays in pending in the Automation Controller Administration Guide.
Cancel all pending jobs
Run the following commands to list all of the pending jobs:
# awx-manage shell_plus>>> UnifiedJob.objects.filter(status='pending')Run the following command to cancel all of the pending jobs:
>>> UnifiedJob.objects.filter(status='pending').update(status='canceled')
Cancel a single job by using a job id
To cancel a specific job, run the following commands, replacing
<job_id>with the job id to cancel:# awx-manage shell_plus>>> UnifiedJob.objects.filter(id=_<job_id>_).update(status='canceled')
Jobs are failing with the error message "denied: requested access to the resource is denied, unauthorized: Insufficient permissions" when using an execution environment in private automation hub.
This issue happens when your private automation hub is protected with a password or token and the registry credential is not assigned to the execution environment.
Procedure
- Go to automation controller.
-
From the navigation panel, select
. - Click the execution environment assigned to the job template that is failing.
- Click .
- Assign the appropriate Registry credential from your private automation hub to the execution environment.