{"record":{"id":"3c13299302b567c5","repo":"netdata/netdata","slug":"warning-no-configuration-file-has-been-loaded-us","errorCode":null,"errorMessage":"warning: no configuration file has been loaded. Use -c CONFIG_FILE, before -W get. Using default config.\\n","messagePattern":"warning: no configuration file has been loaded\\. Use -c CONFIG_FILE, before -W get\\. Using default config\\.\\\\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/daemon/main.c","lineNumber":909,"sourceCode":"                            // variables at netdata.conf\n                            inicfg_set_default_raw_value(tmp_config, section, key, value);\n\n                            // fprintf(stderr, \"SET section '%s', key '%s', value '%s'\\n\", section, key, value);\n                        }\n                        else if(strcmp(optarg, \"get\") == 0) {\n                            if(optind + 3 > argc) {\n                                fprintf(stderr, \"%s\", \"\\nUSAGE: -W get 'section' 'key' 'value'\\n\\n\"\n                                        \" Prints settings of netdata.conf.\\n\"\n                                        \"\\n\"\n                                        \" These options interact with: -c netdata.conf\\n\"\n                                        \" -c netdata.conf has to be given before -W get.\\n\"\n                                        \"\\n\"\n                                );\n                                return 1;\n                            }\n\n                            if(!config_loaded) {\n                                fprintf(stderr, \"warning: no configuration file has been loaded. Use -c CONFIG_FILE, before -W get. Using default config.\\n\");\n                                netdata_conf_load(NULL, 0, &user);\n                            }\n\n                            netdata_conf_section_global();\n\n                            const char *section = argv[optind];\n                            const char *key = argv[optind + 1];\n                            const char *def = argv[optind + 2];\n                            const char *value = inicfg_get(&netdata_config, section, key, def);\n                            printf(\"%s\\n\", value);\n                            return 0;\n                        }\n                        else if(strcmp(optarg, \"get2\") == 0) {\n                            if(optind + 4 > argc) {\n                                fprintf(stderr, \"%s\", \"\\nUSAGE: -W get2 'conf_file' 'section' 'key' 'value'\\n\\n\"\n                                        \" Prints settings of netdata.conf or cloud.conf\\n\"\n                                        \"\\n\"\n                                        \" These options interact with: -c netdata.conf\\n\"","sourceCodeStart":891,"sourceCodeEnd":927,"githubUrl":"https://github.com/netdata/netdata/blob/4864de85e26f6734d92cfc27ccbeff5921f49938/src/daemon/main.c#L891-L927","documentation":"Warning emitted by the '-W get' handler when no configuration file was loaded (the config_loaded flag is false) before the -W get option was processed. It is non-fatal: netdata_conf_load(NULL, 0, &user) then loads the default configuration (built-in defaults, possibly the default /etc/netdata/netdata.conf path), so the printed value may reflect defaults rather than your actual file.","triggerScenarios":"Running 'netdata -W get section key default' without a preceding '-c CONFIG_FILE' on the same command line. Because getopt processes options in order and -W get executes immediately during parsing, a '-c' appearing AFTER '-W get' on the command line has not been processed yet and does not count.","commonSituations":"Checking an option before loading the config in scripts; placing -c netdata.conf after the -W get tokens; running in an environment where /etc/netdata/netdata.conf does not exist so even the fallback load finds nothing and built-in defaults are printed.","solutions":["Put -c BEFORE -W get: netdata -c /etc/netdata/netdata.conf -W get global history 3600","Verify the config file path exists and is readable","Treat this warning as a signal that the value shown may be a default, not your configured value","If the file is elsewhere (e.g. custom install prefix), pass its full path to -c"],"exampleFix":"# before\nnetdata -W get global history 3600 -c /etc/netdata/netdata.conf\n# after\nnetdata -c /etc/netdata/netdata.conf -W get global history 3600","handlingStrategy":"validation","validationCode":"# bash: guarantee a config is loaded before the read\ncfg=/etc/netdata/netdata.conf\n[ -r \"$cfg\" ] || { echo \"config not readable: $cfg\" >&2; exit 1; }\nnetdata -c \"$cfg\" -W get global history 3600","typeGuard":null,"tryCatchPattern":"out=$(netdata -W get global history 3600 2>&1 >/dev/null); case \"$out\" in *warning:*no\\ configuration*) echo \"default config in use\" >&2;; esac","preventionTips":["Always order -c before -W get on the command line","Check the config file exists at the path you pass","When this warning appears, treat the printed value as a default, not your configured value"],"tags":["cli","netdata-conf","option-ordering","configuration"],"backgroundTag":null,"analyzedSha":"4864de85e26f6734d92cfc27ccbeff5921f49938","analyzedAt":"2026-08-15T09:12:38.226Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}