Comments (7)
hi, this looks like data corruption to me. The binary in question is a kp_node
but it is somehow truncated or otherwise invalid.
from couchdb.
Agree with @rnewson.
<<131,0,104,2,100,0,7,107,112,95...
The first byte 131
looked like a proper initial marker of an uncompressed term.
It's not followed by 80, so it's not compressed
couchdb/src/couch/src/couch_compress.erl
Lines 22 to 26 in c93940a
0
following 131
seems odd on first look at https://www.erlang.org/doc/apps/erts/erl_ext_dist.html#introduction. The next 104,2
looks like a proper small tuple
Which is probably what we might expect in a kp node.
But turning a tuple into a binary doesn't show a 0 after 131
> erlang:term_to_binary({a, b}).
<<131,104,2,100,0,1,97,100,0,1,98>>
What version of CouchDB, Erlang, OS, architecture you're running? Wonder if you backed up, or restored the data at any point. Of if there is any way to reproduce the issue?
from couchdb.
Hello,
Thanks for the feedback.
I am using CouchDB via Community Health Toolkit (CHT).
Docker image can be found here: https://staging.dev.medicmobile.org/_couch/builds_4/medic:medic:4.5.0/docker-compose/cht-couchdb.yml but I can't tell the version.
This error emerged from a system upgrade which required all views to be indexed before migration to the new version. This takes place automatically in the backend but there was crash a couple of times during migration that resulted me to revert to a backed up version (Whole Image & Files of the VM).
Afterwards, the upgrade was successful, all views were indexed and the system started running on a new version. After a couple of hours this error started popping up, which resulted to CouchDB container restarting unexpectedly. My database size is more than 2GB and growing.
from couchdb.
That image contains CouchDB 3.3.2.
from couchdb.
so I think this is data corruption somehow, you'll need to try earlier backups until something works but we're very curious as to how this might have happened. If you have the details of the storage subsystem (filesystem, disks, any virtualisation between couchdb and the storage device, and any relevant settings on reordering or fsyncing) we'd love to hear them.
from couchdb.
Actually reverting back to earlier backups might not be an option for me since it has been a month and I might loose the current state of the database. Is there a means of repairing the corrupted data? Can I adjust the configuration to make CouchDB container error tolerant to prevent failure/restart?
Running on Ubuntu VM, docker system where everything is stored on the local disk.
from couchdb.
CouchDB is built as a "crash only" system, meaning that the couchdb process is always ready to be killed, there's no shutdown code, no need to call sync
manually, etc. When a document is written, and the 200 OK returned, CouchDB has already done everything it can to persist the data to disk (including fsync()
calls). At startup CouchDB will read from the end of each file looking for the latest valid header.
Without knowing how the files were corrupted it is hard to know what to recommend and, unfortunately, there are no tools we publish to repair a corrupted .couch
file. At best we might be able to build an erlang script that would attempt to extract the document bodies inside the .couch files, though that would be shorn of a number of details (the doc id being the most significant as it is stored in a different location to the body, the corrupted btree index would be able to find it).
Have you perhaps replicated this database elsewhere recently? that could be another source of backup.
from couchdb.
Related Issues (20)
- Warn users of impact when deleting a view via Fauxton HOT 1
- Potential pattern of ignoring stranded RPC workers HOT 4
- nonode@nohost couch file epoch error HOT 3
- Query Server protocol future/stability. HOT 1
- CouchDB fails to start due to unacceptable_rsa_key after upgrading the erlang version HOT 6
- Compiler warnings for OTP 27 HOT 2
- Allow specifying password files instead of cleartext HOT 4
- Clarification on supported versions HOT 7
- couch lru function clause error HOT 3
- `[admins]` config not hashed and updated in local.ini if any config files exist in local.d
- Query exporting only 2ˆ28 documents (data have more) even after setting query limit to 2ˆ29 HOT 1
- Unix domain socket support HOT 1
- Basic Authentication for `_utils` does not work if `require_valid_user_except_for_up` is set HOT 1
- $in and $or too slow for large database (doesn´t use index) HOT 3
- Error loop with system freeze when removing a node from a cluster HOT 4
- core dump, docker official image, export ERL_FLAGS=" -name couchdb " HOT 2
- Too Many Pending Connections HOT 3
- live change feed with limit never completes HOT 3
- Broken changes feeds with descending=true and limit over total
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from couchdb.