Opened 4 years ago
Closed 4 years ago
#1868 closed defect (invalid)
wildcard include failing with FormatMessage() error:(15100)
|Reported by:||Owned by:|
|uname -a:||Windows 10|
|nginx -V:||nginx version: nginx/1.17.4|
Hello, I have tried adding wildcards on windows with include like I do on linux and not sure why it fails
works correctly, while
f:\nginx>nginx -t nginx: [emerg] FindFirstFile() "e:/workspace/tools/*/.nginx.conf" failed (123: FormatMessage() error:(15100)) in f:\nginx/conf/nginx.conf:75 nginx: configuration file f:\nginx/conf/nginx.conf test failed
Maybe it's not supported, but haven't found this info listed in "Known limitations".
Help would be appreciated :)
Change History (3)
comment:1 by , 4 years ago
comment:2 by , 4 years ago
comment:3 by , 4 years ago
|Status:||new → closed|
The patch to improve error messages was committed, and will be available in the next release. The original problem, as already explained above, is a Windows limitation, not an nginx bug.
Note: See TracTickets for help on using tickets.
FindFirstFile()interface only support wildcards in a file name, but not directories. It is general limitation of file mask, and applies to all system tools. For example, here is
The "123" error is "The filename, directory name, or volume label syntax is incorrect", see here. Looks like you have no english language files on your system, and that's why
FormatMessage()cannot print text description. Unfortunately, the error code it returns does not match documented ERROR_RESOURCE_LANG_NOT_FOUND for some reason, hence nginx doesn't try to fallback to system default language. This probably can be improved, especially given that ERROR_MUI_FILE_NOT_FOUND error (15100) seems to be common enough, and my own testing suggests that it can also return ERROR_RESOURCE_TYPE_NOT_FOUND error (1813) if the language requested is not available. That is, falling back to the default language on all
FormatError()errors might be an option, patch below. It would be great if you'll test if it helps to get better error messages on your system.