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

Better error message when incorrect Private Hub credentials specified #353

Open
kk-at-redhat opened this issue Jan 21, 2024 · 0 comments
Open
Labels
bug Something isn't working inactive

Comments

@kk-at-redhat
Copy link

Summary

Show meaningful error message when Private Hub credentials are incorrect.

Issue Type

  • Bug Report

Ansible, Collection, Private Automation Hub details

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
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working inactive
Projects
None yet
Development

No branches or pull requests

2 participants