{"record":{"id":"f55b1ad442c91672","repo":"nginx/nginx","slug":"s-in-s-ui","errorCode":null,"errorMessage":"%*s in %s:%ui","messagePattern":"%\\*s in (.+?):%ui","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/core/ngx_conf_file.c","lineNumber":1019,"sourceCode":"    p = ngx_vslprintf(errstr, last, fmt, args);\n    va_end(args);\n\n    if (err) {\n        p = ngx_log_errno(p, last, err);\n    }\n\n    if (cf->conf_file == NULL) {\n        ngx_log_error(level, cf->log, 0, \"%*s\", p - errstr, errstr);\n        return;\n    }\n\n    if (cf->conf_file->file.fd == NGX_INVALID_FILE) {\n        ngx_log_error(level, cf->log, 0, \"%*s in command line\",\n                      p - errstr, errstr);\n        return;\n    }\n\n    ngx_log_error(level, cf->log, 0, \"%*s in %s:%ui\",\n                  p - errstr, errstr,\n                  cf->conf_file->file.name.data, cf->conf_file->line);\n}\n\n\nchar *\nngx_conf_set_flag_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)\n{\n    char  *p = conf;\n\n    ngx_str_t        *value;\n    ngx_flag_t       *fp;\n    ngx_conf_post_t  *post;\n\n    fp = (ngx_flag_t *) (p + cmd->offset);\n\n    if (*fp != NGX_CONF_UNSET) {\n        return \"is duplicate\";","sourceCodeStart":1001,"sourceCodeEnd":1037,"githubUrl":"https://github.com/nginx/nginx/blob/3f6f7824d4e2eb1ac37dec76683d525ac0ff521c/src/core/ngx_conf_file.c#L1001-L1037","documentation":"Location suffix that ngx_conf_log_error() appends to every configuration error raised while a config file is open: it prints the already-formatted error text followed by ' in <config-file>:<line>'. Before the config file is open the bare text is logged, and for errors that come from command-line arguments ('nginx -g ...') it prints 'in command line' instead. Seeing this message means a directive-level error was detected and nginx is pointing at the exact file and line to fix.","triggerScenarios":"Any directive handler calling ngx_conf_log_error() during parsing of nginx.conf or an included file: unknown directive, wrong argument count, invalid value, duplicate directive, failed include, module init failure. Appears at startup, at reload, and in 'nginx -t' output.","commonSituations":"Typos in directive names or values; a missing semicolon that makes the parser fail on the line after the real mistake; editing included files (conf.d/*.conf) and misreading which file:line the error names; errors from systemd 'ExecStart=... -g' options reported as 'in command line'.","solutions":["Open the exact file:line named at the end of the message and fix the problem named at the start of the message","If the named line looks valid, inspect the preceding lines for a missing semicolon or unclosed quote - the parser often fails on the line after the actual mistake","Run 'nginx -t' after fixing to confirm the whole include tree parses before reloading","For messages ending in 'in command line', fix the string passed to 'nginx -g' or the systemd unit's -g option, not a file"],"exampleFix":"# before: nginx: [emerg] unknown directive \"worker_process\" in /etc/nginx/nginx.conf:3\nworker_process 2;\n# after\nworker_processes 2;","handlingStrategy":"validation","validationCode":"nginx -t   # parse the full config tree (all includes) before any reload\nnginx -T 2>/dev/null | grep -n 'worker_process '   # locate the offending line in the effective config","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run 'nginx -t' in CI and in deploy scripts before every 'nginx -s reload'","Split large configs into includes so file:line attribution stays precise","Treat messages ending in 'in command line' as coming from 'nginx -g' options, not from files"],"tags":["nginx","configuration","parse-error","file-location","startup"],"backgroundTag":"config-parse-error","analyzedSha":"3f6f7824d4e2eb1ac37dec76683d525ac0ff521c","analyzedAt":"2026-08-22T03:09:46.447Z","schemaVersion":2},"datasetVersion":"2026-08-22T04:17:13.399Z"}