For the particular client that reported this, it turns out that the issue was caused by a change made to a membership type after the price set was already associated with the contribution page, but the error was only presented if one clicked on the Save button of Memberships tab of the contribution page configuration.
To confirm whether this is the case to you - navigate to the Memberships tab of your contribution page and click the Save button to see if you are presented with the following error message:
The membership price set associated with this online contribution allows a user to select BOTH an auto-renew AND a non-auto-renew membership. This requires submitting multiple processor transactions, and is not supported for one or more of the payment processors enabled under the Amounts tab.
Meaning - when using a price set, you can either offer auto-renew for all memberships on a given page, or none of them, but you can't offer a mix. On the other-hand, if you use the built-in membership fees section, you can select which membership types you wish to have the option (or be required) to auto-renew (so long as your payment processor supports auto-renewal).
If you don't have a payment processor that is configured to allow for auto-renewal:
- Navigate to Administer > CiviMember > Membership Types
- Ensure that the Auto-renew Option for all membership types is to to "No auto-renew option"
- Navigate back to the Memberships tab of the contribution page and click the Save button - the message should no longer appear
- Click on the Contribution Links button at the top and select Test or Live - the discount box should now appear (assuming that the discount code is configured accordingly).
Hope this helps!