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

Query: An invalid request URI was provided.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 3.0.0-beta.2
    • 3.0.0-beta.1
    • None
    • None
    • 1

    Description

      I am sure I'm screwing something up, but I do this:

      var options = new ClusterOptions()
                                  .WithServers("couchbase://localhost")
                                  .WithBucket("default")
                                  .WithCredentials("Administrator", "password");
       var cluster = new Cluster("couchbase://localhost", options);
       var bucket = await cluster.BucketAsync("travel-sample");
       var collection =  bucket.DefaultCollection();
       
       var queryRes = await cluster.QueryAsync<dynamic>("select * from `travel-sample` limit 10;", QueryOptions.Create());
      
      

      And I get the following error where we await the query result:

      System.InvalidOperationException: An invalid request URI was provided. The request URI must either be an absolute URI or BaseAddress must be set.
         at System.Net.Http.HttpClient.PrepareRequestMessage(HttpRequestMessage request)
         at System.Net.Http.HttpClient.SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken)
         at System.Net.Http.HttpClient.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
         at System.Net.Http.HttpClient.PostAsync(Uri requestUri, HttpContent content, CancellationToken cancellationToken)
         at Couchbase.Query.QueryClient.ExecuteQuery[T](QueryOptions options, IDataMapper dataMapper) in /Users/davidkelly/projects/gerrit/couchbase-net-client/src/Couchbase/Query/QueryClient.cs:line 125
         at Couchbase.Query.QueryClient.QueryAsync[T](String statement, QueryOptions options) in /Users/davidkelly/projects/gerrit/couchbase-net-client/src/Couchbase/Query/QueryClient.cs:line 57
         at Couchbase.Cluster.QueryAsync[T](String statement, QueryOptions options) in /Users/davidkelly/projects/gerrit/couchbase-net-client/src/Couchbase/Cluster.cs:line 174
         at Couchbase.SDK3._0.Examples.Program.<>c.<<Main>b__0_0>d.MoveNext() in /Users/davidkelly/projects/gerrit/couchbase-net-client/examples/Couchbase.SDK3.0.Examples/Program.cs:line 31
      

      Unsure what's up, but worth mentioning.

      Attachments

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

        Activity

          People

            jmorris Jeff Morris
            david.kelly David Kelly (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty