[NCBC-144] CreateDesignDocument() exception Created: 21/Oct/12  Updated: 18/Jan/13  Resolved: 18/Jan/13

Status: Closed
Project: Couchbase .NET client library
Component/s: library
Affects Version/s: 1.2 Beta
Fix Version/s: 1.2.1

Type: Bug Priority: Major
Reporter: Perry Krug Assignee: Perry Krug
Resolution: Fixed Votes: 0
Labels: customer
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
On a Windows 7 x64 VM, single node cluster, Couchbase 2.0 beta, freshly downloaded and installed, I am getting the following exception:
System.Net.WebException was unhandled
  HResult=-2146233079
  Message=The remote server returned an error: (500) Internal Server Error.
  Source=System
  StackTrace:
       at System.Net.HttpWebRequest.GetResponse()
       at Couchbase.Helpers.HttpHelper.doRequest(Uri uri, String verb, String username, String password, String postData, String contentType) in c:\Cloud\Platform\PlatformSpike\Reference Assemblies\Couchbase\Couchbase\Helpers\HttpHelper.cs:line 77
       at Couchbase.Helpers.HttpHelper.Put(Uri uri, String username, String password, String postData, String contentType) in c:\Cloud\Platform\PlatformSpike\Reference Assemblies\Couchbase\Couchbase\Helpers\HttpHelper.cs:line 42
       at Couchbase.Management.CouchbaseCluster.CreateDesignDocument(String bucket, String name, String document) in c:\Cloud\Platform\PlatformSpike\Reference Assemblies\Couchbase\Couchbase\Management\CouchbaseCluster.cs:line 115
       at Platform.Data.Couchbase.Provisioning.CouchbaseProvisioning.CreateDesignDocument(String bucketName, String name, DesignDocument document) in c:\Cloud\Platform\PlatformSpike\Platform.Data.Couchbase.Provisioning\ProvisioningClient.cs:line 217
       at Platform.Data.Couchbase.Provisioning.CouchbaseProvisioning.Execute() in c:\Cloud\Platform\PlatformSpike\Platform.Data.Couchbase.Provisioning\ProvisioningClient.cs:line 56
       at CouchbaseUpdater.Program.Main(String[] args) in c:\Cloud\Platform\PlatformSpike\CouchbaseUpdater\Program.cs:line 26
  InnerException:
 
The server log contains the following entry, but I'm not sure if it is related:
Client-side error-report for user "admin" on node 'ns_1@192.168.54.178':
User-Agent:Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0)
Got unhandled error: Object doesn't support this action
At: http://192.168.54.178:8091/js/cells.js:64
Backtrace:
Function: collectBacktraceViaCaller
Args:
---------
Function: appOnError
Args:
"Object doesn't support this action"
"http://192.168.54.178:8091/js/cells.js"
64
30
---------
Function: (function () {throw e;})
Args:
---------
(repeated 1 times)
 
Those are the parameters to the doRequest() method:
uri = http://192.168.54.178:8092/tenants/_design/tenant_views
verb = PUT
contentType = application/json
username = admin
password = password
postData =
{
  "views": {
    "tenants_all": {
      "map": "function(doc,meta) \r\n{\r\n\tif (doc.Schema === \"tenant\") \r\n\t{ \r\n\t\temit(meta.id, null); \r\n\t} \r\n}"
    },
    "tenants_by_status": {
      "map": "function (doc,meta) \r\n{ \r\n\tif (doc.Schema === \"tenant\" && doc.Status) \r\n\t{ \r\n\t\temit(doc.Status, null); \r\n\t} \r\n}"
    },
    "tenants_by_user_application_instance": {
      "map": "function(doc,meta) \r\n{\r\n\tif (doc.Schema === \"tenant\" && doc.UserId && doc.TenantIdentifiers && identifier.Status === 1) \r\n\t{ \r\n\t\tfor (var i = 0; i < doc.TenantIdentifiers.length; i++) \r\n\t\t{\r\n\t\t\tvar identifier = doc.TenantIdentifiers[i];\r\n\t\t\tif (identifier.ApplicationInstanceId)\r\n\t\t\t{\r\n\t\t\t\temit([doc.UserId, identifier.ApplicationInstanceId], null); \r\n\t\t\t}\r\n\t\t}\r\n\t} \r\n}"
    }
  }
}
 
On the client I am using the compiled latest .NET source code from GitHub with no modifications.

 Comments   
Comment by John Zablocki (Inactive) [ 22/Oct/12 ]
Could we get a code snippet for the call that was made for this failure? I've used the client recently with Win7 64 and CBS Beta and haven't had any issues.

I have a partially completed demo app @ https://github.com/jzablocki/couchbase-beer.net/blob/master/src/CouchbaseBeersWeb/Models/WebRepositoryBase%271.cs#L140 that creates views.
Comment by John Zablocki (Inactive) [ 18/Jan/13 ]
Perry - haven't heard back on this issue. The 500 error was likely due to a bad view name or something similar. Closing this issue for now. The fix for NCBC-165 means better error handling.
Generated at Thu Sep 18 03:50:21 CDT 2014 using JIRA 5.2.4#845-sha1:c9f4cc41abe72fb236945343a1f485c2c844dac9.