From e8664be1edd380e3f0cf1ddea977da965ef38715 Mon Sep 17 00:00:00 2001 From: drebs Date: Tue, 21 Nov 2017 20:37:49 -0200 Subject: [bug] properly log missing schema version in config doc --- src/leap/soledad/common/couch/check.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/leap/soledad/common/couch/check.py b/src/leap/soledad/common/couch/check.py index 93fc1d66..c82201bb 100644 --- a/src/leap/soledad/common/couch/check.py +++ b/src/leap/soledad/common/couch/check.py @@ -77,9 +77,13 @@ def _check_db_schema_version(url, db, auth, agent=None): elif res.code == 200: config_doc = yield res.json() + if SCHEMA_VERSION_KEY not in config_doc: + logger.error( + "Database has config document but no schema version: %s" % db) + raise WrongCouchSchemaVersionError(db) if config_doc[SCHEMA_VERSION_KEY] != SCHEMA_VERSION: logger.error( - "Unsupported database schema in database %s" % db) + "Unsupported database schema in database: %s" % db) raise WrongCouchSchemaVersionError(db) -- cgit v1.2.3