gixy icon indicating copy to clipboard operation
gixy copied to clipboard

[nginx_parser] WARNING Skip unparseable block: "http"

Open Frodox opened this issue 6 years ago • 1 comments

Gixy v0.1.20 failes with message [nginx_parser] WARNING Skip unparseable block: "http" on config like

    log_format json escape=json ''
        '{ "@timestamp": "$time_iso8601", '
...
# problem line:
        '"any_variable": "any-value", ' # header "Location" received from upstream (in case of redirect)
...
        '"upstream_status": "$upstream_status" '
        '}';

and after tests:

# gixy -d nginx.conf
[main]	DEBUG	logging initialized
[manager]	DEBUG	Audit config file: /etc/nginx/nginx.conf
[nginx_parser]	WARNING	Skip unparseable block: "http"

==================== Results ===================
No issues found.

==================== Summary ===================
Total issues:
    Unspecified: 0
    Low: 0
    Medium: 0
    High: 0

if I using line like '"any_variable": "any-value", ' # header "Location" received from upstream in case of redirect or '"any_variable": "any-value", ' # header "Location" received from upstream (redirect)

all works fine. Problems with parser:

  • it parses comments (but it shouldn't)
  • it failes to parse comment like (two or more words in braces)

Frodox avatar Sep 17 '19 10:09 Frodox

@Frodox I've resolved this in my actively maintained fork dvershinin/gixy (available on PyPI as gixy-ng).

The fork has migrated from pyparsing to crossplane for nginx config parsing. Crossplane correctly handles comments with parentheses and other edge cases that caused the "Skip unparseable block" warnings.

Install with: pip install gixy-ng

dvershinin avatar Dec 16 '25 04:12 dvershinin