'Templar' object has no attribute 'set_temporary_context'

Bug #2018588 reported by Ananya Banerjee
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Fix Released
Critical
Roberto Alfieri

Bug Description

Standalone deploy fails in Centos 8 jobs with:

 TASK | Generate /etc/openstack/clouds.yaml config
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: AttributeError: 'Templar' object has no attribute 'set_temporary_context'

https://99715b8fd39609573aaf-18cd7f889ae1379763e7ec0a1ec70a8d.ssl.cf5.rackcdn.com/881723/6/check/tripleo-ci-centos-8-standalone/ae8f9dd/logs/undercloud/home/zuul/standalone_deploy.log

This is hitting check/gate/periodic

This might be due to a mismatch between ansible and a collection version

Revision history for this message
Ronelle Landy (rlandy) wrote :
Changed in tripleo:
milestone: none → antelope-1
importance: Undecided → Critical
status: New → Triaged
tags: added: promotion-blocker
Revision history for this message
Ronelle Landy (rlandy) wrote :

Ananya's pointed to: https://bytemeta.vip/repo/ansible-collections/ansible.windows/issues/280

which mentions: "The set_temporary_context attribute was added with https://github.com/ansible/ansible/pull/60513 which was in place after Ansible 2.9 was split from the main branch and thus won't be present on any 2.9.x releases."

In Train, we have version:

ansible.noarch 1:2.9.27-4.el8 @delorean-wallaby-testing

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-ansible (stable/train)

Fix proposed to branch: stable/train
Review: https://review.opendev.org/c/openstack/tripleo-ansible/+/882446

Ronelle Landy (rlandy)
Changed in tripleo:
assignee: nobody → Roberto Alfieri (ralfieri)
Revision history for this message
Ronelle Landy (rlandy) wrote :

Two fixes are proposed:

https://review.opendev.org/c/openstack/tripleo-ansible/+/882446 Pin config_template collection to specified commit to keep compatibility with ansible 2.9

https://review.opendev.org/c/openstack/tripleo-quickstart/+/882465 Install openstack/ansible-config_template collection in quickstart.sh based on RDO version.

Together these still don’t work - possibly due to zuul-jobs where the clone is done:

See: https://storage.gra.cloud.ovh.net/v1/AUTH_dcaab5e32b234d56b626f72581e3644c/zuul_opendev_logs_205/882446/2/check/tripleo-ci-centos-8-standalone/205afe8/job-output.txt

LOOP [prepare-workspace-git : Set initial repo states in workspace]

2023-05-05 19:36:43.977544 | primary | + '[' -d /opt/git/opendev.org/openstack/ansible-config_template ']'
2023-05-05 19:36:43.977682 | primary | + git clone --bare /opt/git/opendev.org/openstack/ansible-config\_template /home/zuul/src/opendev.org/openstack/ansible-config\_template/.git
2023-05-05 19:36:43.977745 | primary | Cloning into bare repository '/home/zuul/src/opendev.org/openstack/ansible-config_template/.git'...
2023-05-05 19:36:43.977803 | primary | done.

Revision history for this message
Ronelle Landy (rlandy) wrote :

Also - we would need to decide what to do for Wallaby c8 and rhos-17.2 rhel-8.

Revision history for this message
Marios Andreou (marios-b) wrote (last edit ):

in the proposed fix we are still hitting the issue @ https://storage.gra.cloud.ovh.net/v1/AUTH_dcaab5e32b234d56b626f72581e3644c/zuul_opendev_logs_205/882446/2/check/tripleo-ci-centos-8-standalone/205afe8/logs/undercloud/home/zuul/standalone_deploy.log

An exception occurred during task execution. To see the full traceback, use -vvv. The error was: AttributeError: 'Templar' object has no attribute 'set_temporary_context'
2023-05-05 20:01:57.357585 | fa163e88-be7d-c229-52ed-000000000fa1 | FATAL | Generate /etc/openstack/clouds.yaml config | undercloud | error={"msg": "Unexpected failure during module execution.", "stdout": ""}

it seems to be checking out the right version though (pinned commit 2a59c043edcf98bcb5221e58d5aea2f89c2c9657 )

2023-05-05 19:44:03.372437 | primary | Using /home/zuul/src/opendev.org/openstack/tripleo-quickstart/ansible.cfg as config file
2023-05-05 19:44:03.380257 | primary | Cloning into '/home/zuul/.ansible/tmp/ansible-local-38155k38u_fa1/tmp1ompne60/ansible-config_template66t5mykj'...
2023-05-05 19:44:04.269404 | primary | Note: switching to '2a59c043edcf98bcb5221e58d5aea2f89c2c9657'.
2023-05-05 19:44:04.269467 | primary |
2023-05-05 19:44:04.269474 | primary | You are in 'detached HEAD' state. You can look around, make experimental

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to tripleo-ci (master)

Related fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/tripleo-ci/+/882538

Revision history for this message
Ananya Banerjee (frenzyfriday) wrote :
Changed in tripleo:
status: Triaged → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-ansible (stable/train)

Reviewed: https://review.opendev.org/c/openstack/tripleo-ansible/+/882446
Committed: https://opendev.org/openstack/tripleo-ansible/commit/69ac0f3db476ebe752d188a29cab4df2baa6a2ea
Submitter: "Zuul (22348)"
Branch: stable/train

commit 69ac0f3db476ebe752d188a29cab4df2baa6a2ea
Author: Roberto Alfieri <email address hidden>
Date: Fri May 5 15:56:31 2023 +0200

    Pin config_template for Ansible 2.9 compatibility

    We pinned ansible_config_template in rdoinfo[1], after which
    standlone jobs got fixed but Molecule job don't use rpm and
    are failing with [2]

    [1] https://bugs.launchpad.net/tripleo/+bug/2018588/comments/8
    [2] https://d7a647bfd6ccdd0e6ecc-a8638dce9de2f2c46b7008346a40a9c5.ssl.cf2.rackcdn.com/890616/2/check/tripleo-ansible-centos-8-molecule-tripleo-keystone-resources/40c5d0f/job-output.txt

    ~~~
    2023-08-07 05:30:30.031234 | centos-8-stream | An exception occurred
    during task execution. To see the full traceback, use -vvv. The error
    was: AttributeError: 'Templar' object has no attribute 'set_temporary_context'
    ~~~

    Closes-Bug: #2018588
    Change-Id: I16b6b0136f56e90d6b87c3c407d5cd7a6836a55d
    Signed-off-by: Roberto Alfieri <email address hidden>

tags: added: in-stable-train
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on tripleo-ci (master)

Change abandoned by "chandan kumar <email address hidden>" on branch: master
Review: https://review.opendev.org/c/openstack/tripleo-ci/+/882538

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.