Couchbase
  • Why NoSQL?
  • Couchbase Server
  • Download
  • Resources
  • Careers
Home | Forums | Couchbase | Couchbase Server 2.0

unknown_error when querying a view after deleting keys

5 replies [Last post]
  • Login or register to post comments
Thu, 10/11/2012 - 02:49
digitalacorn
Offline
Joined: 09/20/2012
Groups: None

I'm running Couchbase 2.0 Beta (build-1723) on Ubuntu and connecting to it using the couchbase python client, a memcachecd python client and the memc module through NginX.

I have issues accessing views after deleting keys through the python memcached api (I have tried 'delete_multi' and looping over multiple 'delete' calls). I also get the same error when hitting the rest API through a web-browser:

For example:
http://127.0.0.1:8092/webcache/_design/cache/_view/cachegroups?stale=false&reduce=false&key=[%22userid%22,%223f840a8e5378e90fc4006222%22]

The following error is returned.
{"error":"unknown_error","reason":"badarg"}

The exact same query will work again after a few seconds.

Does anyone else get this problem, or is this a known issue?

Top
  • Login or register to post comments
Fri, 10/26/2012 - 08:15
deepkaran.salooja
Offline
Joined: 05/21/2012
Groups: None

Hi Peter,

A similar issue was fixed in later builds. Can you please download and try with more recent stable version (build 1870) and let me know if that helps.

Its available for download from the below link:
http://builds.hq.northscale.net/latestbuilds/couchbase-server-community_...

The 32bit version is also available on the link if you are using that.

Deep

Top
  • Login or register to post comments
Tue, 10/30/2012 - 04:26
digitalacorn
Offline
Joined: 09/20/2012
Groups: None

I have tried a build on here (windows 64 bit 2.0.0 enterprise edition (build-1915) ) The problem still manifests itself in this build, and in several earlier builds.

I do have more info for the developers though... The bug happens under the following conditions:

  1. A reduce function exists
  2. There are no keys emitted from the map function (because of conditions within the map function)
  3. A view query is issued with stale=false, reduce=false

Then the following output is emitted:

{"error":"unknown_error","reason":"badarg"}

expected output:

{"total_rows":0,"rows":[]}

Note: If the reduce function is removed or a built-in is specified then the problem does not manifest itself. I have tried replacing my reduce function with the count sample from the couchbase website (for sanity). But since we specify reduce=false in the view query the presence or not of a reduce function should not affect the output... but it does!

Any ideas on this and if this problem will be fixed for the next release?

 

Top
  • Login or register to post comments
Tue, 10/30/2012 - 08:14
Kheops
Offline
Joined: 09/19/2012
Groups: None

Hi,

This error happens on build 1916 as well (tested on Windows 7 64bit) but it doesn't happen on developer preview 4

Steps to reproduce:
create a view with map function:

function (doc, meta) {
}

and reduce function:
function (key, values, rereduce) {
  return 0;
}

In my case, the design doc is called test and view is called empty and CB is installed locally with default options so I browse there:
http://localhost:8092/default/_design/dev_test/_view/empty?reduce=false&...
And I get:
{"error":"unknown_error","reason":"badarg"}

If you remove the reduce function or replace it with any of the builtin _count,_sum or _stats, you get the expected result:
{"total_rows":0,"rows":[]}

This happens with or without docs in the bucket and on both dev/productions views.

This is, of course, an extreme case where the map function never emit any result to prove that the bug exist.
In normal environments, map functions almost always emit data but in some cases where emit is conditional, it could happen that no data is emitted, leading to this bug.

MB-7055: http://www.couchbase.com/issues/browse/MB-7055

Top
  • Login or register to post comments
Sun, 11/04/2012 - 23:41
digitalacorn
Offline
Joined: 09/20/2012
Groups: None

Thanks for the link I have tried a build on here (windows 64 bit 2.0.0 enterprise edition (build-1915) ) The problem still manifests itself in this build, and in several earlier builds.

I do have more info for the developers though... The bug happens under the following conditions:

  1. A reduce function exists
  2. There are no keys emitted from the map function (because of conditions within the map function)
  3. A view query is issued with stale=false, reduce=false

Then the following output is emitted:

{"error":"unknown_error","reason":"badarg"}

expected output:

{"total_rows":0,"rows":[

<strong>]&nbsp;}</strong>

Note: If the reduce function is removed or a built-in is specified then the problem does not manifest itself. I have tried replacing my reduce function with the count sample from the couchbase website (for sanity). But since we specify reduce=false in the view query the presence or not of a reduce function should not affect the output... but it does!

Any ideas on this and if this problem will be fixed for the next release?

 

Top
  • Login or register to post comments
Mon, 11/05/2012 - 04:32
deepkaran.salooja
Offline
Joined: 05/21/2012
Groups: None

The bug filed for this issue http://www.couchbase.com/issues/browse/MB-7055 has been fixed. Please try a build after 1931 (e.g. 1937).

Top
  • Login or register to post comments
  • Login or register to post comments
  • Login
  • Register

Company

  • About Us
  • Leadership
  • Customers
  • Partners
  • Contact Us

Product

  • Couchbase Server
  • Couchbase SDKs
  • Use Cases
  • Documentation
  • Forums

Open Source

  • Couchbase Project
  • Couchbase vs. CouchDB

Commercial

  • Subscriptions & Support
  • Training & Services

News

  • Blog
  • Newsletter
  • Press Releases
  • Buzz

Follow Us

    
  • Customer Login
  • Terms of Service
  • Privacy Policy
  • Trademark Policy
  • Site Map

© 2013 COUCHBASE All rights reserved.

Sign in to Couchbase Community

close
  • Create new account
  • Request new password
You are logging into the Forums, Wiki and Issue Tracker