Opened 5 years ago
Closed 5 years ago
#1868 closed defect (invalid)
wildcard include failing with FormatMessage() error:(15100)
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | nginx-core | Version: | 1.17.x |
Keywords: | Cc: | ||
uname -a: | Windows 10 | ||
nginx -V: | nginx version: nginx/1.17.4 |
Description
Hello, I have tried adding wildcards on windows with include like I do on linux and not sure why it fails
include e:/workspace/tools/pma-slack/.nginx.conf;
works correctly, while
include e:/workspace/tools/*/.nginx.conf;
fails with:
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 , 5 years ago
comment:3 by , 5 years ago
Resolution: | → invalid |
---|---|
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.
On Windows,
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 isdir
command output: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 allFormatError()
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.