{"record":{"id":"4b08c0a49680a17b","repo":"netdata/netdata","slug":"missing-value-for-s-4b08c0","errorCode":null,"errorMessage":"missing value for %s\n","messagePattern":"missing value for (.+?)\n","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/collectors/network-viewer.plugin/network-viewer.c","lineNumber":7014,"sourceCode":"{\n    for(int i = 1; i < argc; i++) {\n        if(strcmp(argv[i], \"--test\") == 0 || strncmp(argv[i], \"--test=\", strlen(\"--test=\")) == 0)\n            return true;\n    }\n\n    return false;\n}\n\nstatic int network_viewer_set_required_option_once(const char **slot, const char *value, const char *option)\n{\n    if(*slot) {\n        fprintf(stderr, \"duplicate %s\\n\", option);\n        network_viewer_test_usage(stderr);\n        return 2;\n    }\n\n    if(!value || !*value) {\n        fprintf(stderr, \"missing value for %s\\n\", option);\n        network_viewer_test_usage(stderr);\n        return 2;\n    }\n\n    *slot = value;\n    return 0;\n}\n\nstatic int network_viewer_set_timeout_option_once(uint64_t *slot, bool *slot_set, const char *value)\n{\n    if(*slot_set) {\n        fprintf(stderr, \"duplicate --timeout\\n\");\n        network_viewer_test_usage(stderr);\n        return 2;\n    }\n\n    if(!value || !*value) {\n        fprintf(stderr, \"missing value for --timeout\\n\");","sourceCodeStart":6996,"sourceCodeEnd":7032,"githubUrl":"https://github.com/netdata/netdata/blob/4864de85e26f6734d92cfc27ccbeff5921f49938/src/collectors/network-viewer.plugin/network-viewer.c#L6996-L7032","documentation":"Emitted by the network-viewer.plugin test CLI when an option that requires a value is given with a NULL or empty value — typically `--test=` with nothing after the equals sign. The parser rejects it, prints usage, and exits with status 2.","triggerScenarios":"Passing `--test=`, or an option form where the value substring is missing/empty.","commonSituations":"Shell scripts interpolating an unset variable: `--test=${FUNC}` with FUNC empty; quoting errors that swallow the value.","solutions":["Supply the function name: `--test=network-viewer`","Default the variable first: `: \"${FUNC:=network-viewer}\"`"],"exampleFix":"# before\nnetwork-viewer.plugin --test=\n# after\nnetwork-viewer.plugin --test=network-viewer","handlingStrategy":"validation","validationCode":"case \"$1\" in --test=) echo 'empty --test value' >&2; exit 2;; esac\n: \"${FUNC:=network-viewer}\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass --test=<function> with a concrete name","Fail fast in wrappers when the interpolated function-name variable is empty"],"tags":["network-viewer","cli","argument-parsing","missing-value"],"backgroundTag":null,"analyzedSha":"4864de85e26f6734d92cfc27ccbeff5921f49938","analyzedAt":"2026-08-15T09:12:38.226Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}