mbolli/nfsen-ng

503 error on subnet aggregation with missing prefix length

candlerb opened this issue · 5 comments

(Expansion of issue from #31) This is a minor usability / data validation issue. To reproduce:

  • Go to Graphs tab, select last 24 hours
  • Go to Flows tab
  • Under IP Aggregation > Source select "IPv4 subnets", but leave the prefix length empty
  • Click Process Data

Result is a red 503 error:

image

Got 503 - Service unavailable. NfDump: Initialization failed. /usr/local/bin/nfdump -M '/var/nfsen/profiles-data/live/gw' -R '2020/06/11/nfcapd.202006110810:2020/06/12/nfcapd.202006120805' -c '20' -o 'csv' -a '-Asrcip4' 2>&1

The problem is fixed if you type (say) "24" in the prefix length box.

I think the issues are:

  • if nfsen-ng shows grey "/24" in the box, the user assumes that /24 is already taken as default
  • if you type "/24" it fails since this is only a 2-digit box; then you realise you have to enter "24"

I think it would be better if the slash were moved out of the selection boxes:

      [ IPv4 Subnets     ] / [   ]

The box can display a grey "24" (making it clearer what the user is expected to enter here). Then if the user leaves this blank, 24 can be supplied to the backend.

Fixed in 5f2702e. When I find a way to add the slash as a "watermark" in the input field, I will do so.

How about you just put a literal slash character in front of the input box?

This messes with the grid system and puts the subnet input box on the next line.

WFM if I reduce width: 30% to width: 25% on the prefix box, and insert

<div class="pull-left" style="width: 5%; font-size: 170%; text-align: center;">/</div>

before it.

image

managed to do it in the input field :) thanks anyway.