Repository: certbot/certbot

Issue:
standalone_supported_challenges value from private beta causes renewal failures
I am using a Apache and ran ./letsencrpt-auto renew 

`2016-05-05 07:36:46,390:INFO:letsencrypt.renewal:updating legacy http01_port value
2016-05-05 07:36:46,390:WARNING:letsencrypt.renewal:Renewal configuration file /etc/letsencrypt/renewal/XXXXXX.conf produced an unexpected error: Unrecognized challenges: dvsni. Skipping.
2016-05-05 07:36:46,390:DEBUG:letsencrypt.renewal:Traceback was:
Traceback (most recent call last):
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt/renewal.py", line 325, in renew_all_lineages
    renewal_candidate = _reconstitute(lineage_config, renewal_file)
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt/renewal.py", line 80, in _reconstitute
    _restore_plugin_configs(config, renewalparams)
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt/renewal.py", line 155, in _restore_plugin_configs
    setattr(config.namespace, config_item, cast(config_value))
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt/plugins/standalone.py", line 127, in supported_challenges_validator
    "Unrecognized challenges: {0}".format(", ".join(unrecognized)))
ArgumentTypeError: Unrecognized challenges: dvsni

2016-05-05 07:36:46,391:DEBUG:letsencrypt.main:Exiting abnormally:
Traceback (most recent call last):
  File "/root/.local/share/letsencrypt/bin/letsencrypt", line 11, in <module>
    sys.exit(main())
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt/main.py", line 692, in main
    return config.func(config, plugins)
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt/main.py", line 538, in renew
    renewal.renew_all_lineages(config)
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt/renewal.py", line 355, in renew_all_lineages
    renew_skipped, parse_failures)
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt/renewal.py", line 290, in _renew_describe_results
    notify(parse_failures, "parsefail")
TypeError: append() takes exactly one argument (2 given)
`

standalone_supported_challenges value from private beta causes renewal failures
I am using a Apache and ran ./letsencrpt-auto renew 

`2016-05-05 07:36:46,390:INFO:letsencrypt.renewal:updating legacy http01_port value
2016-05-05 07:36:46,390:WARNING:letsencrypt.renewal:Renewal configuration file /etc/letsencrypt/renewal/XXXXXX.conf produced an unexpected error: Unrecognized challenges: dvsni. Skipping.
2016-05-05 07:36:46,390:DEBUG:letsencrypt.renewal:Traceback was:
Traceback (most recent call last):
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt/renewal.py", line 325, in renew_all_lineages
    renewal_candidate = _reconstitute(lineage_config, renewal_file)
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt/renewal.py", line 80, in _reconstitute
    _restore_plugin_configs(config, renewalparams)
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt/renewal.py", line 155, in _restore_plugin_configs
    setattr(config.namespace, config_item, cast(config_value))
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt/plugins/standalone.py", line 127, in supported_challenges_validator
    "Unrecognized challenges: {0}".format(", ".join(unrecognized)))
ArgumentTypeError: Unrecognized challenges: dvsni

2016-05-05 07:36:46,391:DEBUG:letsencrypt.main:Exiting abnormally:
Traceback (most recent call last):
  File "/root/.local/share/letsencrypt/bin/letsencrypt", line 11, in <module>
    sys.exit(main())
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt/main.py", line 692, in main
    return config.func(config, plugins)
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt/main.py", line 538, in renew
    renewal.renew_all_lineages(config)
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt/renewal.py", line 355, in renew_all_lineages
    renew_skipped, parse_failures)
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt/renewal.py", line 290, in _renew_describe_results
    notify(parse_failures, "parsefail")
TypeError: append() takes exactly one argument (2 given)
`



Discussion:
This is actually a combination of two problems, corresponding to the two tracebacks you posted.

The first one we actually haven't seen before, so thank you very much for taking the time to report it. The value for `standalone_supported_challenges` in your renewal config file is from our private beta and is no longer valid. We'll look into adding a fix for this, but in the meantime, I can tell you how to work around the problem.

You said you're using Apache, as long as you're not using the standalone plugin you can simply delete the `standalone_supported_challenges = ...` line from your renewal configuration file. If you are using the standalone plugin, you should replace the string "dvsni" with "tls-sni-01".

The second traceback, which is an error with how `letsencrypt` reports fatal errors during renewal, is a known problem (#2822). The fix for this will be included in our next release, but fixing the standalone problem I described above should fix your issue. Please let me know if you have any more trouble.

This is actually a combination of two problems, corresponding to the two tracebacks you posted.

The first one we actually haven't seen before, so thank you very much for taking the time to report it. The value for `standalone_supported_challenges` in your renewal config file is from our private beta and is no longer valid. We'll look into adding a fix for this, but in the meantime, I can tell you how to work around the problem.

You said you're using Apache, as long as you're not using the standalone plugin you can simply delete the `standalone_supported_challenges = ...` line from your renewal configuration file. If you are using the standalone plugin, you should replace the string "dvsni" with "tls-sni-01".

The second traceback, which is an error with how `letsencrypt` reports fatal errors during renewal, is a known problem (#2822). The fix for this will be included in our next release, but fixing the standalone problem I described above should fix your issue. Please let me know if you have any more trouble.


Resolving patch:
diff --git a/certbot/plugins/standalone.py b/certbot/plugins/standalone.py
--- a/certbot/plugins/standalone.py
+++ b/certbot/plugins/standalone.py
@@ -120,6 +120,14 @@ def supported_challenges_validator(data):
 
     """
     challs = data.split(",")
+
+    # tls-sni-01 was dvsni during private beta
+    if "dvsni" in challs:
+        logger.info("Updating legacy standalone_supported_challenges value")
+        challs = [challenges.TLSSNI01.typ if chall == "dvsni" else chall
+                  for chall in challs]
+        data = ",".join(challs)
+
     unrecognized = [name for name in challs
                     if name not in challenges.Challenge.TYPES]
     if unrecognized:


Test patch:
diff --git a/certbot/plugins/standalone_test.py b/certbot/plugins/standalone_test.py
--- a/certbot/plugins/standalone_test.py
+++ b/certbot/plugins/standalone_test.py
@@ -85,6 +85,11 @@ def test_unrecognized(self):
     def test_not_subset(self):
         self.assertRaises(argparse.ArgumentTypeError, self._call, "dns")
 
+    def test_dvsni(self):
+        self.assertEqual("tls-sni-01", self._call("dvsni"))
+        self.assertEqual("http-01,tls-sni-01", self._call("http-01,dvsni"))
+        self.assertEqual("tls-sni-01,http-01", self._call("dvsni,http-01"))
+
 
 class AuthenticatorTest(unittest.TestCase):
     """Tests for certbot.plugins.standalone.Authenticator."""