[go: up one dir, main page]

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

certbot error on apache conf file with stringified JSON for SetEnv #7413

Open
tim-hogan opened this issue Sep 30, 2019 · 7 comments
Open

certbot error on apache conf file with stringified JSON for SetEnv #7413

tim-hogan opened this issue Sep 30, 2019 · 7 comments
Labels
area: apache bug priority: unplanned Work that we believe should be done, but does not have a higher priority.

Comments

@tim-hogan
Copy link

Certbot fails when an apache SetEnv command is used with stringified JSON.

Example line in .conf file:
SetEnv ENV_JSON {"abc":"val1","def":"val2"}

OS Version Linux 4.4.0-142-generic #168-Ubuntu SMP Wed Jan 16 21:00:45 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Installed Certbot with apt-get install certbot python-certbot-apache
Ran certbot with:
sudo certbot --apache

Error: The error was: PluginError('There has been an error in parsing the file /etc/apache2/sites-enabled/loc.nz.conf on line 101: Syntax error',)

@alexzorin
Copy link
Collaborator

While this is surely a bug because it does not match Apache's parser, you can work around it by single-quoting your JSON.

Here's a previous instance of this problem and the solution: https://community.letsencrypt.org/t/certbot-syntax-error-with-report-to-and-nel-header-in-apache-config/97940

@tim-hogan
Copy link
Author

alexzorin, thank for your reply, Yes I tried the single quotes, unfortunately my JSON parser then failed. My workaround is to regex the string before parsing, but ideally a fix in certbot.

@schoen
Copy link
Contributor
schoen commented Sep 30, 2019

It would be so great if the Apache project could publish a grammar for their configuration language!

@joohoi, are you an appropriate person to look at this at the moment and how would it interact with attempts to replace Certbot's parsing infrastructure?

@tim-hogan, thank you for the report, and @alexzorin, thank you for the diagnosis and forum reference.

@bmw bmw added priority: unplanned Work that we believe should be done, but does not have a higher priority. and removed priority: normal labels Mar 24, 2020
@github-actions
Copy link

We've made a lot of changes to Certbot since this issue was opened. If you still have this issue with an up-to-date version of Certbot, can you please add a comment letting us know? This helps us to better see what issues are still affecting our users. If there is no activity in the next 30 days, this issue will be automatically closed.

@tim-hogan
Copy link
Author

This is still a problem on version (0.31.0-2~deb10u1+ubuntu18.04.1+certbot+3)
The error is idenitical:
The error was: PluginError('There has been an error in parsing the file /etc/apache2/sites-enabled/test.nz.conf on line 12: Syntax error',)

Copy link

We've made a lot of changes to Certbot since this issue was opened. If you still have this issue with an up-to-date version of Certbot, can you please add a comment letting us know? This helps us to better see what issues are still affecting our users. If there is no activity in the next 30 days, this issue will be automatically closed.

@tim-hogan
Copy link
Author

This problem still exists on version 1.21.0
Regards
Tim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: apache bug priority: unplanned Work that we believe should be done, but does not have a higher priority.
Projects
None yet
Development

No branches or pull requests

4 participants