apache / apache/couchdb

[Bug]: CouchDB crashes if Clouseau is not available after failed attempts to build search indexes for ddoc with several index functions

Open
#6,101 0 comments 0 reactions 0 assignees View on GitHub
bug needs-triage
Dominant language
Erlang
Stars
7k
Forks
1.1k
Avg merge
1d 16h
Merged PRs (30d)
9

Description

### Version

3.5.2 (also tried 3.3.1, the same behavior)

### Describe the problem you're encountering

CouchDB crashes if Clouseau is not available after failed attempts to build search indexes for ddoc with several index functions

### Expected Behaviour

Building indexes should be ignored if Clouseau is not available
Maybe there should be a config setting to explicitly disable Dreyfus, like it is for Nouveau
```
[nouveau]
enable = false

;suggestion
[dreyfus]
enable = false
```
There is no such thing https://docs.couchdb.org/en/latest/config/query-servers.html#dreyfus

### Steps to Reproduce

Run CouchDB with Docker Compose
```
services:
couchdb:
image: couchdb:3.5.2.1
ports:
- "5984:5984"
environment:
COUCHDB_USER: admin
COUCHDB_PASSWORD: couchdbadmin
```
- Login to Fauxton
- Setup single node instance
- Create `test` db
- Add ddoc with several index functions
```
{
"_id": "_design/legacy_ddoc",
"views": {},
"language": "javascript",
"indexes": {
"index0": { "index": "function (doc) { return; }" },
"index1": { "index": "function (doc) { return; }" },
"index2": { "index": "function (doc) { return; }" },
"index3": { "index": "function (doc) { return; }" },
"index4": { "index": "function (doc) { return; }" },
"index5": { "index": "function (doc) { return; }" },
"index6": { "index": "function (doc) { return; }" },
"index7": { "index": "function (doc) { return; }" },
"index8": { "index": "function (doc) { return; }" }
}
}
```
- Watch CouchDB logs

attached complete log file

[couch352logs.log](https://github.com/user-attachments/files/31636696/couch352logs.log)

### Your Environment

used Docker on MacOS
`docker version` output
```
Client:
Version: 29.1.3
API version: 1.52
Go version: go1.25.5
Git commit: f52814d
Built: Fri Dec 12 14:48:46 2025
OS/Arch: darwin/arm64
Context: desktop-linux

Server: Docker Desktop 4.55.0 (213807)
Engine:
Version: 29.1.3
API version: 1.52 (minimum version 1.44)
Go version: go1.25.5
Git commit: fbf3ed2
Built: Fri Dec 12 14:50:40 2025
OS/Arch: linux/arm64
Experimental: false
containerd:
Version: v2.2.0
GitCommit: 1c4457e00facac03ce1d75f7b6777a7a851e5c41
runc:
Version: 1.3.4
GitCommit: v1.3.4-0-gd6d73eb8
docker-init:
Version: 0.19.0
GitCommit: de40ad0
```

### Additional Context

I was replicating data from old CouchDB cluster which uses Clouseau to a new one (version 3.5.2, not going to use Clouseau anymore), was planning to update ddoc search indexes to use Nouveau after moving data.

Contributor guide

Open the contributing guide

Research direction

Start by running the provided Docker Compose setup, creating the database and multi-index design document, then inspect the attached CouchDB logs while Clouseau is unavailable. No source files or tests are named in the issue; done means CouchDB remains running and failed index builds are ignored or otherwise handled without a crash.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, erlang, javascript
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.