[NCBC-516] .NET SDK 2.0 Documentation Created: 17/Jun/14  Updated: 11/Aug/14

Status: In Progress
Project: Couchbase .NET client library
Component/s: docs
Affects Version/s: 2.0 DP2
Fix Version/s: 2.0 Beta

Type: Epic Priority: Blocker
Reporter: Jeff Morris Assignee: Jeff Morris
Resolution: Unresolved Votes: 0
Labels: None
Σ Remaining Estimate: Not Specified Remaining Estimate: Not Specified
Σ Time Spent: Not Specified Time Spent: Not Specified
Σ Original Estimate: Not Specified Original Estimate: Not Specified

Sub-Tasks:
Key
Summary
Type
Status
Assignee
NCBC-495 Code Comments & Sandcastle Documentation Technical task Closed Jeff Morris  
Epic Name: Beta 1 Documentation and Sample App
Epic Status: To Do

 Description   
This includes Code Comments and Sandcastle docs, and Example Application, and general developer guide. The release of Beta 1 depends upon the completion of this epic.




[NCBC-340] System.InvalidOperationException an asynchronous module or handler completed while an asynchronous operation was still pending Created: 04/Dec/13  Updated: 02/Jun/14

Status: Open
Project: Couchbase .NET client library
Component/s: library
Affects Version/s: None
Fix Version/s: backlog-1.0

Type: Task Priority: Blocker
Reporter: Jeff Morris Assignee: Jeff Morris
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment: ASP.NET Session Provider

Attachments: Zip Archive NCBC340_reproduced.zip    

 Description   
I get the following error randomly on my production Couchbase server:

"System.InvalidOperationException
an asynchronous module or handler completed while an asynchronous operation was still pending"

I am using the latest Couchbase server and the latest version of the .Net SDK. When I run locally I do not see this error at all.

On production I have a two node Couchbase client. The config section is the following:

<couchbase>
  <servers bucket="Staging" bucketPassword="">
    <add uri="http://COUCH01.mobitorhost00.local:8091/pools" />
  </servers>
</couchbase>
<enyim.com>
  <memcached protocol="Binary">
    <servers>
      <add address="COUCH01.mobitorhost00.local" port="11211" />
    </servers>
    <socketPool minPoolSize="10" maxPoolSize="100" connectionTimeout="00:01:00" deadTimeout="00:01:00"/>
  </memcached>
</enyim.com>

When I switch to the Memcache provider instead the error does not appear.

Thanks for your help. This is really a show-stopper for us.

Here is a stack trace:

Storex.Site.dll!Storex.Site.MvcApplication.Application_Error() Line 53 C#
  [Native to Managed Transition]
  System.Web.dll!System.Web.Util.ArglessEventHandlerProxy.Callback(object sender, System.EventArgs e) Unknown
  System.Web.dll!System.Web.HttpApplication.RaiseOnError() Unknown
  System.Web.dll!System.Web.HttpApplication.PipelineStepManager.ResumeSteps(System.Exception error) Unknown
  System.Web.dll!System.Web.HttpApplication.BeginProcessRequestNotification(System.Web.HttpContext context, System.AsyncCallback cb) Unknown
  System.Web.dll!System.Web.HttpRuntime.ProcessRequestNotificationPrivate(System.Web.Hosting.IIS7WorkerRequest wr, System.Web.HttpContext context) Unknown
  System.Web.dll!System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(System.IntPtr rootedObjectsPointer, System.IntPtr nativeRequestContext, System.IntPtr moduleData, int flags) Unknown
  System.Web.dll!System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(System.IntPtr rootedObjectsPointer, System.IntPtr nativeRequestContext, System.IntPtr moduleData, int flags) Unknown
  [Native to Managed Transition]
  [Managed to Native Transition]
  System.Web.dll!System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(System.IntPtr rootedObjectsPointer, System.IntPtr nativeRequestContext, System.IntPtr moduleData, int flags) Unknown
  System.Web.dll!System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(System.IntPtr rootedObjectsPointer, System.IntPtr nativeRequestContext, System.IntPtr moduleData, int flags) Unknown
  [AppDomain Transition]

- See more at: http://www.couchbase.com/communities/comment/reply/1892?destination=node/1892#comment-form

 Comments   
Comment by Jeff Morris [ 04/Dec/13 ]
Possible duplicate: https://www.couchbase.com/issues/browse/NCBC-302
Comment by Tomasz Poradowski [ 13/Dec/13 ]
This can be worked around by using RestSharpHttpClient, see more at http://www.couchbase.com/communities/q-and-a/answer/answer-2095
Comment by Tomasz Poradowski [ 13/Dec/13 ]
@Jeff - you're right with NCBC-302 - it is caused by the same issue as here (asynchronous call in DefaultHttpClient's constructor that fails at some point, though for me first call to get something from Couchbase usually succeeded, only subsequent calls from a given ASP.NET MVC action failed like this)
Comment by Jeff Morris [ 13/Dec/13 ]
Tomasz -

Thanks for providing this info for the community. Are you using any DI frameworks (autofac, ninject, etc) to create and inject the Couchbase client? If so, which one?

In my testing I have only been able to replicate this when using a DI framework (autofac) - my workaround has been to create the client statically in the Global.asax and then reference it like so: MvcApplication1.CouchbaseClient.<methods>.

Thanks again,

Jeff
Comment by Tomasz Poradowski [ 16/Dec/13 ]
Small ASP.NET MVC 4 application using CouchbaseClient 1.3.0 that results in "InvalidOperationException: View by_post was mapped to a dead node, failing.", unless a different HTTP client than default is used.
Comment by Tomasz Poradowski [ 16/Dec/13 ]
@Jeff - I've just attached a sample MVC application (VS2013 Express for Web solution) that:
- uses CouchbaseClient 1.3.0 and CouchbaseModelViews.Framework
- follows general guidelines from Couchbase documentation (uses Repository pattern that creates a static client in RepositoryBase<T> class)
- uses "default" bucket and in order to test it - you need to create a document there as follows: { "type": "post", "title": "test post" }.
When main page is shown - list of posts is rendered and this is fine, however when you click on the link to see details - it fails with:

[InvalidOperationException: View by_post was mapped to a dead node, failing.]
   Couchbase.CouchbaseViewHandler.GetResponse(IDictionary`2 viewParams) in e:\dev\workspace\LawFirmCouch\couchbase-net-client-1.3.0\src\Couchbase\CouchbaseViewHandler.cs:184
   Couchbase.<TransformResults>d__0`1.MoveNext() in e:\dev\workspace\LawFirmCouch\couchbase-net-client-1.3.0\src\Couchbase\CouchbaseViewHandler.cs:42
   ASP._Page_Views_Post_Show_cshtml.Execute() in e:\dev\workspace\LawFirmCouch\NCBC340\Views\Post\Show.cshtml:27
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +197
   System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +119
   System.Web.WebPages.StartPage.RunPage() +17
...

This isn't exactly the same problem, but the workaround is the same - to use RestSharpHttpClient, which you can test by uncommenting it in web.config (under /configuration/couchbase). Therefore I assume it may have the same origin.
Shall you need any more details please contact me.

Regards,
Tomasz
Comment by Tomasz Poradowski [ 16/Dec/13 ]
NCBC340_reproduced.zip now with full source code of Enyim.Caching (I deleted some source files accidentally in the first attachment)
Comment by Jeff Morris [ 17/Dec/13 ]
Thanks Tomasz -

This "[InvalidOperationException: View by_post was mapped to a dead node, failing.]" is actually a separate bug. The ticket to follow is here: http://www.couchbase.com/issues/browse/NCBC-337

-Jeff
Comment by Tomasz Poradowski [ 18/Dec/13 ]
I could not reproduce exactly the same problem in this test scenario as after finding the workaround I didn't spend any more time on it. I've just tested your fix to NCBC-337 (http://review.couchbase.org/#/c/31007/ applied by hand to current master branch of couchbase-net-client) and was hoping to finally be able to reproduce exception reported originally in this ticket - but unfortunately the same error persists ("view mapped to a dead node").
Comment by Tomasz Poradowski [ 18/Dec/13 ]
Ok, now I finally know how to reproduce this very issue - in my sample project attached to this ticket please modify NCBC340/Controllers/PostController.cs as follows:

    public class PostController : Controller
    {
        //
        // GET: /Post/
private PostRepository repository = new PostRepository();
private CommentRepository comments = new CommentRepository();

        public ActionResult Show(string id)
        {
var post = repository.Get(id);
post.Comments = comments.GetAllByPost(id);

            return View(post);
        }
    }

and like that it fails for the very first time when you go to details of a test "post" shown on main page. Therefore it seems that this asynchronous call in DefaultHttpClient's constructor does not finish on time. Subsequent calls to view details succeeded, so it's likely per design document or per view.
Comment by Tomasz Poradowski [ 27/Dec/13 ]
Though I'm not sure what impact this may have on performance - another workaround for this issue is to add following to web.config:

<couchbase>
...
    <httpClient initializeConnection="false" />
</couchbase>

This setting causes the problematic asynchronous call in DefaultHttpClient's constructor to be skipped.
Comment by Jeff Morris [ 27/Dec/13 ]
Tomasz -

This is great, we can test the performance between setting false/true.

>>I've just tested your fix to NCBC-337 (http://review.couchbase.org/#/c/31007/ applied by hand to current master branch of couchbase-net-client) and was hoping to finally be able to reproduce exception reported originally in this ticket - but unfortunately the same error persists ("view mapped to a dead node").

This should be resolved with that commit, so if your still seeing it then it's likely a bigger problem. Could you describe your environment (cluster size, etc)?

Thanks,

-Jeff
Comment by Tomasz Poradowski [ 27/Dec/13 ]
@Jeff - I assume your fix to NCBC-337 was fine, but that issue was also hit (though indirectly) by the same root cause as NCBC-340. My test environment is currently a single node running Couchbase Enterprise 2.2.0 on Win7 Pro, using 2GB RAM.




[NCBC-338] When a connection is dropped by the server, the client does not handle it gracefully. Created: 04/Dec/13  Updated: 13/Jan/14

Status: Open
Project: Couchbase .NET client library
Component/s: library
Affects Version/s: 1.3.0
Fix Version/s: backlog-1.0

Type: Task Priority: Blocker
Reporter: Jeff Morris Assignee: Jeff Morris
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
In 1.3.0 we added timeout and a callback which will generate an exception, but there must be a better way to do this.




[NCBC-309] Move .NET API documentation from docs repo to auto-doc Created: 07/Oct/13  Updated: 13/Jan/14

Status: Open
Project: Couchbase .NET client library
Component/s: docs
Affects Version/s: 1.2.8
Fix Version/s: backlog-1.0

Type: Improvement Priority: Blocker
Reporter: Jeff Morris Assignee: Jeff Morris
Resolution: Unresolved Votes: 0
Labels: None
Σ Remaining Estimate: Not Specified Remaining Estimate: Not Specified
Σ Time Spent: Not Specified Time Spent: Not Specified
Σ Original Estimate: Not Specified Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates NCBC-248 Touch should return a boolean Resolved
duplicates NCBC-179 Add expiries and CAS to StoreJson ext... Resolved
Sub-Tasks:
Key
Summary
Type
Status
Assignee
NCBC-321 Add XML Comments to Source Technical task Resolved Jeff Morris  
NCBC-322 Setup Sandcastle and generate documen... Technical task Open Jeff Morris  

 Description   
Look into visual studio support for ///




[NCBC-292] update packages with new signing key Created: 27/Aug/13  Updated: 27/Aug/13

Status: Open
Project: Couchbase .NET client library
Component/s: library
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Blocker
Reporter: Matt Ingenthron Assignee: Matt Ingenthron
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified





Generated at Mon Sep 15 00:01:21 CDT 2014 using JIRA 5.2.4#845-sha1:c9f4cc41abe72fb236945343a1f485c2c844dac9.