Uploaded image for project: 'Red Hat OpenStack Services on OpenShift'
  1. Red Hat OpenStack Services on OpenShift
  2. OSPRH-4553

ovn-controller fails to execute PreStop hook because of invalid command

XMLWordPrintable

    • 3
    • False
    • Hide

      None

      Show
      None
    • False
    • ?
    • ?
    • ?
    • ?
    • Neutron 2024Q1
    • Important
    • Networking; Neutron

      As can be seen in this log, FailedPreStopHook happens when PreStop is executed:

       

      83m         Warning   FailedPreStopHook       pod/ovn-controller-8l9nn                                             Exec lifecycle hook ([/usr/share/openvswitch/scripts/ovs-ctl stop --no-ovsdb-server ; sleep 2]) for Container "ovs-vswitchd" in Pod "ovn-controller-8l9nn_openstack(b628dbe7-4d26-4cc5-8027-7051f996aa6e)" failed - error: command '/usr/share/openvswitch/scripts/ovs-ctl stop --no-ovsdb-server ; sleep 2' exited with 1: /usr/share/openvswitch/scripts/ovs-ctl: exactly one non-option argument required (use --help for help)...
      83m         Warning   FailedPreStopHook       pod/ovn-controller-8l9nn                                             Exec lifecycle hook ([/usr/share/openvswitch/scripts/ovs-ctl stop --no-ovs-vswitchd ; sleep 2]) for Container "ovsdb-server" in Pod "ovn-controller-8l9nn_openstack(b628dbe7-4d26-4cc5-8027-7051f996aa6e)" failed - error: command '/usr/share/openvswitch/scripts/ovs-ctl stop --no-ovs-vswitchd ; sleep 2' exited with 1: /usr/share/openvswitch/scripts/ovs-ctl: exactly one non-option argument required (use --help for help)...
      83m         Warning   FailedPreStopHook       pod/ovn-controller-8l9nn                                             Exec lifecycle hook ([/usr/share/ovn/scripts/ovn-ctl stop_controller ; sleep 2]) for Container "ovn-controller" in Pod "ovn-controller-8l9nn_openstack(b628dbe7-4d26-4cc5-8027-7051f996aa6e)" failed - error: command '/usr/share/ovn/scripts/ovn-ctl stop_controller ; sleep 2' exited with 1: /usr/share/ovn/scripts/ovn-ctl: exactly one non-option argument required (use --help for help)...

      This is because the command contains `; sleep 2` at the end, which implies that the command is a shell script, not a direct call to an executable; so the command should include bash or other shell as part of the invocation.

      The result of this mistake is - probably - that the service is not properly informed about the stoppage, which will make the container not die on time, which will take a longer time for OVN controller to stop / restart on upgrade or for other reasons.

            ykarel@redhat.com Yatin Karel
            ihrachys Ihar Hrachyshka
            rhos-dfg-networking-squad-neutron
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: