Uploaded image for project: 'Couchbase .NET client library'
  1. Couchbase .NET client library
  2. NCBC-1352

While swapping a node, log4net:ERROR Exception while rendering object of type is printed on SDKD console

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.4.5
    • Component/s: None
    • Labels:
      None

      Description

      When swapping a node following error is printed on SDKD console.

      log4net:ERROR Exception while rendering object of type [Common.Logging.Factory.AbstractLogger+StringFormatFormattedMessage]
      System.FormatException: Input string was not in a correct format.
         at System.Text.StringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ParamsArray args)
         at System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args)
         at System.String.Format(IFormatProvider provider, String format, Object[] args)
         at Common.Logging.Factory.AbstractLogger.StringFormatFormattedMessage.ToString() in c:_oss\common-logging\src\Common.Logging.Portable\Logging\Factory\AbstractLogger.cs:line 125
         at log4net.ObjectRenderer.DefaultRenderer.RenderObject(RendererMap rendererMap, Object obj, TextWriter writer)
         at log4net.ObjectRenderer.RendererMap.FindAndRender(Object obj, TextWriter writer)

       

       

      It turned out following line from CouchbaseRequestExecuter.cs causes it.

      Log.Debug(JsonConvert.SerializeObject(bucketConfig));

      Looks like Log.Debug() does not like a string converted from Json object.

      By the way, this does not affect functionality.

       

       

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

          Hide
          mike.goldsmith Michael Goldsmith added a comment -

          Jae Park [X] - I've created a changeset that forces the JSON structure to be a positional parameter. Let me know if that helps.

          I'd rather not remove the log line as it can be useful when debugging. If that doesn't work, we can also try escaping that JSON structure. It would be good to get hold of a sample config to see what the problem is.

          Show
          mike.goldsmith Michael Goldsmith added a comment - Jae Park [X] - I've created a changeset that forces the JSON structure to be a positional parameter. Let me know if that helps. I'd rather not remove the log line as it can be useful when debugging. If that doesn't work, we can also try escaping that JSON structure. It would be good to get hold of a sample config to see what the problem is.
          Hide
          mike.goldsmith Michael Goldsmith added a comment -

          Hi Jae - Do you still see the same log error after my update?

          Show
          mike.goldsmith Michael Goldsmith added a comment - Hi Jae - Do you still see the same log error after my update?
          Hide
          jaekwon.park Jae Park [X] (Inactive) added a comment -

          Is the fix https://github.com/couchbase/couchbase-net-client/commit/a9a77eea03c042192696306b40c41fcdb13cd1af ?

          FYI, my code related to this is as following. Let me check if that still happens after commit a9a77

                      RollingFileAppender appender = new RollingFileAppender();
                      appender.File = opts.LogFile;
                      PatternLayout layout = new PatternLayout();
                      layout.ConversionPattern = "%date [%thread] %level %logger - %message%newline";
                      layout.ActivateOptions();
                      appender.Layout = layout;
                      appender.AppendToFile = false;
                      appender.ActivateOptions();
                      log4net.Config.BasicConfigurator.Configure(appender);
          

          Show
          jaekwon.park Jae Park [X] (Inactive) added a comment - Is the fix https://github.com/couchbase/couchbase-net-client/commit/a9a77eea03c042192696306b40c41fcdb13cd1af  ? FYI, my code related to this is as following. Let me check if that still happens after commit a9a77             RollingFileAppender appender = new RollingFileAppender();             appender.File = opts.LogFile;             PatternLayout layout = new PatternLayout();             layout.ConversionPattern = "%date [%thread] %level %logger - %message%newline" ;             layout.ActivateOptions();             appender.Layout = layout;             appender.AppendToFile = false ;             appender.ActivateOptions();             log4net.Config.BasicConfigurator.Configure(appender);
          Hide
          jmorris Jeff Morris added a comment -

          Jae Park [X] - marking as resolved since its merged and can be verified in SDK 2.4.5 testing

          Show
          jmorris Jeff Morris added a comment - Jae Park [X] - marking as resolved since its merged and can be verified in SDK 2.4.5 testing
          Hide
          jaekwon.park Jae Park [X] (Inactive) added a comment -

          tested with latest commit,  and I see issue is resolved
          02f074498b559feeaec1cd247cf0037554a6f7f3

          Show
          jaekwon.park Jae Park [X] (Inactive) added a comment - tested with latest commit,  and I see issue is resolved 02f074498b559feeaec1cd247cf0037554a6f7f3

            People

            • Assignee:
              jaekwon.park Jae Park [X] (Inactive)
              Reporter:
              jaekwon.park Jae Park [X] (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes

                  PagerDuty

                  Error rendering 'com.pagerduty.jira-server-plugin:PagerDuty'. Please contact your Jira administrators.