Comment 0 for bug 1190986

Revision history for this message
Konrad Meier (konrad-meier) wrote : ERROR Nonce already used

The error below happens sometimes. (~5% of all requests fail)

System: Ubuntu 12.04.2
MAAS-version: 1.2+bzr1373+dfsg-0ubuntu1~12.04.1
Juju-version: 0.7+bzr628+bzr631~precise1

$ juju status
2013-06-14 13:59:36,213 INFO Connecting to environment...
2013-06-14 13:59:36,295 ERROR Cannot connect to environment: Nonce already used: 55941407
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/juju/providers/common/connect.py", line 43, in run
    client = yield self._internal_connect(share)
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1037, in _inlineCallbacks
    result = result.throwExceptionIntoGenerator(g)
  File "/usr/lib/python2.7/dist-packages/twisted/python/failure.py", line 382, in throwExceptionIntoGenerator
    return g.throw(self.type, self.value, self.tb)
  File "/usr/lib/python2.7/dist-packages/juju/providers/common/connect.py", line 59, in _internal_connect
    candidates = yield self._provider.get_zookeeper_machines()
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1037, in _inlineCallbacks
    result = result.throwExceptionIntoGenerator(g)
  File "/usr/lib/python2.7/dist-packages/twisted/python/failure.py", line 382, in throwExceptionIntoGenerator
    return g.throw(self.type, self.value, self.tb)
  File "/usr/lib/python2.7/dist-packages/juju/providers/common/findzookeepers.py", line 32, in find_zookeepers
    machine = yield provider.get_machine(instance_id)
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1037, in _inlineCallbacks
    result = result.throwExceptionIntoGenerator(g)
  File "/usr/lib/python2.7/dist-packages/twisted/python/failure.py", line 382, in throwExceptionIntoGenerator
    return g.throw(self.type, self.value, self.tb)
  File "/usr/lib/python2.7/dist-packages/juju/providers/maas/provider.py", line 125, in get_machines
    instances = yield self.maas_client.get_nodes(instance_ids)
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 545, in _runCallbacks
    current.result = callback(current.result, *args, **kw)
  File "/usr/lib/python2.7/dist-packages/juju/providers/maas/maas.py", line 95, in _process_error
    raise ProviderError(error.response)
ProviderError: Nonce already used: 55941407
2013-06-14 13:59:36,297 ERROR Nonce already used: 55941407

I think the problem is caused by the MAAS-database table "piston_nonce"
In my system this table contains a hughe amount of tokens that are never deleted:
maasdb=# SELECT count(id) FROM piston_nonce;
  count
---------
 3619099
(1 row)