.couch files becomes .couch.locked and unable to restore databases #4045
-
all the files become .locked and unable to restore the database. Got the following errors: This is a single node server
|
Beta Was this translation helpful? Give feedback.
Replies: 11 comments 15 replies
-
CouchDB doesn't create |
Beta Was this translation helpful? Give feedback.
-
Thanks for the response. Not using any software for backup or restore. This .locked issue happened out of no where on my product instance. Lost all the data since couldn’t do anything with the .couch.locked files.
Now setting another server to replicate every hour from the production DB. Any suggestions on how to stop data loss due to corruption of .couch file in the future? Thanks in advance.
Get Outlook for iOS<https://aka.ms/o0ukef>
…________________________________
From: Nick Vatamaniuc ***@***.***>
Sent: Wednesday, June 1, 2022 8:56:36 PM
To: apache/couchdb ***@***.***>
Cc: Ahmed Saif Reza ***@***.***>; Author ***@***.***>
Subject: Re: [apache/couchdb] .couch files becomes .couch.locked and unable to restore databases (Discussion #4045)
CouchDB doesn't create .locked files. I am not sure why that is happening. Since you mentioned "restore", since CouchDB doesn't have a built-in backup/restore feature, perhaps it's the software used to restore database files?
—
Reply to this email directly, view it on GitHub<#4045 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AJXRUZAUYXKQFTRFFC5JU3DVM522JANCNFSM5XQAMNMQ>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
If you're not aware of any application you run which creates those files, there is a good chance it's from a ransomware virus https://fileinfo.com/extension/locked You can check if the criminals left a note, like readme txt file of some sort, in the home or root directory, which would confirm that theory. |
Beta Was this translation helpful? Give feedback.
-
@ozgursel you can make sure that the shard files in the _dbs db match up with the shard map. https://docs.couchdb.com/en/3.2.2/cluster/index.html You can make a new database named differently, (say newdb1) with the same Q sharding factor and see what the _dbs shard doc looks like. Then re-create the clustered db doc for your db to match. |
Beta Was this translation helpful? Give feedback.
-
@ozgursel you can read the docs from either the :5986 localhost port (a node-local port) or from the :5984/_node/_local/$shardname paths |
Beta Was this translation helpful? Give feedback.
-
@nickva Is it a possible 0-day vulnerability on CouchDB? |
Beta Was this translation helpful? Give feedback.
-
As a general (and obvious) note you should not pay ransomware authors but restore from a backup on to a clean, secured replacement server. obviously that is not always an option. If you have recovered your shard files (shards/000-FFF/blah123.couch, etc) you can recreate the _dbs database manually. The format is not documented but it's fairly simple, an example is below. shard_suffix is an erlang string of the If you uncover any evidence to suggest your served was compromised via couchdb we are very interested to hear any and all details.
|
Beta Was this translation helpful? Give feedback.
-
It would be great if @ahmedsaifreza, @paragasu and @ozgursel could tell us which version of CouchDB they are each running, so we can eliminate previously patched security vulnerabilities from consideration. |
Beta Was this translation helpful? Give feedback.
-
oh and Operating System and version would help too. |
Beta Was this translation helpful? Give feedback.
If you're not aware of any application you run which creates those files, there is a good chance it's from a ransomware virus https://fileinfo.com/extension/locked
You can check if the criminals left a note, like readme txt file of some sort, in the home or root directory, which would confirm that theory.