#48·gixy

Crashes on config with lua options

Author: budnixCreated May 18, 2017Updated Dec 16, 2025
Labelsbug

I have custom nginx build with enabled support for lua (lua-nginx-module-0.10.0). I have declared a dynamic variable using set_by_lua_file $myvar and this can be an issue.

Part of my config

...
    set_by_lua_file $latest_ver conf/var_factory.lua;
...

Here's the stack trace

[context]	INFO	Can't find variable '1'
[context]	INFO	Can't find variable 'latest_ver'
[context]	INFO	Can't find variable 'latest_ver'
[context]	INFO	Can't find variable 'latest_ver'
Traceback (most recent call last):
  File "/usr/local/bin/gixy", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/gixy/cli/main.py", line 158, in main
    yoda.audit(path, fdata, is_stdin=False)
  File "/usr/local/lib/python2.7/dist-packages/gixy/core/manager.py", line 31, in audit
    self._audit_recursive(self.root.children)
  File "/usr/local/lib/python2.7/dist-packages/gixy/core/manager.py", line 46, in _audit_recursive
    self._audit_recursive(directive.children)
  File "/usr/local/lib/python2.7/dist-packages/gixy/core/manager.py", line 46, in _audit_recursive
    self._audit_recursive(directive.children)
  File "/usr/local/lib/python2.7/dist-packages/gixy/core/manager.py", line 46, in _audit_recursive
    self._audit_recursive(directive.children)
  File "/usr/local/lib/python2.7/dist-packages/gixy/core/manager.py", line 41, in _audit_recursive
    self._update_variables(directive)
  File "/usr/local/lib/python2.7/dist-packages/gixy/core/manager.py", line 56, in _update_variables
    for var in directive.variables:
  File "/usr/local/lib/python2.7/dist-packages/gixy/directives/directive.py", line 118, in variables
    for name, group in regexp.groups.items():
  File "/usr/local/lib/python2.7/dist-packages/cached_property.py", line 26, in __get__
    value = obj.__dict__[self.func.__name__] = self.func(obj)
  File "/usr/local/lib/python2.7/dist-packages/gixy/core/regexp.py", line 1004, in groups
    for name, parsed in extract_groups(self.parsed).items():
  File "/usr/local/lib/python2.7/dist-packages/gixy/core/regexp.py", line 1025, in parsed
    self._parsed = sre_parse.parse(FIX_NAMED_GROUPS_RE.sub('(?P<\\1>', self.source))
  File "/usr/local/lib/python2.7/dist-packages/gixy/core/sre_parse/sre_parse.py", line 707, in parse
    p = _parse_sub(source, pattern, 0)
  File "/usr/local/lib/python2.7/dist-packages/gixy/core/sre_parse/sre_parse.py", line 311, in _parse_sub
    itemsappend(_parse(source, state))
  File "/usr/local/lib/python2.7/dist-packages/gixy/core/sre_parse/sre_parse.py", line 666, in _parse
    p = _parse_sub(source, state)
  File "/usr/local/lib/python2.7/dist-packages/gixy/core/sre_parse/sre_parse.py", line 311, in _parse_sub
    itemsappend(_parse(source, state))
  File "/usr/local/lib/python2.7/dist-packages/gixy/core/sre_parse/sre_parse.py", line 644, in _parse
    raise error("bad character in group name")
gixy.core.sre_parse.sre_constants.error: bad c

Gixy v0.1.4