Soledad-server refuses to start when soledad couchdb user is not present
When the soledad couch user is not present, soledad-server refuses to start with this:
Oct 12 16:18:28 unstable1 soledad-server[811]: Starting soledad: twistdTraceback (most recent call last): Oct 12 16:18:28 unstable1 soledad-server[811]: File "/usr/bin/twistd", line 18, in Oct 12 16:18:28 unstable1 soledad-server[811]: run() Oct 12 16:18:28 unstable1 soledad-server[811]: File "/usr/lib/python2.7/dist-packages/twisted/scripts/twistd.py", line 29, in run Oct 12 16:18:28 unstable1 soledad-server[811]: app.run(runApp, ServerOptions) Oct 12 16:18:28 unstable1 soledad-server[811]: File "/usr/lib/python2.7/dist-packages/twisted/application/app.py", line 638, in run Oct 12 16:18:28 unstable1 soledad-server[811]: config.parseOptions() Oct 12 16:18:28 unstable1 soledad-server[811]: File "/usr/lib/python2.7/dist-packages/twisted/application/app.py", line 605, in parseOptions Oct 12 16:18:28 unstable1 soledad-server[811]: usage.Options.parseOptions(self, options) Oct 12 16:18:28 unstable1 soledad-server[811]: File "/usr/lib/python2.7/dist-packages/twisted/python/usage.py", line 267, in parseOptions Oct 12 16:18:28 unstable1 soledad-server[811]: self.subOptions.parseOptions(rest) Oct 12 16:18:28 unstable1 soledad-server[811]: File "/usr/lib/python2.7/dist-packages/twisted/python/usage.py", line 255, in parseOptions Oct 12 16:18:28 unstable1 soledad-server[811]: self._dispatch[optMangled](optMangled, arg) Oct 12 16:18:28 unstable1 soledad-server[811]: File "/usr/lib/python2.7/dist-packages/twisted/python/usage.py", line 411, in Oct 12 16:18:28 unstable1 soledad-server[811]: fn = lambda name, value, m=method: m(value) Oct 12 16:18:28 unstable1 soledad-server[811]: File "/usr/lib/python2.7/dist-packages/twisted/web/tap.py", line 149, in opt_wsgi Oct 12 16:18:28 unstable1 soledad-server[811]: application = reflect.namedAny(name) Oct 12 16:18:28 unstable1 soledad-server[811]: File "/usr/lib/python2.7/dist-packages/twisted/python/reflect.py", line 303, in namedAny Oct 12 16:18:28 unstable1 soledad-server[811]: topLevelPackage = _importAndCheckStack(trialname) Oct 12 16:18:28 unstable1 soledad-server[811]: File "/usr/lib/python2.7/dist-packages/twisted/python/reflect.py", line 242, in _importAndCheckStack Oct 12 16:18:28 unstable1 soledad-server[811]: return __import__(importName) Oct 12 16:18:28 unstable1 soledad-server[811]: File "/usr/lib/python2.7/dist-packages/leap/soledad/server/__init__.py", line 275, in Oct 12 16:18:28 unstable1 soledad-server[811]: _couch_state = _get_couch_state() Oct 12 16:18:28 unstable1 soledad-server[811]: File "/usr/lib/python2.7/dist-packages/leap/soledad/server/__init__.py", line 270, in _get_couch_state Oct 12 16:18:28 unstable1 soledad-server[811]: state = CouchServerState(conf['couch_url'], create_cmd=conf['create_cmd']) Oct 12 16:18:28 unstable1 soledad-server[811]: File "/usr/lib/python2.7/dist-packages/leap/soledad/common/couch/state.py", line 82, in __init__ Oct 12 16:18:28 unstable1 soledad-server[811]: self._check_schema_versions() Oct 12 16:18:28 unstable1 soledad-server[811]: File "/usr/lib/python2.7/dist-packages/leap/soledad/common/couch/state.py", line 89, in _check_schema_versions Oct 12 16:18:28 unstable1 soledad-server[811]: for dbname in server: Oct 12 16:18:28 unstable1 soledad-server[811]: File "/usr/local/lib/python2.7/dist-packages/couchdb/client.py", line 100, in __iter__ Oct 12 16:18:28 unstable1 soledad-server[811]: status, headers, data = self.resource.get_json('_all_dbs') Oct 12 16:18:28 unstable1 soledad-server[811]: File "/usr/local/lib/python2.7/dist-packages/couchdb/http.py", line 510, in get_json Oct 12 16:18:28 unstable1 soledad-server[811]: return self._request_json('GET', path, headers=headers, **params) Oct 12 16:18:28 unstable1 soledad-server[811]: File "/usr/local/lib/python2.7/dist-packages/couchdb/http.py", line 533, in _request_json Oct 12 16:18:28 unstable1 soledad-server[811]: headers=headers, **params) Oct 12 16:18:28 unstable1 soledad-server[811]: File "/usr/local/lib/python2.7/dist-packages/couchdb/http.py", line 529, in _request Oct 12 16:18:28 unstable1 soledad-server[811]: credentials=self.credentials) Oct 12 16:18:28 unstable1 soledad-server[811]: File "/usr/local/lib/python2.7/dist-packages/couchdb/http.py", line 375, in request Oct 12 16:18:28 unstable1 soledad-server[811]: raise Unauthorized(error) Oct 12 16:18:28 unstable1 soledad-server[811]: couchdb.http.Unauthorized: (u'unauthorized', u'Name or password is incorrect.') Oct 12 16:18:28 unstable1 soledad-server[811]: .
I looked in the failing pipeline and saw that the starting of soledad is done before the
15:17:39.523 - [pixelated] Notice: /Stage[main]/Soledad::Server/Service[soledad-server]: Triggered 'refresh' from 6 events ... 15:25:51.034 - [pixelated] Notice: /Stage[main]/Site_couchdb::Create_dbs/Couchdb::Create_db[shared]/Couchdb::Document[shared_security]/Exec[couch-doc-update --netrc-file /etc/couchdb/couchdb.netrc --host 127.0.0.1:5984 --db shared --id _security --data '{ "admins": {"names": [], "roles": [] }, "members": { "names": ["soledad"], "roles": ["replication"] } }']/returns: executed successfully ... 15:26:03.302 - [pixelated] Notice: /Stage[main]/Site_couchdb::Add_users/Couchdb::Add_user[soledad]/Couchdb::Document[update_user_soledad]/Exec[couch-doc-update --netrc-file /etc/couchdb/couchdb.netrc --host 127.0.0.1:5984 --db _users --id org.couchdb.user:soledad --data '{"type": "user", "name": "soledad", "roles": ["tokens"], "password_sha": "58b667309354d478ed2a67e2221eb7440775c1fb", "salt": "15b96227a5763bfbdb2985b72359fc8c"}']/returns: executed successfully 15:26:03.304 - [pixelated] Notice: /Stage[main]/Site_couchdb::Add_users/Couchdb::Add_user[soledad]/Couchdb::Query::Setup[soledad]/File[/etc/couchdb/couchdb-soledad.netrc]/ensure: defined content as '{md5}925348a2f2ad813b98da40e5a4ae1dfe'
(from redmine: created on 2016-10-12)