"msg": "The conditional check 'registry_login_podman is defined and registry_login_podman.results.0.rc != 0' failed.

Bug #1886555 reported by wes hayutin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Fix Committed
Critical
Unassigned

Bug Description

31:49.674090 | TASK [Assert role has worked in (CentOS|RedHat) 8]
2020-07-06 16:31:49.743679 | primary | ERROR
2020-07-06 16:31:49.743929 | primary | {
2020-07-06 16:31:49.743968 | primary | "msg": "The conditional check 'registry_login_podman is defined and registry_login_podman.results.0.rc != 0' failed. The error was: error while evaluating conditional (registry_login_podman is defined and registry_login_podman.results.0.rc != 0): 'dict object' has no attribute 'rc'\n\nThe error appears to be in '/var/lib/zuul/builds/1498dd3f6dc8470a8b9e4a7c0031af1b/trusted/project_0/review.rdoproject.org/config/playbooks/tripleo-rdo-base/container-login.yaml': line 85, column 11, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n - name: Assert role has worked in (CentOS|RedHat) 8\n ^ here\n"
2020-07-06 16:31:49.744021 | primary | }
2020-07-06 16:31:49.756342 |

This is failing all the vexhost jobs atm.
https://logserver.rdoproject.org/openstack-periodic-latest-released/opendev.org/openstack/tripleo-ci/master/periodic-tripleo-ci-centos-8-scenario001-standalone-ussuri/1498dd3/job-output.txt

https://logserver.rdoproject.org/openstack-periodic-latest-released/opendev.org/openstack/tripleo-ci/master/periodic-tripleo-ci-centos-8-ovb-3ctlr_1comp-featureset001-ussuri/3a104b8/job-output.txt

Revision history for this message
wes hayutin (weshayutin) wrote :

not sure exactly what's going on..

Here's where the original var is defined.
https://opendev.org/openstack/tripleo-ansible/src/branch/master/tripleo_ansible/roles/tripleo_podman/tasks/tripleo_podman_login.yml#L31

putting up this change.. not sure yet..
https://review.rdoproject.org/r/#/c/28393/

Revision history for this message
wes hayutin (weshayutin) wrote :

OK.. I think I see what's going on..

https://review.rdoproject.org/r/#/c/28391/1/playbooks/tripleo-rdo-base/container-login.yaml

        - name: Perform container registry login(s) buildah with sudo
          shell: |-
            sudo buildah login --username=$REGISTRY_USERNAME \
                               --password=$REGISTRY_PASSWORD \
                               --tls-verify={{ tripleo_podman_tls_verify }} \
                               $REGISTRY
          environment:
            REGISTRY_USERNAME: "{{ lookup('dict', item.value).key }}"
            REGISTRY_PASSWORD: "{{ lookup('dict', item.value).value }}"
            REGISTRY: "{{ item.key }}"
          loop: "{{ query('dict', tripleo_container_registry_logins) }}"
          register: registry_login_podman
          when:
            - (ansible_distribution == "CentOS" and ansible_distribution_major_version|int >= 8)
               or (ansible_distribution == "RedHat" and ansible_lsb.major_release|int >= 8)
            - use_kolla is defined and not use_kolla|bool

This code snip is reusing the variable "registry_login_podman" this seems logical, but this is using buildah. Podman login is called from

https://opendev.org/openstack/tripleo-ansible/src/branch/master/tripleo_ansible/roles/tripleo_podman/tasks/main.yml#L50

- name: Podman install
  import_tasks: tripleo_podman_login.yml
  when:
    - tripleo_container_registry_login | bool
    - tripleo_container_registry_logins

The podman login has a "when" to run clause... tripleo_container_registry_login(s) which the buildah task does not.

I suggest working w/ Kevin and or Emilien to move the buildah login along side the podman login for two reasons...

1. to ensure a buildah login is really required
2. to ensure the buildah and podman tasks have the same conditionals.

Revision history for this message
chandan kumar (chkumar246) wrote :

We have a wip patch https://review.opendev.org/739415 to enable buildah login

Revision history for this message
yatin (yatinkarel) wrote :

<< The podman login has a "when" to run clause... tripleo_container_registry_login(s) which the buildah task does not.
I think it happened because the task skipped(use_kolla not defined in those jobs) and the tripleo_podman_login got modified and as a result results.rc didn't exit.

<< I suggest working w/ Kevin and or Emilien to move the buildah login along side the podman login for two reasons...

<< 1. to ensure a buildah login is really required
<< 2. to ensure the buildah and podman tasks have the same conditionals.

Ack will check and discuss.

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

Reviewed: https://review.opendev.org/739415
Committed: https://git.openstack.org/cgit/openstack/tripleo-ansible/commit/?id=067a315df92248f83103e5b4b7ec8424c9b5d6a9
Submitter: Zuul
Branch: master

commit 067a315df92248f83103e5b4b7ec8424c9b5d6a9
Author: yatinkarel <email address hidden>
Date: Mon Jul 6 12:21:24 2020 +0530

    Login with buildah too to allow registry access with buildah

    buildah login and podman login with root do not share same
    authfile, buildah uses /run/containers/0/auth.json while
    podman uses /run/user/0/containers/auth.json resulted from
    $XDG_RUNTIME_DIR.

    To ensure both podman and buildah can access the configured
    registry, run login command with both.

    It's mainly needed as container images are being pushed
    with tripleoclient using sudo buildah push and buildah creds
    are not setup.

    Related-Bug: #1886555
    Change-Id: I3d38d406e9f63008f7060f31cc9ff378e97120bb

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

Related fix proposed to branch: stable/ussuri
Review: https://review.opendev.org/739868

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

Related fix proposed to branch: stable/train
Review: https://review.opendev.org/739869

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

Reviewed: https://review.opendev.org/739869
Committed: https://git.openstack.org/cgit/openstack/tripleo-ansible/commit/?id=d0fbe8b8441b1a1de3ce60856cfe9486ea4b4962
Submitter: Zuul
Branch: stable/train

commit d0fbe8b8441b1a1de3ce60856cfe9486ea4b4962
Author: yatinkarel <email address hidden>
Date: Mon Jul 6 12:21:24 2020 +0530

    Login with buildah too to allow registry access with buildah

    buildah login and podman login with root do not share same
    authfile, buildah uses /run/containers/0/auth.json while
    podman uses /run/user/0/containers/auth.json resulted from
    $XDG_RUNTIME_DIR.

    To ensure both podman and buildah can access the configured
    registry, run login command with both.

    It's mainly needed as container images are being pushed
    with tripleoclient using sudo buildah push and buildah creds
    are not setup.

    Related-Bug: #1886555
    Change-Id: I3d38d406e9f63008f7060f31cc9ff378e97120bb
    (cherry picked from commit 067a315df92248f83103e5b4b7ec8424c9b5d6a9)

tags: added: in-stable-train
tags: added: in-stable-ussuri
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to tripleo-ansible (stable/ussuri)

Reviewed: https://review.opendev.org/739868
Committed: https://git.openstack.org/cgit/openstack/tripleo-ansible/commit/?id=ee70524bab3a517f7a151138d6d651b6013d57ae
Submitter: Zuul
Branch: stable/ussuri

commit ee70524bab3a517f7a151138d6d651b6013d57ae
Author: yatinkarel <email address hidden>
Date: Mon Jul 6 12:21:24 2020 +0530

    Login with buildah too to allow registry access with buildah

    buildah login and podman login with root do not share same
    authfile, buildah uses /run/containers/0/auth.json while
    podman uses /run/user/0/containers/auth.json resulted from
    $XDG_RUNTIME_DIR.

    To ensure both podman and buildah can access the configured
    registry, run login command with both.

    It's mainly needed as container images are being pushed
    with tripleoclient using sudo buildah push and buildah creds
    are not setup.

    Related-Bug: #1886555
    Change-Id: I3d38d406e9f63008f7060f31cc9ff378e97120bb
    (cherry picked from commit 067a315df92248f83103e5b4b7ec8424c9b5d6a9)

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

Related fix proposed to branch: master
Review: https://review.opendev.org/741174

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

Reviewed: https://review.opendev.org/741174
Committed: https://git.openstack.org/cgit/openstack/tripleo-ansible/commit/?id=0d9effda372c034bafeaec9fca89c3af521c58bd
Submitter: Zuul
Branch: master

commit 0d9effda372c034bafeaec9fca89c3af521c58bd
Author: yatinkarel <email address hidden>
Date: Wed Jul 15 18:19:26 2020 +0530

    Make buildah login optional

    Buildah login is not needed always, it's needed
    when pushing to container registeries, so make it
    optional by role var tripleo_podman_buildah_login set
    to false by default.

    Related-Bug: #1886555
    Change-Id: Ibb91dfa9684b481dea34607fc47c0d531d56ee45

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

Related fix proposed to branch: stable/ussuri
Review: https://review.opendev.org/741368

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

Related fix proposed to branch: stable/train
Review: https://review.opendev.org/741369

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to tripleo-ansible (stable/ussuri)

Reviewed: https://review.opendev.org/741368
Committed: https://git.openstack.org/cgit/openstack/tripleo-ansible/commit/?id=c49c6ffbfc6f7cfbc0bfe25e27708c7734404e53
Submitter: Zuul
Branch: stable/ussuri

commit c49c6ffbfc6f7cfbc0bfe25e27708c7734404e53
Author: yatinkarel <email address hidden>
Date: Wed Jul 15 18:19:26 2020 +0530

    Make buildah login optional

    Buildah login is not needed always, it's needed
    when pushing to container registeries, so make it
    optional by role var tripleo_podman_buildah_login set
    to false by default.

    Related-Bug: #1886555
    Change-Id: Ibb91dfa9684b481dea34607fc47c0d531d56ee45
    (cherry picked from commit 0d9effda372c034bafeaec9fca89c3af521c58bd)

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

Reviewed: https://review.opendev.org/741369
Committed: https://git.openstack.org/cgit/openstack/tripleo-ansible/commit/?id=ad0403ceb39f86f0679957f99cd1003978b0db74
Submitter: Zuul
Branch: stable/train

commit ad0403ceb39f86f0679957f99cd1003978b0db74
Author: yatinkarel <email address hidden>
Date: Wed Jul 15 18:19:26 2020 +0530

    Make buildah login optional

    Buildah login is not needed always, it's needed
    when pushing to container registeries, so make it
    optional by role var tripleo_podman_buildah_login set
    to false by default.

    Conflicts:
      tripleo_ansible/roles/tripleo-podman/tasks/tripleo_podman_login.yml
      tripleo_ansible/roles/tripleo_podman/defaults/main.yml

    Related-Bug: #1886555
    Change-Id: Ibb91dfa9684b481dea34607fc47c0d531d56ee45
    (cherry picked from commit 0d9effda372c034bafeaec9fca89c3af521c58bd)
    (cherry picked from commit c49c6ffbfc6f7cfbc0bfe25e27708c7734404e53)

Changed in tripleo:
milestone: victoria-1 → victoria-3
Changed in tripleo:
status: Triaged → Fix Committed
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.