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

QueryIndexManager fails to create indexes in Linq2Couchbase integration tests

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 3.0.1
    • 3.3.0
    • library
    • 1

    Description

      As an example, this method is being called:

      await manager.CreateIndexAsync("beer-sample", "brewery_id", "brewery_id");
      

      And this is the result:

      Couchbase.Core.Exceptions.ParsingFailureException : syntax error - at - [3000]
         at Couchbase.Query.QueryResultExtensions.ThrowExceptionOnError[T](IQueryResult`1 result, QueryErrorContext context) in C:\Users\bburnett\source\repos\couchbase-net-client\src\Couchbase\Query\QueryResultExtensions.cs:line 56
         at Couchbase.Query.QueryClient.ExecuteQuery[T](QueryOptions options, ITypeSerializer serializer) in C:\Users\bburnett\source\repos\couchbase-net-client\src\Couchbase\Query\QueryClient.cs:line 204
         at Couchbase.Query.QueryClient.QueryAsync[T](String statement, QueryOptions options) in C:\Users\bburnett\source\repos\couchbase-net-client\src\Couchbase\Query\QueryClient.cs:line 67
         at Couchbase.Management.Query.QueryIndexManager.CreateIndexAsync(String bucketName, String indexName, IEnumerable`1 fields, CreateQueryIndexOptions options) in C:\Users\bburnett\source\repos\couchbase-net-client\src\Couchbase\Management\Query\QueryIndexManger.cs:line 67
         at Couchbase.Linq.IntegrationTests.N1QlTestBase.EnsureIndexExists(IBucket bucket, String indexName, String[] fields) in C:\Users\bburnett\source\repos\Linq2Couchbase\Src\Couchbase.Linq.IntegrationTests\N1QLTestBase.cs:line 18
         at Couchbase.Linq.IntegrationTests.QueryTests.JoinTests_InnerJoin_IndexJoin() in C:\Users\bburnett\source\repos\Linq2Couchbase\Src\Couchbase.Linq.IntegrationTests\QueryTests.cs:line 788
         at NUnit.Framework.Internal.TaskAwaitAdapter.GenericAdapter`1.BlockUntilCompleted()
         at NUnit.Framework.Internal.MessagePumpStrategy.NoMessagePumpStrategy.WaitForCompletion(AwaitAdapter awaitable)
         at NUnit.Framework.Internal.AsyncToSyncAdapter.Await(Func`1 invoke)
         at NUnit.Framework.Internal.Commands.TestMethodCommand.RunTestMethod(TestExecutionContext context)
         at NUnit.Framework.Internal.Commands.TestMethodCommand.Execute(TestExecutionContext context)
         at NUnit.Framework.Internal.Commands.BeforeAndAfterTestCommand.<>c__DisplayClass1_0.<Execute>b__0()
         at NUnit.Framework.Internal.Commands.BeforeAndAfterTestCommand.RunTestMethodInThreadAbortSafeZone(TestExecutionContext context, Action action)
      

      Likely cause: Not escaping the - character in the bucket name.

      Attachments

        Issue Links

          For Gerrit Dashboard: NCBC-2543
          # Subject Branch Project Status CR V

          Activity

            Confirmed, passing "`beer-sample`" as the bucket name instead of "beer-sample" is a valid workaround.

            btburnett3 Brant Burnett added a comment - Confirmed, passing "`beer-sample`" as the bucket name instead of "beer-sample" is a valid workaround.
            jmorris Jeff Morris added a comment -

            This need to be brought up as an agenda item and discussed with the team as changing it should be done by all SDK's if it is done.

            jmorris Jeff Morris added a comment - This need to be brought up as an agenda item and discussed with the team as changing it should be done by all SDK's if it is done.

            Group decision: SDK should surround everything in backticks.

            This will have to be called out in the release notes, as it will then break for anyone using the workaround.

            richard.ponton Richard Ponton added a comment - Group decision: SDK should surround everything in backticks. This will have to be called out in the release notes, as it will then break for anyone using the workaround.
            jmorris Jeff Morris added a comment -

            CREATE INDEX brewery_id ON beer-sample(brewery_id) USING GSI WITH {"defer_build":False};
            

            [
              {
                "code": 3000,
                "msg": "syntax error - at -",
                "query": "CREATE INDEX brewery_id ON beer-sample(brewery_id) USING GSI WITH {\"defer_build\":False};"
              }
            ]
            

            jmorris Jeff Morris added a comment - CREATE INDEX brewery_id ON beer-sample(brewery_id) USING GSI WITH {"defer_build":False}; [ { "code": 3000, "msg": "syntax error - at -", "query": "CREATE INDEX brewery_id ON beer-sample(brewery_id) USING GSI WITH {\"defer_build\":False};" } ]
            jmorris Jeff Morris added a comment -

            Reopening as patch causes a regression when SELECT-BUCKET is called.

            jmorris Jeff Morris added a comment - Reopening as patch causes a regression when SELECT-BUCKET is called.
            jmorris Jeff Morris added a comment - NCBC-3107

            People

              jmorris Jeff Morris
              btburnett3 Brant Burnett
              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