Certbot Could not parse NGINX server block because char 0 at line 1 is the "s" in "server"

Ok, so upgrading Certbot changed this error:

To this error:

That slight difference: stringEnd to string_end made all the difference.

A quick search for the new error code brought up this posting from a few years ago:

In that posting, the parsing error was attributed to commented out directives.

I suggest trying the following:

1- standardize all the comments - line the # up with the block indents and ensure there is one space after. e.g. # comment not #comment or # comment

2- if that doesn't work, try deleting the commented-out directives that span multiple lines first; then try the single lines

that should pinpoint what is causing the parsing error and allow you to file a bug report.

4 Likes