Critical error: "Parsing redeem response failed"
Created by: crwood
After adding a (valid/paid-for) voucher and restarting the tahoe
client I sometimes run into the following error (observed in tahoe run
's stdout), which, seemingly prevents the redemption process from completing:
>>> 2020-03-11T13:48:38-0400 [_zkapauthorizer.controller.RistrettoRedeemer#critical] Parsing redeem response failed
>>> Traceback (most recent call last):
>>> File "site-packages/twisted/internet/defer.py", line 654, in _runCallbacks
>>> File "site-packages/twisted/internet/defer.py", line 1475, in gotResult
>>> File "site-packages/twisted/internet/defer.py", line 1416, in _inlineCallbacks
>>> File "site-packages/twisted/python/failure.py", line 512, in throwExceptionIntoGenerator
>>> --- <exception caught here> ---
>>> File "site-packages/_zkapauthorizer/controller.py", line 436, in redeem
>>> File "site-packages/twisted/internet/defer.py", line 654, in _runCallbacks
>>> File "site-packages/treq/content.py", line 101, in <lambda>
>>> File "json/__init__.py", line 339, in loads
>>> File "json/decoder.py", line 364, in decode
>>> File "json/decoder.py", line 382, in raw_decode
>>> exceptions.ValueError: No JSON object could be decoded
>>> 2020-03-11T13:48:38-0400 [_zkapauthorizer.controller.PaymentController#error] Redeeming random tokens for a voucher (MvQK7iCI5F07iGax92jgo-LMBtJ_DNbEn-pbsxRcSwOE) failed: [Failure instance: Traceback: <type 'exceptions.ValueError'>: No JSON object could be decoded
>>> site-packages/twisted/internet/defer.py:501:errback
>>> site-packages/twisted/internet/defer.py:568:_startRunCallbacks
>>> site-packages/twisted/internet/defer.py:654:_runCallbacks
>>> site-packages/twisted/internet/defer.py:1475:gotResult
>>> --- <exception caught here> ---
>>> site-packages/twisted/internet/defer.py:1418:_inlineCallbacks
>>> site-packages/_zkapauthorizer/controller.py:793:bracket
>>> site-packages/twisted/internet/defer.py:1416:_inlineCallbacks
>>> site-packages/twisted/python/failure.py:512:throwExceptionIntoGenerator
>>> site-packages/_zkapauthorizer/controller.py:436:redeem
>>> site-packages/twisted/internet/defer.py:654:_runCallbacks
>>> site-packages/treq/content.py:101:<lambda>
>>> json/__init__.py:339:loads
>>> json/decoder.py:364:decode
>>> json/decoder.py:382:raw_decode
>>> ]
>>> 2020-03-11T13:48:38-0400 [twisted.web.client._HTTP11ClientFactory#info] Stopping factory _HTTP11ClientFactory(<function quiescentCallback at 0x71984f35f1d0>, <twisted.internet.endpoints._WrapperEndpoint object at 0x71984f4b5750>)
I'm not (yet) sure what triggers it, as the behavior seems intermittent, however, it is probably worth catching/handling this exception nonetheless.