[nginx_parser] ERROR
ludovicsclain opened this issue · comments
Hi 👋
Gixy just installed and tested and I have a NGINX-PARSER error on all my .conf file:
[nginx_parser] ERROR Failed to parse config "/etc/nginx/nginx.conf": char 272 (line:3, col:1)
[nginx_parser] ERROR Failed to parse config "/etc/nginx/sites-available/my-website.conf": char 269 (line:4, col:1)
So are the results reliables (I have no issue)?
Thanks for your help 🙏
[my OS is MacOS Monterey]
Seems it's popular buggy report.
You will be asked for config example you not able to pass, if you check [nginx_parser] issues here.
Here is my so called buggy one:
upstream service-backend {
server backend:80;
}
server {
listen 80;
server_name localhost;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri /index.html;
}
location /api {
proxy_pass http://ccm-backend;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Server-Proto $server_protocol;
}
}
And the problem is not in upstream name, it can be just an address or name,
it seems ngx_http_upstream_module is not something acceptable here.
If I do remove upstream completely, the error will change to
WARNING Skip unparseable block: "server"
And if I will take next example:
server {
listen 80;
server_name localhost;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri /index.html;
}
}
...it will also fail with warning.
I did try to change py version (2.7.17, 3.7.12) but it did not changed anything.
Wat I suppose to try - run it in a Docker image.
It's broken with pyparsing > 2.4.7 so you need to use pyparsing 2.4.7.
It's broken with pyparsing > 2.4.7 so you need to use pyparsing 2.4.7.
@thestinger can you guide us how?
I gave you a working workaround. There's nothing else beyond that.
Thanks @thestinger. For a few minutes I was not sure how to do this, then it became clear that it would be as simple as manually installing the version of pyparsing.
pip install gixy==0.1.20 pyparsing==2.4.7
This should really work out-of-the-box. Is there a clear explanation for why it doesn't (e.g. that I have a atypical config)?
My config starts with:
upstream backend {
server 127.0.0.1:8080;
}
Fastest "fix" for me was:
pip uninstall pyparsing
pip install pyparsing==2.4.7
@Darthfett pyparsing made backwards incompatible changes and unfortunately gixy isn't being actively developed at the moment.
Understood. Backwards incompatible changes in a non-major release is unfortunate. Opened PR 140 to address it.
@Darthfett It was in a major release. It's pyparsing v3 and beyond that breaks it.