Skip to content

serverInternal :: The server experienced an internal error :: Error creating new authz #503

Closed

Description

@GabLeRoux

Hey there, letsencrypt seems awesome so I wanted to give this a try after reading this nice overview :)

Installed client on Ubuntu 14.04.1 LTS (GNU/Linux 3.11.0-12-generic x86_64) with nginx

nginx version: nginx/1.4.6 (Ubuntu)
built by gcc 4.8.2 (Ubuntu 4.8.2-19ubuntu1)
TLS SNI support enabled

Using these commands:

git clone https://github.com/letsencrypt/lets-encrypt-preview.git
cd lets-encrypt-preview
./bootstrap/ubuntu.sh
virtualenv --no-site-packages -p python2 venv
./venv/bin/pip install -r requirements.txt

Went all smoothly, than ran

sudo ./venv/bin/letsencrypt --help

All seems ok so I tried

sudo ./venv/bin/letsencrypt auth

How would you like to authenticate with Let's Encrypt CA?
2 Nginx Web Server (nginx)

Please enter in your domain name(s) (comma and/or space separated)
<snip> (Entered my domain here, example.com format)

ERROR:root:Error: {u'type': u'urn:acme:error:serverInternal', u'detail': u'Error creating new authz'}
 Error: {u'type': u'urn:acme:error:serverInternal', u'detail':
u'Error creating new authz'}
Response from server:
{"type":"urn:acme:error:serverInternal","detail":"Error creating
new authz"}
Traceback (most recent call last):
  File "./venv/bin/letsencrypt", line 9, in <module>
    load_entry_point('letsencrypt==0.1', 'console_scripts', 'letsencrypt')()
  File "/root/lets-encrypt-preview/letsencrypt/cli.py", line 406, in main
    return args.func(args, config, plugins)
  File "/root/lets-encrypt-preview/letsencrypt/cli.py", line 133, in auth
    plugins):
  File "/root/lets-encrypt-preview/letsencrypt/client.py", line 206, in obtain_and_enroll_certificate
    cert, privkey, chain = self.obtain_certificate(domains, csr)
  File "/root/lets-encrypt-preview/letsencrypt/client.py", line 154, in obtain_certificate
    authzr = self.auth_handler.get_authorizations(domains)
  File "/root/lets-encrypt-preview/letsencrypt/auth_handler.py", line 69, in get_authorizations
    domain, self.account.new_authzr_uri)
  File "/root/lets-encrypt-preview/letsencrypt/network2.py", line 333, in request_domain_challenges
    typ=messages2.IDENTIFIER_FQDN, value=domain), new_authz_uri)
  File "/root/lets-encrypt-preview/letsencrypt/network2.py", line 314, in request_challenges
    response = self._post(new_authzr_uri, new_authz)
  File "/root/lets-encrypt-preview/letsencrypt/network2.py", line 179, in _post
    self._check_response(response, content_type=content_type)
  File "/root/lets-encrypt-preview/letsencrypt/network2.py", line 101, in _check_response
    raise messages2.Error.from_json(jobj)
acme.messages2.Error: serverInternal :: The server experienced an internal error :: Error creating new authz

I know it's a preview, is letsencrypt server ready or am-I doing something wrong?
Thanks and nice work btw

Activity

  1. kuba commented on Jun 15, 2015

    @kuba
    Contributor

    Hey, thanks for report. This is likely because you supplied fake email address (DNS MX lookup failed) or the domain being authenticated does not resolve to any host. In fact, I've seen some SERVFAIL errors in the demo instance logs around the time you reported this issue... it'd be a lot easier to debug if you give actually used domain name :)

    Nevertheless, the message is not helpful at all, agreed! This is currently being looked at in letsencrypt/boulder#344 (and fixup PR letsencrypt/boulder#354).

    Maybe client should perform DNS lookups in case of errors, not to rely much on server response? @BradMW?

  2. berenddeschouwer commented on Jun 15, 2015

    @berenddeschouwer

    I'm getting this error too.

    I'm using a real mail address.

    Before the host could resolve, I was getting a different error. (see # 246), so I'm pretty sure it can resolve now.

  3. kuba commented on Jun 15, 2015

    @kuba
    Contributor

    Yup, I've seen your request coming through, @berenddeschouwer:

    2015/06/15 12:16:17 [AUDIT] Internal error - Error creating new authz - read udp 8.8.8.8:53: i/o timeout
    ...
    2015/06/15 12:20:16 [AUDIT] Internal error - Error creating new authz - Invalid response code: 2-SERVFAIL
    

    DNS lookup timeout value has been increased, please try again.

  4. berenddeschouwer commented on Jun 15, 2015

    @berenddeschouwer

    Still fails. It takes about 10 seconds to give a response.

    I think it takes longer than before; but this might be my imagination :)

    I can do lookups (and type=mx) on 8.8.8.8; but Google does host that IP in different locations.

  5. kuba commented on Jun 15, 2015

    @kuba
    Contributor

    It looks like a server bug and I've already notified Boulder devs (mind that they're likely asleep now). Please come around to #letsencrypt@Freenode if you'd like to debug with me a bit more.

  6. GabLeRoux commented on Jun 15, 2015

    @GabLeRoux
    Author

    Oh thanks for you quick replies, the domain I used is totemastudio.com https://who.is/whois/totemastudio.com

    Mail server is not the same as the one hosting the website, I did provide a valid email at first.
    @kuba I just logged in on #letsencrypt@Freenode

  7. jonathannoah commented on Jun 16, 2015

    @jonathannoah

    I'm having the same issue as @GabLeRoux on Ubuntu 14.04, nginx 1.8.0, using a valid public domain (jn1.me) and correctly MX'd email.

  8. rolandshoemaker commented on Jun 16, 2015

    @rolandshoemaker
    Member

    re: @GabLeRoux & @jonathannoah: This is caused by an upstream problem at Cloudflare's DNS servers which breaks CAA validation -- their servers reply with the REFUSED RCODE to certain RR queries, e.g.

    $ dig jn1.me -t TYPE257 @lucy.ns.cloudflare.com                                                                                                                                                         (allow-simplehttp) 
    
    ; <<>> DiG 9.9.5-3ubuntu0.2-Ubuntu <<>> jn1.me -t TYPE257 @lucy.ns.cloudflare.com
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: REFUSED, id: 63785
    ;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
    ;; WARNING: recursion requested but not available
    
    ;; OPT PSEUDOSECTION:
    ; EDNS: version: 0, flags:; udp: 512
    ;; QUESTION SECTION:
    ;jn1.me.                IN  TYPE257
    
    ;; Query time: 15 msec
    ;; SERVER: 173.245.58.133#53(173.245.58.133)
    ;; WHEN: Mon Jun 15 17:37:33 PDT 2015
    ;; MSG SIZE  rcvd: 35
    

    Googles public DNS resolver (at 8.8.8.8) will then replace REFUSED with SERVFAIL, which somewhat obscures the problem at the server end. We are currently in contact with Cloudflare to see if they can add support for CAA (TYPE257) records. In the meantime I'm looking into a few possible workarounds...

    re @berenddeschouwer: Your problem seems to be caused by the DNS server that ducksdns.org is using, XBILL jnamed, which has some very strange behaviors that cause validation failures at Googles resolver (for good reason). Side note: _jnamed_s README provides this great extract...

    jnamed should not be used for production, and should probably
    not be used for testing.  If the above documentation is not enough,
    please do not ask for more, because it really should not be used.
    
  9. berenddeschouwer commented on Jun 16, 2015

    @berenddeschouwer

    OK, looking for an alternate provider. Are there any specific tests I should perform?

  10. dequis commented on Jun 16, 2015

    @dequis

    Hey, getting the same traceback, but might be worth highlighting the way it crashes. It looks awful.

    The dialog shows the json (which sounds like it handles the error just fine?) and then it throws that exception that no one handles.

    I've done sudo ./venv/bin/letsencrypt auth, left email empty (it said it's optional), selected standalone authenticator, entered test.dequis.org as domain. Failed the first two attempts, after deleting /etc/letsencrypt the third attempt got through edit nevermind it just asked me to accept the 'this is a preview' dialog, and then it failed.

  11. GabLeRoux commented on Jun 17, 2015

    @GabLeRoux
    Author

    @dequis thanks for your feedback, it's indeed worth mentionning this. I had the same ugly output ;)

  12. GabLeRoux commented on Jun 19, 2015

    @GabLeRoux
    Author

    I tested again with same configuration and as mentioned in #507 error message changed for this:

    ERROR:root:Error: {u'type': u'urn:acme:error:malformed', u'detail': u'Unable to read/verify body'}
    ERROR:root:Response from server: {"type":"urn:acme:error:malformed","detail":"Unable to read/verify body"}

    Traceback (most recent call last):
      File "./venv/bin/letsencrypt", line 9, in <module>
        load_entry_point('letsencrypt==0.1', 'console_scripts', 'letsencrypt')()
      File "/root/lets-encrypt-preview/letsencrypt/cli.py", line 406, in main
        return args.func(args, config, plugins)
      File "/root/lets-encrypt-preview/letsencrypt/cli.py", line 133, in auth
        plugins):
      File "/root/lets-encrypt-preview/letsencrypt/client.py", line 206, in obtain_and_enroll_certificate
        cert, privkey, chain = self.obtain_certificate(domains, csr)
      File "/root/lets-encrypt-preview/letsencrypt/client.py", line 154, in obtain_certificate
        authzr = self.auth_handler.get_authorizations(domains)
      File "/root/lets-encrypt-preview/letsencrypt/auth_handler.py", line 69, in get_authorizations
        domain, self.account.new_authzr_uri)
      File "/root/lets-encrypt-preview/letsencrypt/network2.py", line 333, in request_domain_challenges
        typ=messages2.IDENTIFIER_FQDN, value=domain), new_authz_uri)
      File "/root/lets-encrypt-preview/letsencrypt/network2.py", line 314, in request_challenges
        response = self._post(new_authzr_uri, new_authz)
      File "/root/lets-encrypt-preview/letsencrypt/network2.py", line 179, in _post
        self._check_response(response, content_type=content_type)
      File "/root/lets-encrypt-preview/letsencrypt/network2.py", line 101, in _check_response
        raise messages2.Error.from_json(jobj)
    acme.messages2.Error: malformed :: The request message was malformed :: Unable to read/verify body
    
  13. jcjones commented on Jun 19, 2015

    @jcjones
    Contributor

    @GabLeRoux - delete/move your /etc/letsencrypt/accounts directory and try again. That error, Unable to read/verify body is most likely due to DB work about 30 hours ago losing record of your account. Not saying it'll work after that, but should get past that step.

    I've opened Boulder Issue #376 to make this message better.

  14. kuba commented on Jun 20, 2015

    @kuba
    Contributor

    Demo server has been updated and includes letsencrypt/boulder#381, which should improve some error messages.

  15. GabLeRoux commented on Jun 20, 2015

    @GabLeRoux
    Author

    Thanks @kuba, I've tried it again, moved /etc/letsencrypt/accounts to /etc/letsencrypt/accounts-backup as suggested by @jcjones, pulled latest repo, executed ./bootstrap/ubuntu.sh just to make sure.

    sudo ./venv/bin/letsencrypt auth

    Enter email address
    myGmailAccount

    How would you like to authenticate with Let's Encrypt CA?
    2 Nginx Web Server (nginx)

    Please enter in your domain name(s) (comma and/or space separated)
    totemastudio.com

    PREVIEW RELEASE agreement
    Agree

    Then I get same message as first message in #521

    Traceback (most recent call last):
      File "./venv/bin/letsencrypt", line 9, in <module>
        load_entry_point('letsencrypt==0.1', 'console_scripts', 'letsencrypt')()
      File "/root/lets-encrypt-preview/letsencrypt/cli.py", line 406, in main
        return args.func(args, config, plugins)
      File "/root/lets-encrypt-preview/letsencrypt/cli.py", line 133, in auth
        plugins):
      File "/root/lets-encrypt-preview/letsencrypt/client.py", line 206, in obtain_and_enroll_certificate
        cert, privkey, chain = self.obtain_certificate(domains, csr)
      File "/root/lets-encrypt-preview/letsencrypt/client.py", line 154, in obtain_certificate
        authzr = self.auth_handler.get_authorizations(domains)
      File "/root/lets-encrypt-preview/letsencrypt/auth_handler.py", line 69, in get_authorizations
        domain, self.account.new_authzr_uri)
      File "/root/lets-encrypt-preview/letsencrypt/network2.py", line 333, in request_domain_challenges
        typ=messages2.IDENTIFIER_FQDN, value=domain), new_authz_uri)
      File "/root/lets-encrypt-preview/letsencrypt/network2.py", line 314, in request_challenges
        response = self._post(new_authzr_uri, new_authz)
      File "/root/lets-encrypt-preview/letsencrypt/network2.py", line 178, in _post
        self._add_nonce(response)
      File "/root/lets-encrypt-preview/letsencrypt/network2.py", line 149, in _add_nonce
        response.request.method))
    letsencrypt.errors.NetworkError: Server POST response did not include a replay nonce
    

    Same error when executing sudo ./venv/bin/letsencrypt run

    I'll be on #letsencrypt@Freenode if you want me to test or if you need more infos.

  16. GabLeRoux commented on Jun 20, 2015

    @GabLeRoux
    Author

    Running with -vvvvvvv --text, response shows that server is currently in maintenance. #521

    Sending POST data to https://www.letsencrypt-demo.org/acme/new-authz

    DEBUG:root:Received response <Response [500]>: u'<!DOCTYPE html>\n\n<html lang="en">\n<head>\n  <meta charset="utf-8">\n  <meta http-equiv="X-UA-Compatible" content="IE=edge">\n  <meta name="viewport" content=\n  "width=device-width, initial-scale=1">\n\n  <title>Maintenance</title>\n  <link href=\n  "//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"\n  rel="stylesheet" type="text/css">\n  <link href=\n  "//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css"\n  rel="stylesheet" type="text/css">\n</head>\n\n<body>\n  <div class="container-fluid">\n    <div class="row">\n      <div class="col-md-6 text-right">\n\t<p style="font-size: 90px;">\n<i class="fa fa-coffee"></i></p>\n\t</div>\n\n      <div class="col-md-6 text-left">\n        <h1>502<br>\n        <small>Maintenance Time</small></h1>\n      </div>\n    </div>\n\n    <div class="row">\n      <div class="col-xs-12 text-center">\n        <p>Sorry! We\'re doing some cleanup at the moment. We\'ll be back shortly.</p>\n\t<a href="https://twitter.com/letsencrypt" title="Twitter">\n\t  <span class="fa-stack header-menu-button-icon">\n\t\t<i class="fa fa-square-o fa-stack-2x"></i>\n\t\t<i class="fa fa-twitter fa-stack-1x"></i>\n\t  </span>\n\t  <span class="header-menu-button-label">\n\t\tCheck with us on Twitter\n\t  </span>\n\t</a>\n      </div>\n    </div>\n  </div>\n\n\n</body>\n</html>\n'
    
  17. kuba commented on Jun 20, 2015

    @kuba
    Contributor

    Please try to keep the issue scoped to one particular problem, thanks. I will respond at #521.

  18. kuba commented on Jun 22, 2015

    @kuba
    Contributor

    For anyone using CloudFlare: letsencrypt/boulder#391

  19. jdkasten commented on Aug 15, 2015

    @jdkasten
    Contributor

    I think this has been resolved or remains a Boulder DNS problem.

  20. frankf-cgn commented on Nov 19, 2015

    @frankf-cgn

    To whom ever this is of interest: I have had the same problems as the reporter of this issue and I tracked down the problem to my domainname does not have had an A-Record, so ping my_domain_name.net does not give a result.
    It now happens that in boulder/ra/registration-authority.go the func (ra *RegistrationAuthorityImpl) validateContacts(... calls validateEmail which splits the domain-part from the local-part of the e-mail address and then calls resolver.LookupHost(domain). This method tries to resolve an IP-Address for the domain-name and that fails.

    I have found nowhere in the documentation that an A-Record for the domainname of the e-mail Adddress is required for letsencrypt to work. And I can not though of any valid reason for this, but I'm sure I'm missing something here.

    With "domain name has an IP" I mean sth like this in bind-syntax:

    @       IN      SOA     ns.example.de. postmaster.example.de. (
                    2015111801      ; serial number
                    3H              ; refresh, seconds
                    2H              ; retry, seconds
                    1W              ; expire, seconds
                    1H ) 
                    IN      NS     ns.xxxxxxxxxxx.de
                    IN      NS     ns2.xxxxxxxxxxx.de
                    IN      A       789.654.321.123
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions