Skip to content

Troubleshooting Guide

Use this guide to find why flowwler is not detecting, mitigating or measuring as expected. Start with the symptom list, check the Prometheus metric named in each entry, and read the logs only to confirm.

Symptom Section
Router sends traffic but no flows are counted No flows being detected
Rates are too high or too low BPS readings are wrong
Attack is not mitigated Mitigation does not activate at all
A rule stays at 0 A rule shows 0
SYN or RST rule counts far less than total TCP SYN and RST rules
Config load or reload fails on ports requires protocol 6 or 17
FlowSpec mitigation is active but no route is announced rule_not_expressible
Route announced but traffic keeps flowing Mitigation activates but traffic does not drop
Mitigation does not end HoldDown never expires
Customer subnets are not matched Group subnets are not being matched
Resource use is high High CPU or memory

Fix a problem by symptom

Find your symptom, then work through its checks in order. Each section starts with the most likely cause.

No flows being detected despite real traffic

Packets either do not reach flowwler, or they arrive but yield no flow records (usually a template timing issue). Check in this order:

  1. Check Prometheus: flowwler_router_bytes_decoded_total{protocol=~"netflow|netflow5|ipfix"} (netflow = v9, netflow5 = v5, ipfix = IPFIX, sflow = sFlow) - is it counting?

    • No: packets are not reaching flowwler. Check UDP routing and firewall (sudo ufw status). Confirm the router is sending to the correct IP and port. If netflow.exporter_allow or sflow.exporter_allow is set, datagrams from other sources are dropped (counted in flowwler_exporters_rejected_total).
    • Datagrams lost under bursts: flowwler logs could not set UDP receive buffer if the kernel refuses its 8 MiB request. Raise the cap with sudo sysctl -w net.core.rmem_max=8388608 and persist it in /etc/sysctl.d/.
    • Yes: packets arrive but no flow records result. Likely a template timing issue (step 3).
  2. Check for internal data loss: flowwler_aggregator_flow_channel_dropped_total and flowwler_aggregator_snapshot_channel_dropped_total

    • Non-zero and rising while flowwler_router_flows_received_total also increases: flows are decoded but flowwler cannot keep up and drops data. Usually the host is under-resourced for the flow volume (very high packet rate, a very large aggregation_window, or many unique 5-tuples).
  3. Check for template cache misses: flowwler_netflow_template_cache_misses_total

    • High and rising: data arrives before templates. Enable debug logging and look for "flow template stored". If absent, the router's template refresh interval is very long or templates go to a different collector.
  4. Enable debug logging (logging.level: debug in config, then sudo systemctl reload flowwler) and look for:

    • "flow template stored" - template received
    • "flow record dropped: no destination IP" - flows decoded but missing dst IP (template lacks key fields)
    • "flow data set skipped" - data arriving before template

BPS readings are wrong

The cause is a missing timing field when the rate is too high, and an unknown or wrong sampling rate when it is too low.

Too high (e.g., 10× actual rate):

  • Likely cause: the template lacks the FIRST_SWITCHED / LAST_SWITCHED fields (21/22). Enable debug logging and check whether 21 and 22 appear in the "field_type_ids" log line.
  • If absent: export the timing fields from the router, or reduce active-flow-timeout to 1-2 seconds.

Too low:

  • NetFlow: check flowwler_router_sampling_rate for the router. Absent means no packets received yet. 1 on a router sampling at 1:1000 means the rate is not learned yet; it arrives with the router's options template, which the router re-sends every option refresh interval (30 seconds in the Juniper example); a router with a long refresh interval takes that long. If the router never exports it, set netflow.default_sampling_rate to its 1-in-N ratio.
  • sFlow: compare sampling_rate in GET /api/v1/routers (or flowwler_router_sampling_rate) with the router's configured ratio. flowwler_sflow_counter_validation_ratio{router} near 1 means the estimate matches the polled counters; far from 1 suggests a wrong sampling rate or sampler. See Validating the sampling rate.
  • Check that flows are exported from all transit interfaces, not just one.

Mitigation does not activate at all

Either activation failed, which a metric shows, or the threshold was never met. No mitigation appears in GET /api/v1/mitigations or flowwler_mitigation_active for a victim that is clearly under attack.

  1. Check flowwler_mitigation_activation_failures_total{group,mitigation_type,reason}

    • reason="concurrent_limit": defaults.max_concurrent_mitigations has been reached — an existing mitigation must clear, or the limit be raised. Compare flowwler_mitigation_active summed across groups with the limit.
    • reason="activate_error": announcing the route failed. Enable debug logging and look for "mitigation activate failed" for the error.
    • reason="rule_not_expressible": the FlowSpec mitigation is active but announced no route. See Mitigation active but no FlowSpec route.
  2. If none of these is incrementing, the level's bps/pps threshold was probably never met. Check GET /api/v1/escalations for the victim's current phase and level, and compare against flowwler_group_bps/flowwler_group_pps or flowwler_rule_bps/flowwler_rule_pps.

A rule shows 0 in flowwler_rule_bps/flowwler_rule_pps although matching traffic exists

A flow record counts toward a rule only if it carries the data for every criterion the rule sets. If the exporter never sends a field, the rule stays at 0 and never triggers, with no warning.

  1. Check which criteria the rule uses: curl -s http://localhost:9731/api/v1/groups/<group>/rules.
  2. Compare them with what your exporter provides (Exporter data requirements):
    • tcp_flags with NetFlow v9/IPFIX needs template field 6; ICMP criteria need field 32 (ICMPv4) or, for ICMPv6, field 139 or fields 176-179.
    • fragments: true (non-first fragments only) never matches with NetFlow v5, v9 or standard IPFIX templates.
    • ICMP criteria match only protocol 1 on IPv4 and protocol 58 on IPv6; a protocol: 58 ICMP rule in an IPv4-only group (or protocol: 1 in an IPv6-only one) validates but never matches. flowwler warns at startup and after each reload: group "..." rule "...": protocol 58 never occurs in a group with only IPv4 prefixes; the rule cannot match. Add the missing prefixes to the group's subnets or change the rule's protocol.
    • Fragment routes for fragments: true have not been verified on all router platforms. If a router rejects or ignores one, test the rule on that platform.
    • pkt_len.max below the smallest packet of the rule's protocol is rejected at load; see PktLenRange.
    • With sFlow, the sampled header must be long enough to reach the field (TCP flags over IPv6: at least 68 bytes of frame).
  3. Check the template fields: enable debug logging and look for the "field_type_ids" list on the "flow template stored" line (see Router Configuration).
  4. Remove one criterion at a time (and reload) to find the one that filters everything out.
  5. Inspect real records with GET /api/v1/groups/{group}/rules/{rule}/samples. It shows only matched records, so query a broader rule of the same group (for example without the flag criterion). Samples lacking tcp_flags, icmp_type or non_first_fragment mean the exporter does not send that field. flags_semantics: or_over_flow marks flags that are the OR over a whole flow.

SYN and RST rules count only flagged packets: set thresholds accordingly

Set the pps threshold from measured values, not from total TCP traffic. A tcp_flags rule counts only TCP traffic with all listed flags set, so a [SYN] or [RST] rule ignores established traffic and its rate is far below the total TCP rate. Read flowwler_rule_pps for the rule during normal operation and during a known attack, and set the pps threshold from those values. NetFlow/IPFIX flags are the OR over a whole flow, so one record containing a SYN counts in full; sFlow judges each sampled packet by its own flags.

Config load or reload fails with requires protocol 6 or 17

Add the missing protocol to the rule. flowwler validate, startup or a reload reports group "g" rule "r" match.dst_ports requires protocol 6 or 17 (one rule per protocol; ports only exist for TCP and UDP) (or match.src_ports). The rule sets ports but no protocol: 6 or 17 (and no tcp_flags, which implies TCP). A rejected reload keeps the running config. Add the protocol; to cover both, write one rule per protocol (see DNS flood on TCP and UDP).

Mitigation active but no FlowSpec route (rule_not_expressible)

GET /api/v1/mitigations lists the FlowSpec mitigation, but GET /api/v1/flowspec/rules shows the victim with an empty rules list and flowwler_mitigation_activation_failures_total{reason="rule_not_expressible"} increased.

No matching source flows were visible at activation, and one of the rule's dst_ports, src_ports, icmp_types or icmp_codes lists has more than 5 entries. That is too long for a single route, so nothing is announced. The log line "flowspec: no source flows and rule not expressible as one route, announcing nothing" names the list.

  • The mitigation stays active. Per-source routes are announced within seconds once matching sources are visible, and a rules_updated notification follows.
  • To protect the victim from the first second, split the list into several rules of at most 5 entries each.
  • Sources stay invisible when records carry no source IP, or when the per-victim source limit is reached (flowwler_aggregator_keys_folded_total{kind="full"}).

Mitigation activates but traffic does not drop

The router most likely did not accept the BGP route. Check in this order:

  1. Check flowwler_mitigation_effectiveness - is it rising?

    • Near 0 after 2-3 minutes: the peer did not accept the BGP route. Check its import policy and community filtering.
    • Near 1: traffic is dropped at the router; what remains is background noise or new flows.
  2. Inspect BGP routes on the router peer (JunOS):

    show route receive-protocol bgp 192.0.2.100 show route protocol bgp community 65535:666

  3. Inspect flowwler's RIB via the REST API:

    bash curl -s http://localhost:9731/api/v1/bgp/routes

  4. Check the BGP session is established:

    bash curl -s http://localhost:9731/api/v1/bgp/peers curl -s http://localhost:9731/metrics | grep flowwler_bgp_peer_up

HoldDown never expires

This is expected while the attack continues.

The hold time is defaults.hold_time (default 15 minutes) or a per-level hold_time, for all mitigation types. If the victim triggers again before it expires, the hold time restarts. This is expected during an ongoing attack.

To shorten it for testing, set hold_time: 1m and send a SIGHUP.

ICMPv6 rules over IPFIX

icmp_types/icmp_codes rules with protocol: 58 match IPFIX data when the template carries field 139 or fields 176-179. If such a rule stays at 0, check the "field_type_ids" debug line and that the group has IPv6 prefixes.

Group subnets are not being matched

Check that the group is loaded and, for IRR or NetBox sources, that resolution succeeded.

  • Confirm the group is loaded: curl -s http://localhost:9731/api/v1/groups
  • Confirm flowwler_group_up{group="..."} is 1.
  • With IRR or NetBox, check that resolution succeeded: look for "irr: resolved prefixes" or "netbox: resolved prefixes" in the logs with a non-zero routes_v4/routes_v6 count.
  • Check flowwler_irr_last_refresh_timestamp_seconds / flowwler_netbox_last_refresh_timestamp_seconds - if absent or very old, the last resolution may have failed.

High CPU or memory

Three settings drive resource use:

  • A large aggregation_window with many unique sources uses memory in proportion to active flows times window depth.
  • Low sFlow sampling intervals (e.g. 1-in-100) generate many flow records per second; raise the interval on the router.
  • With large AS-SETs, reduce irr.concurrency to limit simultaneous WHOIS connections.

Read the log lines

All logs are structured JSON, one object per line. Use this section to decode what flowwler logged:

journalctl -u flowwler -f

Escalation events

{"level":"info","msg":"escalation: Idle→Active",
 "victim":"203.0.113.10","group":"datacenter-a","level":1,
 "mitigations":["flowspec"],"notification_only":false,
 "bps":5200000000,"pps":620000,"discard_bps":0}

An attack was detected and the level 1 mitigation (FlowSpec) activated. The router is not yet discarding anything (discard_bps:0).

{"level":"info","msg":"escalation: level up",
 "victim":"203.0.113.10","group":"datacenter-a",
 "prev_level":1,"level":2,"mitigations":["subnet-blackhole"],
 "notification_only":false,
 "bps":12000000000,"pps":1400000,"discard_bps":0}

The attack exceeded the level 2 threshold after escalate_after. FlowSpec was withdrawn and a subnet blackhole announced.

{"level":"info","msg":"escalation: Active→HoldDown",
 "victim":"203.0.113.10","group":"datacenter-a",
 "bps":180000,"pps":210,"discard_bps":11980000000}

Traffic fell below the threshold. The mitigation stays active for hold_time (default 15 minutes). A discard_bps near the earlier bps means the router is dropping almost all remaining traffic.

{"level":"info","msg":"escalation: →Idle (hold-down expired)",
 "victim":"203.0.113.10","group":"datacenter-a","rule":""}

The hold time expired and the mitigation was withdrawn.

BGP events

{"level":"info","msg":"bgp: blackhole announced","victim":"203.0.113.10"}
{"level":"info","msg":"bgp: startup cleanup complete","paths_withdrawn":3}

Stale routes from a previous crash were removed on startup.

Decode warnings

{"level":"warn","msg":"flow decode error",
 "router":"10.0.0.1","protocol":"netflow",
 "error":"netflow: unsupported version 7 (want 5, 9, or 10)"}

The router exports an unsupported NetFlow version. NetFlow v5, v9 and IPFIX are all accepted on the same listener; configure one of them.

{"level":"debug","msg":"flow data set skipped: template not cached yet",
 "router":"10.0.0.1","protocol":"netflow","domain_id":100,"template_id":256}

Normal at startup. It stops once the router sends its templates. That takes at most one template refresh interval, which is set on the router (30 seconds in the Juniper example).

IRR / NetBox prefix resolution

{"level":"info","msg":"irr: resolving prefixes","group":"customers","as_set":"AS64500:AS-CUSTOMERS"}
{"level":"info","msg":"irr: resolved prefixes","group":"customers","asns":47,"routes_v4":312,"routes_v6":89,"duration":4.2}

Normal. If routes_v4 and routes_v6 are both 0, the AS-SET may be empty or the WHOIS server unreachable.

{"level":"warn","msg":"irr: ASN query failed, retrying","asn":"AS60735","error":"read tcp ... connection reset by peer"}

The WHOIS server rate-limited or dropped the connection. flowwler retries once. If that also fails (irr: ASN query failed after retry), the group's resolution fails with N of M ASN prefix queries failed:

  • Reload: rejected, old config kept.
  • Scheduled refresh: previous prefixes kept.
  • Startup: continues with static subnets only.

If this is frequent, reduce concurrency in the irr: block.