Development views not working after XDCR

Hi,

I currently have just one server running in a dev environment. I’m playing around with the elasticsearch connector and hence had setup my elasticsearch server as part of the XDCR setup. I removed the elasticserver from the XDCR setup and now I find that developments views no longer work on the single server :frowning:
Is there anyway for me to reset this? I presume for some reason cb doesn’t realize that all the data is just on that one server? Production views work fine.

Thanks!

Hi,

what do you mean by not working? Do you get a particular error?

@ldoguin - I don’t get back any results!

Sometimes I get a subset of my results back but mostly no results.

Any clues?

@ldoguin - we are also no longer able to query our views.

beer-sample querying works but nothing on our bucket. Here is the traceback:

traceback (most recent call last):
File “sendEmail.py”, line 51, in
for row in resiter:
File “/usr/local/lib/python2.7/dist-packages/couchbase/views/iterator.py”, line 375, in iter
raw_rows = self.raw.fetch(self._mres)
couchbase.exceptions.HTTPError: <RC=0x3B[HTTP Operation failed. Inspect status code for details], HTTP Request failed. Examine ‘objextra’ for full result, Results=1, C Source=(src/http.c,140), OBJ=ViewResult<RC=0x3B[HTTP Operation failed. Inspect status code for details], Value=None, HTTP=404>>

You mentioned your production views work but not the dev views is that right? could someone have edited the dev views and render them invalid? Could you copy your production views back to development views and doublecheck?

@cihangirb this happens even for new views that I’m creating. the views return no results in dev, once i publish to production they start working.

additionally, i cannot query the production view via the api.

i am currently running just one server, so the all ‘cluster data’ exists on the dev server.

Sorry not clear:

… the views return no results in dev, once i publish to production they start working.
additionally, i cannot query the production view via the api…

Does the production view work or no? could you send me the view definition and query through the REST API you are running. I can try this on my end.
thanks
-cihan

@cihangirb

My view definition is very simple:

function (doc, meta) {
  if (doc.type == 'email') {
    if (doc.sent == 'no') {
    	emit(meta.id, doc.username);
    }
  }
}

In development when I run the view in development time subset I see no results: screenshot here

Results show up in full cluster dataset: screenshot 2 here

Results also show up using the GUI in production: screenshot 3 here

I’m not sure why they are not showing up in dev under development time subset (they used to).

Lastly, when querying the view using the Python SDK these are my results.

  1. when querying the beer-sample bucket things are good. I am able to iterate through the resiter and print out rows.

    bkt = Bucket(‘couchbase://dev.couchbase.*****.com/beer-sample’)
    resiter = bkt.query(‘beer’, ‘by_name’)
    for row in resiter:
    print row

  2. when i change the bucket from beer-sample to ours, using the below code i get the below mentioned error:

Code:

print cb.get('loginAttempt::user::15').value

resiter = cb.query('wheepl', 'all_unsent_email')
for row in resiter:
    print row

Error:

Traceback (most recent call last):
  File "test.py", line 19, in <module>
    for row in resiter:
  File "/usr/local/lib/python2.7/dist-packages/couchbase/views/iterator.py", line 375, in __iter__
    raw_rows = self.raw.fetch(self._mres)
couchbase.exceptions.HTTPError: <RC=0x3B[HTTP Operation failed. Inspect status code for details],HTTP Request failed. Examine 'objextra' for full result, Results=1, C Source=(src/http.c,140), OBJ=ViewResult<RC=0x3B[HTTP Operation failed. Inspect status code for details], Value=None, HTTP=404>>

It does print the ‘loginAttempt::user::15’ document - I did that to make sure the connection was setup right. I did double check the view name - it is called ‘all_unsent_email’.

I’m not sure what I’m doing wrong :frowning:

This was working before I started trying to use XDCR to and the elasticsearch connector.

Thank you!

Is one platform in the XDCR Mac OS X? If so, the differing number of vbuckets may explain what you’re seeing.

@ingenthr - there isnt another couchbase XDCR server. its only replicating to elasticsearch via the couchbase elastic connector

Oh, that can’t be the reason then.

Assuming it’s Linux, you’ll want to look in /opt/couchbase/var/lib/couchbase/logs for the xdcr.log or xdcr_errors.log and see if what you may be able to find there. While you’re there, it’d be useful to have a look at the mapreduce_errors.log, where queries to views would go.

Based on what you find there, it may make sense to file an issue. If you want to give a complete set of logs, that’ll help us the most. Looking in the logs a bit and extracting anything interesting for the issue may help us find the issue faster. You can generate a Collect Info from the Web UI in >3.0) and file an issue.