Skip to content

Implement RFC 8555 Subproblems #7046

Closed
Closed

Description

@bmw

This is to make use of boulder's work at letsencrypt/boulder#4193. I think a good starting point here is just making sure the field is properly parsed and displayed to the user.

I'm putting this in the next milestone because I think doing this is both valuable and shouldn't be too difficult.

Activity

  1. added this to the 0.36.0 milestone on May 7, 2019
  2. cpu commented on Jun 3, 2019

    @cpu
    Contributor

    The Boulder side of this work is completed as of caf6553. You might find this integration test helpful as a starting point for making a newOrder request that will return subproblems.

    I think a good starting point here is just making sure the field is properly parsed and displayed to the user.

    Agreed 👍 The existing code seems to pull out the type/detail field of the problem instead of displaying it raw:

    msg = ["The following errors were reported by the server:"]
    for achall in failed_achalls:
    msg.append("\n\nDomain: %s\nType: %s\nDetail: %s" % (
    achall.domain, typ, achall.error.detail))

    I think that's sensible but I noticed it made for a bad experience when I was testing sub-problems if Boulder returned a naive top level problem with a detail like "NewOrder request invalid. See sub-problems".

    To try and account for this I made an effort to include at least one identifier in the top-level problem detail anywhere we return a problem with sub-problems so that clients like Certbot that display only some fields of the top-level problem will still be giving actionable information. Adding explicit display of the sub-problems will be a big improvement 🎉

    Whoever picks this up can feel free to ping me with further q's!

  3. adferrand commented on Jun 3, 2019

    @adferrand
    Contributor

    Hello @cpu!

    From the RFC 8555, I see that an error containing subproblems will have the key subproblems in the JSON representing the error. Testing if the key exists and does not contain an empty object or assimilate, would be a reliable way to trigger a suitable display logic on client side, right?

  4. adferrand commented on Jun 3, 2019

    @adferrand
    Contributor

    One potential complex situation I see here to handle.

    The acme module in Certbot implements a message error as an object with a typ (and code) parameter, calculated from the type received in the JSON from ACME server. This is used in someplaces to trigger some specific branches, like here:

    certbot/acme/acme/client.py

    Lines 1180 to 1185 in 18797dc

    except messages.Error as error:
    if error.code == 'badNonce':
    logger.debug('Retrying request after error:\n%s', error)
    return self._post_once(*args, **kwargs)
    else:
    raise

    In theory, an error with sub-problems may contains a specific type like badNonce in one of the sub-problems, with another more generic error at the top-level.

    So I imagine that we need to implement in our own representation of ACME error messages (acme.message.Errors) some ad-hoc methods to match a given error code not only at the top level, but also in sub-problems if they exist.

    @bmw, your thought on this?

  5. cpu commented on Jun 3, 2019

    @cpu
    Contributor

    Testing if the key exists and does not contain an empty object or assimilate, would be a reliable way to trigger a suitable display logic on client side, right?

    Yup - that should be a reliable indicator. We use omitempty on the field in Boulder so it won't be present in the JSON if it is empty: https://github.com/letsencrypt/boulder/blob/f57f9a6c5586e49c9ba78289a08b375007f555ad/probs/probs.go#L45-L47

  6. modified the milestones: 0.36.0, 0.37.0 on Jun 3, 2019
  7. bmw commented on Jun 3, 2019

    @bmw
    MemberAuthor

    To try and account for this I made an effort to include at least one identifier in the top-level problem detail anywhere we return a problem with sub-problems so that clients like Certbot that display only some fields of the top-level problem will still be giving actionable information. Adding explicit display of the sub-problems will be a big improvement 🎉

    Thanks @cpu! Are there any areas where you expect Certbot's error output to get significantly worse as a result of these changes server side until we implement subproblems on our end? Also, when do you expect the use of subproblems to be enabled in production?

    So I imagine that we need to implement in our own representation of ACME error messages (acme.message.Errors) some ad-hoc methods to match a given error code not only at the top level, but also in sub-problems if they exist.

    That's a good idea! My initial instinct on how to structure this part of the code is to add an optional subproblems field to acme.messages.Error which would contain a sequence of additional Error objects along with a property like codes which would be the sequence of all error codes in both the original Error and its subproblems.

  8. cpu commented on Jun 4, 2019

    @cpu
    Contributor

    Are there any areas where you expect Certbot's error output to get significantly worse as a result of these changes server side until we implement subproblems on our end?

    I don't think there will be anywhere that gets significantly worse with perhaps one particular corner case. (If I turn out to be wrong about this I would definitely be willing to revisit it Boulder-side as the situation merits).

    The one corner case where I expect Certbot (and likely other ACME clients) to take a small usability hit is the case where an RFC 8555 Order with many names is being finalized that has authorizations requiring CAA recheck (e.g. its authzs were validated >8hrs ago) and more than one recheck produces a CAA error.

    Previously in this case Boulder joined all of the failing domain names into one (ugly) comma separated detail in the top level: https://github.com/letsencrypt/boulder/blob/6f93942a0449ea6bc0f6927c5e7520c1034f49b6/ra/ra.go#L905-L907

    In the new sub-problem version the top level problem will only have the first erroring identifier and the remaining will be in the sub-problems. I think that's slightly inconvenient for users that can't see subproblems but it seemed like an acceptable trade-off when I implemented it.

    Also, when do you expect the use of subproblems to be enabled in production?

    Subproblem support is in release-2019-06-03 and should be going to staging today and prod on Thursday.

  9. bmw commented on Jun 4, 2019

    @bmw
    MemberAuthor

    That all sounds great. Thanks for the additional info.

    I want to implement this soon, but I wanted to make sure there weren't any major downsides if we didn't get to this for a release or two.

  10. modified the milestones: 0.37.0, 0.38.0 on Jul 15, 2019
  11. 7 remaining items

  12. added this to the 1.1.0 milestone on Nov 11, 2019
  13. modified the milestones: 1.1.0, Important on Dec 4, 2019
  14. added
    priority: significant
    on Mar 20, 2020
  15. removed this from the Important milestone on Mar 20, 2020
  16. JamesBalazs commented on Apr 1, 2022

    @JamesBalazs
    Contributor

    I started looking at this yesterday in an attempt to get closer to a fix for #9251

    Here's my initial PR: #9258

    Review and any pointers would be greatly appreciated 🙂

  17. added a commit that references this issue on Apr 6, 2022
  18. alexzorin commented on Apr 8, 2022

    @alexzorin
    Collaborator

    acme now implements subproblems thanks to @JamesBalazs' work in #9258. Thank you.

    What remains is to review and implement the UX side of this. I've opened #9273 to track that.

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

    area: acmearea: error handlingpriority: significant

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions