fanatic enable-fan does not clean up config after failed bringup

Bug #1728050 reported by Stefan Bader on 2017-10-27
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ubuntu-fan (Ubuntu)
Medium
Stefan Bader
Xenial
Undecided
Unassigned
Zesty
Undecided
Unassigned
Artful
Undecided
Unassigned

Bug Description

SRU Justification (for Artful/Zesty/Xenial):

Impact:
"fanatic enable-fan" calls to fanctl to actually bring up the Fan bridge. However it is possible that this returns with an error and in that case fanatic must undo previously done configuration changes or otherwise any following attempt to run enable-fan will incorrectly believe the bridge is up and do nothing.

Fix:
Adding a remove config stage if the call to fanctl returns with an error.

Testcase:
  [fan is installed but not enabled]
  - sudo flock -x /run/xtables.lock sleep 300
  - fanatic enable-fan -u 192.168.0.0/16 -o 250.0.0.0/8; echo $?

Note: It seems in Artful, the default for iptables is to wait until the lock is released (without -w) so the test here won't work without adding -w to all iptables calls in fanctl. :/

Regression potential:
Cleanup called only on failure and the used function is also used in fanatic disable-fan. -> Low

Stefan Bader (smb) wrote :

diff --git a/fanatic b/fanatic
index 8366881..5a83ad1 100755
--- a/fanatic
+++ b/fanatic
@@ -142,7 +142,11 @@ enable_fan()
 # fi
   progress "configuring fan underlay:$underlay overlay:$overlay"
   twiddle_fan_config add "$device" "$overlay" "$underlay"
- fanctl up -o "$overlay" -u "$underlay" --auto || fail "unable to bring fan up, unable to configure"
+ if ! fanctl up -o "$overlay" -u "$underlay" --auto; then
+ twiddle_fan_config remove "$device" "$overlay" \
+ "$underlay"
+ fail "unable to bring fan up, unable to configure"
+ fi
  fi
 }

Stefan Bader (smb) on 2017-10-27
description: updated
Stefan Bader (smb) on 2017-10-27
description: updated

Hello Stefan, or anyone else affected,

Accepted ubuntu-fan into artful-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/ubuntu-fan/0.12.7~17.10.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-artful to verification-done-artful. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-artful. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in ubuntu-fan (Ubuntu Artful):
status: New → Fix Committed
tags: added: verification-needed verification-needed-artful
Changed in ubuntu-fan (Ubuntu Zesty):
status: New → Fix Committed
tags: added: verification-needed-zesty
Łukasz Zemczak (sil2100) wrote :

Hello Stefan, or anyone else affected,

Accepted ubuntu-fan into zesty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/ubuntu-fan/0.12.7~17.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-zesty to verification-done-zesty. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-zesty. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Łukasz Zemczak (sil2100) wrote :

Hello Stefan, or anyone else affected,

Accepted ubuntu-fan into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/ubuntu-fan/0.12.7~16.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-xenial to verification-done-xenial. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-xenial. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in ubuntu-fan (Ubuntu Xenial):
status: New → Fix Committed
tags: added: verification-needed-xenial
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-fan - 0.12.8

---------------
ubuntu-fan (0.12.8) bionic; urgency=medium

  * fanatic: Optionally provide DNS server for docker test (LP: #1732717)

ubuntu-fan (0.12.7) bionic; urgency=medium

  * fanctl: cmd_up needs to proparate scan_config errors (LP: #1719644)
  * fanatic: Clean up config if bringup fails (LP: #1728050)

 -- Stefan Bader <email address hidden> Thu, 16 Nov 2017 18:44:06 +0100

Changed in ubuntu-fan (Ubuntu):
status: In Progress → Fix Released
Łukasz Zemczak (sil2100) wrote :

Hello Stefan, or anyone else affected,

Accepted ubuntu-fan into artful-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/ubuntu-fan/0.12.8~17.10.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-artful to verification-done-artful. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-artful. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Łukasz Zemczak (sil2100) wrote :

Hello Stefan, or anyone else affected,

Accepted ubuntu-fan into zesty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/ubuntu-fan/0.12.8~17.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-zesty to verification-done-zesty. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-zesty. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Łukasz Zemczak (sil2100) wrote :

Hello Stefan, or anyone else affected,

Accepted ubuntu-fan into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/ubuntu-fan/0.12.8~16.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-xenial to verification-done-xenial. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-xenial. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Stefan Bader (smb) wrote :

Verified for Xenial/0.12.8~16.04.1 that after failing while flock was active, the next attempt after releasing the flock did succeed.

tags: added: verification-done-xenial
removed: verification-needed-xenial
Stefan Bader (smb) wrote :

Verified for Zesty/0.12.8~17.04.1 (after failed attempt and releasing lock, next attempt succeeds).

tags: added: verification-done-zesty
removed: verification-needed-zesty
Stefan Bader (smb) wrote :

Verified for Artful/0.12.8~17.10.1 that after an unsuccessful "fanatic enable-fan" run which returned rc=1, the next run with the cause of the failure remove will succeed (before it would not have attempted).

tags: added: verification-done verification-done-artful
removed: verification-needed verification-needed-artful
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-fan - 0.12.8~17.10.1

---------------
ubuntu-fan (0.12.8~17.10.1) artful; urgency=medium

  * fanatic: Optionally provide DNS server for docker test (LP: #1732717)

ubuntu-fan (0.12.7~17.10.1) artful; urgency=medium

  * fanctl: cmd_up needs to proparate scan_config errors (LP: #1719644)
  * fanatic: Clean up config if bringup fails (LP: #1728050)

 -- Stefan Bader <email address hidden> Wed, 29 Nov 2017 11:00:50 +0100

Changed in ubuntu-fan (Ubuntu Artful):
status: Fix Committed → Fix Released

The verification of the Stable Release Update for ubuntu-fan has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-fan - 0.12.8~17.04.1

---------------
ubuntu-fan (0.12.8~17.04.1) zesty; urgency=medium

  * fanatic: Optionally provide DNS server for docker test (LP: #1732717)

ubuntu-fan (0.12.7~17.04.1) zesty; urgency=medium

  * fanctl: cmd_up needs to proparate scan_config errors (LP: #1719644)
  * fanatic: Clean up config if bringup fails (LP: #1728050)

ubuntu-fan (0.12.6~17.04.1) zesty; urgency=medium

  [ 0.12.5 ]
  * DEP8: Fix LXD default interface detection (LP: #1732739)
  * fanctl: return error on fail_up (LP: #1719644)

  [ 0.12.6 ]
  * fanatic: Add short success delay to nc_send (LP: #1721352)
  * fanatic: Catch test preparation steps failing (LP: #1735183)
  * fanatic: Add DNS checks to local-test preparation (LP: #1732747)

 -- Stefan Bader <email address hidden> Wed, 29 Nov 2017 15:08:26 +0100

Changed in ubuntu-fan (Ubuntu Zesty):
status: Fix Committed → Fix Released
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-fan - 0.12.8~16.04.1

---------------
ubuntu-fan (0.12.8~16.04.1) xenial; urgency=medium

  * fanatic: Optionally provide DNS server for docker test (LP: #1732717)

ubuntu-fan (0.12.7~16.04.1) xenial; urgency=medium

  * fanctl: cmd_up needs to proparate scan_config errors (LP: #1719644)
  * fanatic: Clean up config if bringup fails (LP: #1728050)

ubuntu-fan (0.12.6~16.04.1) xenial; urgency=medium

  [ 0.12.5 ]
  * DEP8: Fix LXD default interface detection (LP: #1732739)
  * fanctl: return error on fail_up (LP: #1719644)

  [ 0.12.6 ]
  * fanatic: Add short success delay to nc_send (LP: #1721352)
  * fanatic: Catch test preparation steps failing (LP: #1735183)
  * fanatic: Add DNS checks to local-test preparation (LP: #1732747)

ubuntu-fan (0.12.4~16.04.1) xenial; urgency=medium

  [ Andy Whitcroft ]
  * fanctl.8: fix interfane type (LP: #1584845)
  * debian/control: fix use of obsolete > operator (LP: #1714969)
  * fanctl: only bring up enabled Fan Networks in --auto mode (LP: #1707610)
  * fanctl: correctly specify local interface specific config (LP: #1707610)
  * fanatic: recast advanced commands as non-interactive (LP: #1714966)
  * fanatic: fix spelling in primary help (LP: #1714966)
  * fanatic: fix references to fanatic manual page (LP: #1714966)

  [ Stefan Bader ]
  * fanatic: fix local testing and improve docker test (LP: #1714969)
  * fanatic: Support nc -N option (LP: #1714969)
  * fanatic: Prevent error message without docker installed (LP: #1714969)
  * fanatic: Supply LXD storage if needed (LP: #1714969)
  * dep8: Add LXD auto-test (LP: #1714969)
  * fanatic: Fix typo in progress output (LP: #1714966)
  * README: Refresh documentation (LP: #1714966)
  * fanctl.8: Refresh documentation (LP: #1714966)
  * fanatic.8: Refresh documentation (LP: #1714966)
  * fanatic.8: Reword advanced to non-interactive usage (LP: #1714966)
  * DEP8: lxd: Suppress stderr on profile list (LP: #1714969)

 -- Stefan Bader <email address hidden> Wed, 29 Nov 2017 16:17:26 +0100

Changed in ubuntu-fan (Ubuntu Xenial):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers