certbot / certbot/certbot

Could not reverse map the HTTPS VirtualHost to the original when whitespace in End of File

Open
#9,156 17 comments 8 reactions 1 assignee Claimed by @bmw View on GitHub
area: apache bug priority: unplanned stale-needs-update
Dominant language
Python
Stars
33.2k
Forks
3.5k
Avg merge
6d 10h
Merged PRs (30d)
3

Description

Certbot throws "Could not reverse map the HTTPS VirtualHost to the original" when trying to parse a vhost file where the last lines after the closing tag are empty (newline) and/or contain a single space in one of those lines.

This error is really unspecific and i spent lots of time trying to fix it. Also the parser should be able to handle it better. There should be a more specific warning on what file and why its failing.

The Issue and resolving it can be found here https://community.letsencrypt.org/t/could-not-reverse-map-the-https-virtualhost-to-the-original/168559/5 but someone else ran into a similar issue earlier here https://community.letsencrypt.org/t/why-cant-i-certbot-d-toastmastervoice-com-and-create-a-new-virtualhost-and-certificate/131544

This seems to work

```

ServerName md.thorgerjansen.de
DocumentRoot /var/www/html/test

```
Something like this seems to fail (not sure anymore where the space was, just removed the tailing lines and it suddenly worked)
```

ServerName md.thorgerjansen.de
DocumentRoot /var/www/html/test

```

This error is really hard to find and debug and can be really frustrating. Thanks to the people over at community.letsencrypt i solved within 2h what i couldnt solve the day before.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.