core icon indicating copy to clipboard operation
core copied to clipboard

config: delete vip "hides" other entries

Open fichtner opened this issue 8 years ago • 15 comments

Not entirely sure if this can be reproduced so for now just record what happened: it fits the "entries disappeared" reports that happen sporadically... I was using "die;" for debuggin in a POST request. Removed "die;", hit reload and resubmit in the browser and that happened:

--- /conf/backup/config-1542039272.2488.xml	2018-11-12 17:14:32.249928000 +0100
+++ /conf/backup/config-1542039332.9464.xml	2018-11-12 17:15:32.947471000 +0100
@@ -1165,8 +1165,8 @@
     <filterlogentriesacts>Pass Block Reject</filterlogentriesacts>
   </widgets>
   <revision>
-    <time>1542039239.9586</time>
-    <description>/firewall_virtual_ip_edit.php made changes</description>
+    <time>1542039272.25</time>
+    <description>/firewall_virtual_ip.php made changes</description>
     <username>[email protected]</username>
   </revision>
   <openvpn>
@@ -3128,27 +3128,21 @@
   </wol>
   <virtualip>
     <vip>
-      <type>single</type>
-      <subnet_bits>8</subnet_bits>
-      <mode>ipalias</mode>
-      <interface>lo0</interface>
-      <descr>testing</descr>
-      <subnet>127.0.0.2</subnet>
-    </vip>
-    <vip>
-      <type>single</type>
-      <subnet_bits>24</subnet_bits>
-      <mode>ipalias</mode>
-      <interface>wan</interface>
-      <descr>Mock</descr>
-      <subnet>192.168.2.42</subnet>
-    </vip>
-    <vip>
-      <type>single</type>
-      <subnet_bits>64</subnet_bits>
-      <mode>ipalias</mode>
-      <interface>lan</interface>
-      <subnet>::123</subnet>
+      <vip>
+        <type>single</type>
+        <subnet_bits>8</subnet_bits>
+        <mode>ipalias</mode>
+        <interface>lo0</interface>
+        <descr>testing</descr>
+        <subnet>127.0.0.2</subnet>
+      </vip>
+      <vip>
+        <type>single</type>
+        <subnet_bits>64</subnet_bits>
+        <mode>ipalias</mode>
+        <interface>lan</interface>
+        <subnet>::123</subnet>
+      </vip>
     </vip>
   </virtualip>
   <staticroutes/>

Maybe also reported via: https://forum.opnsense.org/index.php?topic=10276.0 Offending issue could be: bd148f1dd2b52

fichtner avatar Nov 12 '18 16:11 fichtner

@AdSchellevis maybe you could look at this, I'm suspecting bd148f1 again, I have it queued up for 18.7.8 but the forum thread makes me worry...

fichtner avatar Nov 16 '18 17:11 fichtner

I'm having similar issues when I delete rules it's wiping out my entire Rule list for all firewall rules.

mstrdraco avatar Nov 16 '18 18:11 mstrdraco

@mstrdraco which version?

AdSchellevis avatar Nov 16 '18 18:11 AdSchellevis

@fichtner I'll take it, it looks like I can reproduce the issue.

AdSchellevis avatar Nov 16 '18 18:11 AdSchellevis

Versions OPNsense 19.1.b_167-amd64 FreeBSD 11.1-RELEASE-p15 OpenSSL 1.0.2p 14 Aug 2018

I was running 18.7.7 and switched up to the Beta Chanel. My URL with details is - https://forum.opnsense.org/index.php?topic=10276.0

mstrdraco avatar Nov 16 '18 18:11 mstrdraco

@mstrdraco ok, thanks, same issue then indeed.

AdSchellevis avatar Nov 16 '18 18:11 AdSchellevis

@mstrdraco @AdSchellevis thanks ❤️

fichtner avatar Nov 16 '18 19:11 fichtner

@fichtner found the culprit, unset() doesn't reindex, which kills https://github.com/opnsense/core/blob/master/src/opnsense/mvc/app/library/OPNsense/Core/Config.php#L80

It's just very stupid that you can't distinct associative and sequential arrays easily.

AdSchellevis avatar Nov 16 '18 19:11 AdSchellevis

Happy to Help and thanks for all you do @fichtner @AdSchellevis

mstrdraco avatar Nov 16 '18 19:11 mstrdraco

is this also related to the "listtag" thing?

fichtner avatar Nov 16 '18 19:11 fichtner

it's in the same corner, yes

AdSchellevis avatar Nov 16 '18 19:11 AdSchellevis

https://github.com/opnsense/core/commit/0df243422bfc449a43f1e94360985458f3a72771 should fix the problem.

AdSchellevis avatar Nov 16 '18 22:11 AdSchellevis

@mstrdraco you can try the patch from the command line:

# opnsense-patch 0df2434

fichtner avatar Nov 17 '18 13:11 fichtner

Worked great! Thank you

mstrdraco avatar Nov 17 '18 13:11 mstrdraco

perfect, thanks. will be in the next devel update 👍

fichtner avatar Nov 17 '18 13:11 fichtner