Can't re-install captive-redirect snap after setting up a rule

Bug #1677213 reported by Victor gonzalez
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
snappy-hwe-snaps
Fix Released
High
Unassigned

Bug Description

Story: once captive-redirect passed canonical tests on pi3 I removed the snap and tried to re-install it but it failed.

Environment:

latest candidate image on pi3
captive-redirect --candidate

Steps:

1. $ snap install captive-redirect --candidate
2. Set a new rule(i.e following canonical tests snap):
3. $ snap remove captive redirect
4. $ snap install captive redirect --candidate

Expected result: captive-redirect is installed

Current result:

$ sudo snap install captive-redirect --candidate
error: cannot perform the following tasks:
- Run configure hook of "captive-redirect" snap if present (run hook "configure": fork/exec /sbin/iptables: permission denied)

summary: - Can¡t re-install captive-redirect snap after setting up a rule
+ Can't re-install captive-redirect snap after setting up a rule
Revision history for this message
Matteo Croce (teknoraver) wrote :

After a few investigations I've noticed that snapd doesn't fully remove configuration after a remove:

# snap set captive-redirect active=true port=8080

# cat /var/snap/captive-redirect/common/config.json
{"active":true,"port":8080,"interfaces":null}

# grep -ro '{[^{]*8080[^}]*}' /var/lib/snapd/
/var/lib/snapd/state.json:{"active":true,"port":8080}
/var/lib/snapd/state.json:{"port":8080}
/var/lib/snapd/state.json:{"active":true,"port":8080}

# snap remove captive-redirect

# cat /var/snap/captive-redirect/common/config.json
cat: /var/snap/captive-redirect/common/config.json: No such file or directory

# grep -ro '{[^{]*8080[^}]*}' /var/lib/snapd/
/var/lib/snapd/state.json:{"active":true,"port":8080}
/var/lib/snapd/state.json:{"port":8080}
/var/lib/snapd/state.json:{"active":true,"port":8080}

Fortunately this will be fixed in the next version as a fix was already merged:

https://github.com/snapcore/snapd/pull/3052

Revision history for this message
Jim Hodapp (jhodapp) wrote :

@Victor: Given what Matteo discovered with snapd, do you want to wait and retest the captive-redirect snap when this snapd fix is in place?

Revision history for this message
Victor gonzalez (victor-gonzalez-0) wrote :

@jhodapp: sure, I'll take it once it's ready

Revision history for this message
Alfie Huang (alfie073) wrote :

Update info:

Test Platform: St.Louis (CID:201603-21474)
Snapd version: 2.24
captive-redirect version: Rev.27

Test Step:
1.Install captive-redirect
  $ snap install captive-redirect --candidate
2.Run the following manual test case.
3.After step2, remove captive-redirect
  $ snap remove captive-redirect
4.Re-install captive-redirect again.
  $ snap install captive-redirect --candidate

Result:
captive-redirect snap is installed completed. ---> PASS

Jim Hodapp (jhodapp)
Changed in snappy-hwe-snaps:
status: New → Fix Committed
importance: Undecided → High
Revision history for this message
Jim Hodapp (jhodapp) wrote :

Test results spreadsheet from AlfieHuang.

Jim Hodapp (jhodapp)
Changed in snappy-hwe-snaps:
status: Fix Committed → Fix Released
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.