DotNet Core 2.1 - Ubuntu 16.04. Error FTS

Hi All,
i have implemented a dotnet Core project in ubuntu with the nuget CouchbaseNetClient package 2.7.0.
I have a problem with the FTS Query.
More precisely:
I have
When i call:

ISearchQueryResult result =bucket.Query(sq);
(sq is a SearchQuery object) and return this error:

and after i get the hits:
IList<ISearchQueryRow> hitsOrFail = result.HitsOrFail;

return this exception:
System.ComponentModel.Win32Exception (0x80090020): GSSAPI operation failed with error - An invalid status code was supplied (Configuration file does not specify default realm). at Couchbase.Search.SearchQueryResult.get_HitsOrFail()

what i wrog?


  1. i have tested in windows and i not have a problem
  2. if i call the simple method
    I don’t have a problem


@jempis02 -

It looks like its related to NTLM per this Core issue. The work around listed appears to be to fall back to using the Libcurl version of HttpClient like this:

AppContext.SetSwitch("System.Net.Http.UseSocketsHttpHandler", false);

Try that and let us know what the result is; we’ll open and issue and look for a more formal resolution.


Hi @jmorris,
thanks for response.
I have add the ‘AppContext’, and i resolve the excpetion; but now i have another two error:
System.Net.Http.HttpRequestException: 503: Service Unavailable
System.Threading.Tasks.TaskCanceledException: A task was canceled.

Always after i call the :
IList<ISearchQueryRow> hitsOrFail = result.HitsOrFail;
(if i call ’ bucket.GetDocument<ObjectName>(id)’, i don’t have problem.

do I have to set something else? (I tried to search in the forum but I did not find anything)


@jempis02 - do you have the Query service enabled? Can you ping the endpoint? Try tracing the HTTP call to the service and see if the client is generating the correct call based on your cluster topology.


hi @jmorris ,
for all questions the response is ‘yes’.
the Service works well until the “result.HitsOrFail” method is invoked (where result is a ISearchQueryResult object)

@jempis02 -

When you call result.HitsOrFail it throws an exception that was already captured, meaning that the query failed from the get-go when it was executed. The result.Exception property will have the same exception; it is the one that was thrown.

An HTTP trace should show the POST to the server along with the URI that was used. I would start there and figure out why the server is failing the request. A 503 generally means the service cannot handle any more requests or something similar - you’ll have to debug it. A cancelled task is likely just the result of the service returning 503 and the task being cancelled in the client.


hi @jmorris
thanks for your time, but we have decided to use the GO SDK .
With the dotnet Core we had too many problems…

@jempis02 -

Ok, thanks - I am opening up an issue none-the-less, it would be helpful if you provided the HTTP trace to help identify the issue (NCBC-1810) so that we can resolve it so that others do not get stuck with it.


Your issue may be related to: