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

When a N1QL request timed out (timeout) wrong exception received

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • Minor
    • 2.4.0
    • 2.3.8, 2.3.9
    • library
    • None

    Description

      Trying to access Azure env and the port is closed, N1QL query timed out.
      on fiddler I can see
      [Fiddler] The connection to '10.3.0.4' failed. <br />Error: TimedOut (0x274c). <br />System.Net.Sockets.SocketException A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 10.3.0.4:8093

      However on Visual Studio i'm getting the following exception on the result:
      Cannot deserialize the current JSON array (e.g. [1,2,3]) into type 'Couchbase.N1QL.QueryResultData`1[System.Object]' because the type requires a JSON object (e.g.

      {"name":"value"}

      ) to deserialize correctly.
      To fix this error either change the JSON to a JSON object (e.g.

      {"name":"value"}

      ) or change the deserialized type to an array or a type that implements a collection interface (e.g. ICollection, IList) like List<T> that can be deserialized from a JSON array. JsonArrayAttribute can also be added to the type to force it to deserialize from a JSON array.
      Path '', line 1, position 1.

      Tried it with 2.3.8 and with 2.3.9 with bucket and cluster queries with authentication.

      The sample code i've been using:
      };

      var credentials = new ClusterCredentials
      {
      ClusterUsername = "Administrator",
      ClusterPassword = "password",
      BucketCredentials = new Dictionary<string, string>
      {

      { "travel-sample", "" }

      // bucketName, bucketPassword
      }

      };

      const string query = "SELECT * FROM `travel-sample` LIMIT 10";

      var cluster = new Cluster(cc);
      cluster.Authenticate(credentials);

      var bucket = cluster.OpenBucket("travel-sample");
      var result1 = bucket.Get<String>("airline_10");

      Console.WriteLine(result1);

      try
      {
      var result = cluster.Query<dynamic>(query);
      foreach (var row in result.Rows)

      { Console.WriteLine(row); }

      }
      catch (Exception ex)

      { Console.WriteLine("EXCEPTION!! " + ex.Message); }

      Console.Read();

      }
      }

      Attachments

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

        Activity

          People

            mike.goldsmith Michael Goldsmith
            roi.katz Roi Katz
            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