Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse error with nginx when running insights-client #4116

Open
Tanjerine opened this issue Jun 8, 2024 · 0 comments
Open

Parse error with nginx when running insights-client #4116

Tanjerine opened this issue Jun 8, 2024 · 0 comments

Comments

@Tanjerine
Copy link

Tanjerine commented Jun 8, 2024

Hi,

Been running insights-client for awhile now with this error (though it doesn't seem to affect the data uploaded to the RH portal (as far as I know):

Traceback (most recent call last):
  File "/var/lib/insights/last_stable.egg/insights/core/plugins.py", line 170, in invoke
    r = self.component(d)
  File "/var/lib/insights/last_stable.egg/insights/parsers/nginx_conf.py", line 152, in __init__
    super(NginxConfPEG, self).__init__(*args, **kwargs)
  File "/var/lib/insights/last_stable.egg/insights/core/__init__.py", line 89, in __init__
    self._handle_content(context)
  File "/var/lib/insights/last_stable.egg/insights/core/__init__.py", line 92, in _handle_content
    self.parse_content(context.content)
  File "/var/lib/insights/last_stable.egg/insights/core/__init__.py", line 347, in parse_content
    self.doc = self.parse_doc(content)
  File "/var/lib/insights/last_stable.egg/insights/parsers/nginx_conf.py", line 158, in parse_doc
    raise ParseException("There was an exception when parsing the config file.")
insights.core.exceptions.ParseException: There was an exception when parsing the config file.

I can trace it to my nginx config file that has the ^# and #$ :

# Protect files and directories from prying eyes.
location ~* \.(engine|inc|install|make|module|profile|po|sh|.*sql|theme|twig|tpl(\.php)?|xtmpl|yml)(~|\.sw[op]|\.bak|\.orig|\.save)?$|^(\.(?!well-known).*|Entries.*|Repository|Root|Tag|Template|composer\.(json|lock)|web\.config)$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig|\.save)$ {
    deny all;
    return 404;
}

Any thoughts on how I can fix? When I run my config through nginx -t, I don't see any errors. So am at a loss. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant