Uploaded image for project: 'Ansible Automation Platform RFEs'
  1. Ansible Automation Platform RFEs
  2. AAPRFE-952

[API] activation requires an awx token when it's not necessary.

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Done
    • Icon: Normal Normal
    • 2.5
    • 2.4
    • event-driven-ansible
    • None
    • False
    • Hide

      None

      Show
      None
    • False
    • Release Note Not Required

      Rhel9 downstream build with yolo
      How to reproduce:
      Create an activation that uses a rulebook without run_job_template with an user that has no configured the token.

      Apr 27 22:27:10 aizquierdo-cb-automationedacontroller-0 automation-eda-controller-daphne[29031]: 2023-04-27 22:27:10,789 ERROR    Exception inside application: 'NoneType' object has no attribute 'token'
      Apr 27 22:27:10 aizquierdo-cb-automationedacontroller-0 automation-eda-controller-daphne[29031]: Traceback (most recent call last):
      Apr 27 22:27:10 aizquierdo-cb-automationedacontroller-0 automation-eda-controller-daphne[29031]:   File "/usr/lib/python3.9/site-packages/channels/routing.py", line 62, in __call__
      Apr 27 22:27:10 aizquierdo-cb-automationedacontroller-0 automation-eda-controller-daphne[29031]:     return await application(scope, receive, send)
      Apr 27 22:27:10 aizquierdo-cb-automationedacontroller-0 automation-eda-controller-daphne[29031]:   File "/usr/lib/python3.9/site-packages/channels/routing.py", line 116, in __call__
      Apr 27 22:27:10 aizquierdo-cb-automationedacontroller-0 automation-eda-controller-daphne[29031]:     return await application(
      Apr 27 22:27:10 aizquierdo-cb-automationedacontroller-0 automation-eda-controller-daphne[29031]:   File "/usr/lib/python3.9/site-packages/channels/routing.py", line 116, in __call__
      Apr 27 22:27:10 aizquierdo-cb-automationedacontroller-0 automation-eda-controller-daphne[29031]:     return await application(
      Apr 27 22:27:10 aizquierdo-cb-automationedacontroller-0 automation-eda-controller-daphne[29031]:   File "/usr/lib/python3.9/site-packages/channels/consumer.py", line 94, in app
      Apr 27 22:27:10 aizquierdo-cb-automationedacontroller-0 automation-eda-controller-daphne[29031]:     return await consumer(scope, receive, send)
      Apr 27 22:27:10 aizquierdo-cb-automationedacontroller-0 automation-eda-controller-daphne[29031]:   File "/usr/lib/python3.9/site-packages/channels/consumer.py", line 62, in __call__
      Apr 27 22:27:10 aizquierdo-cb-automationedacontroller-0 automation-eda-controller-daphne[29031]:     await await_many_dispatch([receive], self.dispatch)
      Apr 27 22:27:10 aizquierdo-cb-automationedacontroller-0 automation-eda-controller-daphne[29031]:   File "/usr/lib/python3.9/site-packages/channels/utils.py", line 50, in await_many_dispatch
      Apr 27 22:27:10 aizquierdo-cb-automationedacontroller-0 automation-eda-controller-daphne[29031]:     await dispatch(result)
      Apr 27 22:27:10 aizquierdo-cb-automationedacontroller-0 automation-eda-controller-daphne[29031]:   File "/usr/lib/python3.9/site-packages/channels/consumer.py", line 73, in dispatch
      Apr 27 22:27:10 aizquierdo-cb-automationedacontroller-0 automation-eda-controller-daphne[29031]:     await handler(message)
      Apr 27 22:27:10 aizquierdo-cb-automationedacontroller-0 automation-eda-controller-daphne[29031]:   File "/usr/lib/python3.9/site-packages/channels/generic/websocket.py", line 194, in websocket_receive
      Apr 27 22:27:10 aizquierdo-cb-automationedacontroller-0 automation-eda-controller-daphne[29031]:     await self.receive(text_data=message["text"])
      Apr 27 22:27:10 aizquierdo-cb-automationedacontroller-0 automation-eda-controller-daphne[29031]:   File "/usr/lib/python3.9/site-packages/aap_eda/wsapi/consumers.py", line 83, in receive
      Apr 27 22:27:10 aizquierdo-cb-automationedacontroller-0 automation-eda-controller-daphne[29031]:     await self.handle_workers(WorkerMessage.parse_obj(data))
      Apr 27 22:27:10 aizquierdo-cb-automationedacontroller-0 automation-eda-controller-daphne[29031]:   File "/usr/lib/python3.9/site-packages/aap_eda/wsapi/consumers.py", line 114, in handle_workers
      Apr 27 22:27:10 aizquierdo-cb-automationedacontroller-0 automation-eda-controller-daphne[29031]:     token=await self.get_awx_token(message),
      Apr 27 22:27:10 aizquierdo-cb-automationedacontroller-0 automation-eda-controller-daphne[29031]:   File "/usr/lib/python3.9/site-packages/asgiref/sync.py", line 448, in __call__
      Apr 27 22:27:10 aizquierdo-cb-automationedacontroller-0 automation-eda-controller-daphne[29031]:     ret = await asyncio.wait_for(future, timeout=None)
      Apr 27 22:27:10 aizquierdo-cb-automationedacontroller-0 automation-eda-controller-daphne[29031]:   File "/usr/lib64/python3.9/asyncio/tasks.py", line 442, in wait_for
      Apr 27 22:27:10 aizquierdo-cb-automationedacontroller-0 automation-eda-controller-daphne[29031]:     return await fut
      Apr 27 22:27:10 aizquierdo-cb-automationedacontroller-0 automation-eda-controller-daphne[29031]:   File "/usr/lib64/python3.9/concurrent/futures/thread.py", line 58, in run
      Apr 27 22:27:10 aizquierdo-cb-automationedacontroller-0 automation-eda-controller-daphne[29031]:     result = self.fn(*self.args, **self.kwargs)
      Apr 27 22:27:10 aizquierdo-cb-automationedacontroller-0 automation-eda-controller-daphne[29031]:   File "/usr/lib/python3.9/site-packages/channels/db.py", line 13, in thread_handler
      Apr 27 22:27:10 aizquierdo-cb-automationedacontroller-0 automation-eda-controller-daphne[29031]:     return super().thread_handler(loop, *args, **kwargs)
      Apr 27 22:27:10 aizquierdo-cb-automationedacontroller-0 automation-eda-controller-daphne[29031]:   File "/usr/lib/python3.9/site-packages/asgiref/sync.py", line 490, in thread_handler
      Apr 27 22:27:10 aizquierdo-cb-automationedacontroller-0 automation-eda-controller-daphne[29031]:     return func(*args, **kwargs)
      Apr 27 22:27:10 aizquierdo-cb-automationedacontroller-0 automation-eda-controller-daphne[29031]:   File "/usr/lib/python3.9/site-packages/aap_eda/wsapi/consumers.py", line 318, in get_awx_token
      Apr 27 22:27:10 aizquierdo-cb-automationedacontroller-0 automation-eda-controller-daphne[29031]:     return awx_token.token.get_secret_value()
      Apr 27 22:27:10 aizquierdo-cb-automationedacontroller-0 automation-eda-controller-daphne[29031]: AttributeError: 'NoneType' object has no attribute 'token'
      

      Expected Result: The activation should run without needing the token

              rhn-gps-jpisciot Joseph Pisciotta
              rhn-support-aizquier Alejandro Izquierdo
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: