opnsense / core

OPNsense GUI, API and systems backend
https://opnsense.org/
BSD 2-Clause "Simplified" License
3.28k stars 729 forks source link

16.1.2 + old config -> traffic shaper settings issues #762

Closed hobi82 closed 8 years ago

hobi82 commented 8 years ago

Just upgraded to 16.1.2 and used a config file from 15.7.17. Now the traffic shaper settings are empty in the GUI although Traffic Shaper Status in the GUI shows the limiters in place and working. Also "ipfw list" on the command line pops up the old config. Also I can't setup a new Traffic Shaper setting in the GUI (can't select bandwidth Metric, mask -> dropdown list is empty).

hobi82 commented 8 years ago

This might be related to issue: https://github.com/opnsense/core/issues/761 ... API access unauthorized

AdSchellevis commented 8 years ago

Are you using root here? or another user with a different ACL set?

hobi82 commented 8 years ago

Thanks for the prompt reply! I was/am using root. When I log in now (~24h later), the Traffic Shaper settings of my old config are displayed and the API gives a HTTP Status 200 OK back in the Firefox debugger for a GET on the API. When I try to change anything on the current settings or try to add a new dataset in there, it doesn't work. Nothing happens with the "Edit rule" popup, when I click on "Save changes". The Firefox debugger shows again HTTP 200 for the POST, but the changes are not taken over. The browser is not using any add-ons or extensions, it's pretty much a plain Firefox 44 on Linux Mint 17.3.

hobi82 commented 8 years ago

Maybe that helps: I re-ran the API URI shown in debugger and it brings back:

URI: https://opnsensebox/api/trafficshaper/settings/setPipe/3c84c489-2608-4e0c-b4fd-6a16daa2a50a

{"result":"failed"}

This is another interesting information from the Debugger. Don't know if the "direction" option is important or not, but you might get an idea out of it?:

https://opnsensebox/api/trafficshaper/settings/setPipe/3c84c489-2608-4e0c-b4fd-6a16daa2a50a

Response:

JSON:undefined result:"failed" validations:Object rules.rule.c02f5755-8581-4a0e-a4d8-8257dc9c2292.direction:"option not in list" rules.rule.abc3d150-dd74-4dcb-b981-73807d403efd.direction:"option not in list" rules.rule.37dd1989-c661-4358-9601-b48efd33ec45.direction:"option not in list" rules.rule.aed79142-6e4a-43ab-b3b2-465fc4da4b42.direction:"option not in list" rules.rule.38583d31-7017-4e5f-abc0-7503fbc59911.direction:"option not in list"

AdSchellevis commented 8 years ago

Thanks for your feedback, it's a regression in the last version caused by a change in the default "Required" model parameter.

This commit should fix it https://github.com/opnsense/core/commit/e342cd97e365b97a985db406fb6a9e720211e21f, if you want to test it out on your machine simply run:

curl -o /usr/local/opnsense/mvc/app/models/OPNsense/TrafficShaper/TrafficShaper.xml https://raw.githubusercontent.com/opnsense/core/master/src/opnsense/mvc/app/models/OPNsense/TrafficShaper/TrafficShaper.xml