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

Couchbase View not working with the MVC project with couchbase client 1.3.5 and Couchbase server 3.0

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Unresolved
    • 1.3.5
    • None
    • library
    • Server 3.0.2, Client 1.3.5 .Net SDK

    Description

      We are facing a issue with the 1.3.5 .Net client. We are trying to run the client.getView(desingname, viewname ) operation to fetch the records from a view that we have. The view is simply returning all documents no reduce function associated with it.

      We are able to fetch the records using a Windows Console application. However, we aren't able to fetch the records using a MVC web application. Are you aware of any open issues that relate to the same. On researching online looks like 1.3.3 had the same issue but should have been addressed with 1.3.5.

      Please find attached exception detail screenshot and find below code snapshot. We are able to get document using Key.

      Thanks

      Attachments

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

        Activity

          jmorris Jeff Morris added a comment -

          The exception is a ViewNotFoundException; is the view published?

          jmorris Jeff Morris added a comment - The exception is a ViewNotFoundException; is the view published?
          vinoo74 vinoo74 added a comment -

          The views are published. The same configuration is running fine with windows console application. Only the MVC application hosted in IIS is not able to read the view. Trying to understand why the IIS hosting is not able to read the same view. Please let us know.

          Is there any default parameters which we need to override ?

          vinoo74 vinoo74 added a comment - The views are published. The same configuration is running fine with windows console application. Only the MVC application hosted in IIS is not able to read the view. Trying to understand why the IIS hosting is not able to read the same view. Please let us know. Is there any default parameters which we need to override ?
          vinoo74 vinoo74 added a comment -

          As per the following release notes, the view problem is resolved with the workaround (web.config parameter change)

          http://docs.couchbase.com/admin/admin/rel-notes/rel-notes3.0.html

          Couchbase .NET incompatibility
          An incompatibility between Microsoft Framework 4.0 or earlier, the Couchbase .NET SDK 1.3.7 or earlier, and Couchbase Server 3.0 has been identified where the URL generated for a View operation on the Couchbase bucket is improperly encoded. This causes view requests to fail with the following message in the body:
          "Design document not found, body:

          {"error":"not_found","reason":"missing"}

          "
          Impact
          The affected Microsoft .NET versions are 4.0 or earlier, Couchbase .NET SDK 1.3.7 or earlier, and Couchbase Server 3.0 (including Beta) is >= 3.0.
          Microsoft .NET version 4.5 changes the way Uri.ToString handles its Unicode encoding, which resolves the issue. In this case, clients running on this version or higher of the CLR are not impacted. Additionally, Couchbase Server 2.5 and lower are not impacted.

          Workaround
          In addition to the patch released with Couchbase .NET SDK version 1.3.8, add the following element to your App.Config orWeb.Config to enable support for all SDK and Server versions:
          <uri>
          <iriParsing enabled="true"/>
          <uri>

          Customers who are not ready or cannot upgrade their Couchbase .NET SDKs to 1.3.8 or greater are strongly advised to add this element to their deployments if they intend to use the Couchbase .NET SDK with Couchbase Server 3.0 or greater.
          References
          https://connect.microsoft.com/VisualStudio/feedback/details/758479/system-uri-tostring-behaviour-change

          vinoo74 vinoo74 added a comment - As per the following release notes, the view problem is resolved with the workaround (web.config parameter change) http://docs.couchbase.com/admin/admin/rel-notes/rel-notes3.0.html Couchbase .NET incompatibility An incompatibility between Microsoft Framework 4.0 or earlier, the Couchbase .NET SDK 1.3.7 or earlier, and Couchbase Server 3.0 has been identified where the URL generated for a View operation on the Couchbase bucket is improperly encoded. This causes view requests to fail with the following message in the body: "Design document not found, body: {"error":"not_found","reason":"missing"} " Impact The affected Microsoft .NET versions are 4.0 or earlier, Couchbase .NET SDK 1.3.7 or earlier, and Couchbase Server 3.0 (including Beta) is >= 3.0. Microsoft .NET version 4.5 changes the way Uri.ToString handles its Unicode encoding, which resolves the issue. In this case, clients running on this version or higher of the CLR are not impacted. Additionally, Couchbase Server 2.5 and lower are not impacted. Workaround In addition to the patch released with Couchbase .NET SDK version 1.3.8, add the following element to your App.Config orWeb.Config to enable support for all SDK and Server versions: <uri> <iriParsing enabled="true"/> <uri> Customers who are not ready or cannot upgrade their Couchbase .NET SDKs to 1.3.8 or greater are strongly advised to add this element to their deployments if they intend to use the Couchbase .NET SDK with Couchbase Server 3.0 or greater. References https://connect.microsoft.com/VisualStudio/feedback/details/758479/system-uri-tostring-behaviour-change
          jmorris Jeff Morris added a comment -

          Great, good to hear!

          jmorris Jeff Morris added a comment - Great, good to hear!

          People

            jmorris Jeff Morris
            vinoo74 vinoo74
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty