Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-35593

Add more details to logging with SSL read/write failures

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 5.5.6
    • 5.5.5
    • memcached
    • None
    • Untriaged
    • Unknown

    Description

      We've seen occurrences where the following log entry was added to the logs:

      LOG_WARNING("{}: ERROR: SSL_read returned -1 with error {}",
                                  getId(),
                                  error);
      

      We should extent the log information to try to map the error code to a readable string:

                      try {
                          std::string errmsg("SSL_read() returned " +
                                             std::to_string(n) + " with error " +
                                             std::to_string(ssl.getError(n)));
                          std::vector<char> ssl_err(1024);
                          ERR_error_string_n(ERR_get_error(),
                                             ssl_err.data(),
                                             ssl_err.size());
                          LOG_WARNING("{}: {}: {}", getId(), errmsg, ssl_err.data());
                      } catch (const std::bad_alloc&) {
                          LOG_WARNING("{}: ERROR: SSL_read returned -1 with error {}",
                                      getId(),
                                      error);
                      }
      

      This would (hopefully) aid customers if figuring what's wrong with their SSL configuration.

      Attachments

        Activity

          People

            trond Trond Norbye
            trond Trond Norbye
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              PagerDuty