Instance HA got broken due to env addition in shebang

Bug #1785245 reported by Michele Baldessari
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Fix Released
Critical
Damien Ciabrini

Bug Description

Via change Id915ded03ae5a471ffa2dca13e2da90021279f63 we did the following:
--- a/extraconfig/tasks/instanceha/check-run-nova-compute
+++ b/extraconfig/tasks/instanceha/check-run-nova-compute
@@ -1,4 +1,4 @@
-#!/bin/python -utt
+#!/usr/bin/env python -utt

 import os
 import sys

The problem is that the above script gets invoked via 'exec' in kolla here:
https://github.com/openstack/tripleo-heat-templates/blob/master/docker/services/nova-compute.yaml#L161

Because kolla's start.sh invokes the script in the container via 'exec'.
Exec won't support multiple multiple commands and errors out as follows:
+ echo 'Running command: '\''/var/lib/nova/instanceha/check-run-nova-compute '\'''
+ exec /var/lib/nova/instanceha/check-run-nova-compute
Running command: '/var/lib/nova/instanceha/check-run-nova-compute '
/usr/bin/env: python -utt: No such file or directory

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-heat-templates (master)

Fix proposed to branch: master
Review: https://review.openstack.org/588552

Changed in tripleo:
assignee: nobody → Damien Ciabrini (dciabrin)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-heat-templates (master)

Reviewed: https://review.openstack.org/588552
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=9668e7b9bf92257bc1ca9fbb04c973ef698c3dba
Submitter: Zuul
Branch: master

commit 9668e7b9bf92257bc1ca9fbb04c973ef698c3dba
Author: Damien Ciabrini <email address hidden>
Date: Fri Aug 3 15:10:10 2018 +0200

    Revert shebang change for InstanceHA startup script

    In Id915ded03ae5a471ffa2dca13e2da90021279f63 the shebang for
    check-run-nova-compute has been changed to use /usr/bin/env, which
    broke exec'ing the script:

      + exec /var/lib/nova/instanceha/check-run-nova-compute
      Running command: '/var/lib/nova/instanceha/check-run-nova-compute '
      /usr/bin/env: python -utt: No such file or directory

    Revert the change for this script.

    Change-Id: I96f82421638581122d687492f7420fd5724a7207
    Closes-Bug: #1785245

Changed in tripleo:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-heat-templates (stable/queens)

Fix proposed to branch: stable/queens
Review: https://review.openstack.org/588880

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-heat-templates (stable/queens)

Reviewed: https://review.openstack.org/588880
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=481396a2e4b462c487d4e241427a15cda4f011c0
Submitter: Zuul
Branch: stable/queens

commit 481396a2e4b462c487d4e241427a15cda4f011c0
Author: Damien Ciabrini <email address hidden>
Date: Fri Aug 3 15:10:10 2018 +0200

    Revert shebang change for InstanceHA startup script

    In Id915ded03ae5a471ffa2dca13e2da90021279f63 the shebang for
    check-run-nova-compute has been changed to use /usr/bin/env, which
    broke exec'ing the script:

      + exec /var/lib/nova/instanceha/check-run-nova-compute
      Running command: '/var/lib/nova/instanceha/check-run-nova-compute '
      /usr/bin/env: python -utt: No such file or directory

    Revert the change for this script.

    Change-Id: I96f82421638581122d687492f7420fd5724a7207
    Closes-Bug: #1785245
    (cherry picked from commit 9668e7b9bf92257bc1ca9fbb04c973ef698c3dba)

tags: added: in-stable-queens
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to tripleo-heat-templates (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/589432

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

Reviewed: https://review.openstack.org/589432
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=7d0a8f1cba8cfdc282bd5172ba9d736614c46c2a
Submitter: Zuul
Branch: master

commit 7d0a8f1cba8cfdc282bd5172ba9d736614c46c2a
Author: Michele Baldessari <email address hidden>
Date: Tue Aug 7 13:22:37 2018 +0200

    Move the shebang to /usr/bin/python

    In LP#1785245 we made sure to move the shebang script back to
    /bin/python. rpm packaging inspect script shebang lines and add Requires
    to the rpm. repoclosure checks to make sure that a given repo
    (collection of rpm files) has all necessary Requires to be able to
    install.

    Let's move the shebang to /usr/bin/python which exists and does
    not cause repoclosure issues:
    [root@compute-0 ~]# docker exec -it nova_compute sh -c 'rpm -qf /usr/bin/python'
    python-2.7.5-69.el7_5.x86_64

    Change-Id: Iac4236bebab609e78b089b809a433d62c60e28c2
    Reported-By: Jon Schlueter <email address hidden>
    Related-Bug: #1785245

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

Related fix proposed to branch: stable/queens
Review: https://review.openstack.org/590593

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

Reviewed: https://review.openstack.org/590593
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=6d4a33631b84db353325e4be9f6aeef5220e6ed1
Submitter: Zuul
Branch: stable/queens

commit 6d4a33631b84db353325e4be9f6aeef5220e6ed1
Author: Michele Baldessari <email address hidden>
Date: Tue Aug 7 13:22:37 2018 +0200

    Move the shebang to /usr/bin/python

    In LP#1785245 we made sure to move the shebang script back to
    /bin/python. rpm packaging inspect script shebang lines and add Requires
    to the rpm. repoclosure checks to make sure that a given repo
    (collection of rpm files) has all necessary Requires to be able to
    install.

    Let's move the shebang to /usr/bin/python which exists and does
    not cause repoclosure issues:
    [root@compute-0 ~]# docker exec -it nova_compute sh -c 'rpm -qf /usr/bin/python'
    python-2.7.5-69.el7_5.x86_64

    Change-Id: Iac4236bebab609e78b089b809a433d62c60e28c2
    Reported-By: Jon Schlueter <email address hidden>
    Related-Bug: #1785245
    (cherry picked from commit 7d0a8f1cba8cfdc282bd5172ba9d736614c46c2a)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-heat-templates 9.0.0.0rc1

This issue was fixed in the openstack/tripleo-heat-templates 9.0.0.0rc1 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-heat-templates 8.0.6

This issue was fixed in the openstack/tripleo-heat-templates 8.0.6 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-heat-templates (master)

Fix proposed to branch: master
Review: https://review.openstack.org/628906

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on tripleo-heat-templates (master)

Change abandoned by Sorin Sbarnea (<email address hidden>) on branch: master
Review: https://review.opendev.org/628906
Reason: bug was fixed

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.