ansible --version
ansible [core 2.14.2]
config file = None
configured module search path = ['/home/kk/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/lib/python3.9/site-packages/ansible
ansible collection location = /home/kk/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/local/bin/ansible
python version = 3.9.14 (main, Nov 7 2022, 00:00:00) [GCC 11.3.1 20220421 (Red Hat 11.3.1-2)] (/usr/bin/python3)
jinja version = 3.1.2
libyaml = True
ansible-galaxy collection list
Collection Version
---------------------- -------
ansible.controller 4.4.7
awx.awx 23.2.0
infra.ah_configuration 2.0.4
Private Automation Hub version
Server version 4.6.3
Pulp Ansible Version 0.15.0
UI Version 4.6.3
ansible installation method: one of source, pip, OS package, EE
OS package
OS / ENVIRONMENT
Red Hat Enterprise Linux release 9.1 (Plow)
Desired Behavior
Meaningful error message, for example: "Unable to log in to Private Automation Hub", or perhaps "Failed to authenticate", or "Incorrect username or password"
Actual Behavior
Getting the following error:
"An unhandled exception occurred while running the lookup plugin 'infra.ah_configuration.ah_api'. Error was a <class 'TypeError'>, original message: expected string or bytes-like object. expected string or bytes-like object"
STEPS TO REPRODUCE
Make query via API like so:
- name: Get list of published collections
ansible.builtin.set_fact:
published_collections: "{{ query('infra.ah_configuration.ah_api',
'collections',
host=hub_config_host,
username=hub_config_user,
password=hub_config_pass,
verify_ssl=false) }}"
specifying incorrect credentials in hub_config_user/hub_config_pass.
Get an error message that doesn't make any sense:
{
"msg": "An unhandled exception occurred while running the lookup plugin 'infra.ah_configuration.ah_api'. Error was a <class 'TypeError'>, original message: expected string or bytes-like object. expected string or bytes-like object",
"_ansible_no_log": false
}
Summary
Show meaningful error message when Private Hub credentials are incorrect.
Issue Type
Ansible, Collection, Private Automation Hub details
OS / ENVIRONMENT
Red Hat Enterprise Linux release 9.1 (Plow)
Desired Behavior
Meaningful error message, for example: "Unable to log in to Private Automation Hub", or perhaps "Failed to authenticate", or "Incorrect username or password"
Actual Behavior
Getting the following error: "An unhandled exception occurred while running the lookup plugin 'infra.ah_configuration.ah_api'. Error was a <class 'TypeError'>, original message: expected string or bytes-like object. expected string or bytes-like object"
STEPS TO REPRODUCE
Make query via API like so:
specifying incorrect credentials in hub_config_user/hub_config_pass.
Get an error message that doesn't make any sense: