Skip to content

🐞 MissingValueError on Guardian Decrypt #739

@lprichar

Description

@lprichar

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Occasionally an error will occur when guardians are decrypting in the GUI. Here's the relevant logs and stack trace:

2022-08-03 15:40:32.342135 DEBUG Starting main app
2022-08-03 15:40:32.342135 DEBUG Verifying database connection
2022-08-03 15:40:32.866290 DEBUG Starting eel
2022-08-03 15:40:35.405347 DEBUG Watching database
2022-08-03 15:40:36.197479 DEBUG Stopping watch database
2022-08-03 15:40:36.871910 DEBUG exited watching database
2022-08-03 15:40:42.730435 DEBUG Watching database
2022-08-03 16:22:33.088349 DEBUG new delta found for decryptions 62ead908b514c0521b66bd33
2022-08-03 16:22:38.743689 DEBUG Stopping watch database
2022-08-03 16:22:38.810225 DEBUG watching decryption '62ead908b514c0521b66bd33'
2022-08-03 16:22:46.705829 INFO  S1: 2 decrypting  62ead908b514c0521b66bd33
2022-08-03 16:22:46.803114 DEBUG loading guardian from C:\Users\eg202\documents\code\electionguard-python\gui_private_keys\62ea94cab65249d79ddd6ad0\guardian_2.json
2022-08-03 16:22:49.369442 ERROR missing value for field "contests.ballot_selections.proof.proof_one_data"
Traceback (most recent call last):
  File "C:\Users\eg202\documents\code\electionguard-python\.venv\lib\site-packages\dacite\core.py", line 59, in from_dict
    field_data = data[field.name]
KeyError: 'proof_one_data'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\eg202\documents\code\electionguard-python\.venv\lib\site-packages\dacite\core.py", line 71, in from_dict
    value = get_default_value_for_field(field)
  File "C:\Users\eg202\documents\code\electionguard-python\.venv\lib\site-packages\dacite\dataclasses.py", line 21, in get_default_value_for_field
    raise DefaultValueNotFoundError()
dacite.dataclasses.DefaultValueNotFoundError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\eg202\Documents\code\electionguard-python\src\electionguard_gui\components\view_decryption_component.py", line 98, in join_decryption
    self._decryption_s1_join_service.run(db, decryption)
  File "C:\Users\eg202\Documents\code\electionguard-python\src\electionguard_gui\services\decryption_stages\decryption_s1_join_service.py", line 24, in run
    ballots = self._ballot_upload_service.get_ballots(db, election.id)
  File "C:\Users\eg202\Documents\code\electionguard-python\src\electionguard_gui\services\ballot_upload_service.py", line 69, in get_ballots
    ballot = from_raw(SubmittedBallot, ballot_str)
  File "C:\Users\eg202\Documents\code\electionguard-python\src\electionguard\serialize.py", line 71, in from_raw
    return from_dict(type_, json.loads(raw), _config)
  File "C:\Users\eg202\documents\code\electionguard-python\.venv\lib\site-packages\dacite\core.py", line 63, in from_dict
    value = _build_value(type_=field.type, data=transformed_value, config=config)
  File "C:\Users\eg202\documents\code\electionguard-python\.venv\lib\site-packages\dacite\core.py", line 90, in _build_value
    return _build_value_for_collection(collection=type_, data=data, config=config)
  File "C:\Users\eg202\documents\code\electionguard-python\.venv\lib\site-packages\dacite\core.py", line 140, in _build_value_for_collection
    return data_type(_build_value(type_=item_type, data=item, config=config) for item in data)
  File "C:\Users\eg202\documents\code\electionguard-python\.venv\lib\site-packages\dacite\core.py", line 140, in <genexpr>
    return data_type(_build_value(type_=item_type, data=item, config=config) for item in data)
  File "C:\Users\eg202\documents\code\electionguard-python\.venv\lib\site-packages\dacite\core.py", line 92, in _build_value
    return from_dict(data_class=type_, data=data, config=config)
  File "C:\Users\eg202\documents\code\electionguard-python\.venv\lib\site-packages\dacite\core.py", line 63, in from_dict
    value = _build_value(type_=field.type, data=transformed_value, config=config)
  File "C:\Users\eg202\documents\code\electionguard-python\.venv\lib\site-packages\dacite\core.py", line 90, in _build_value
    return _build_value_for_collection(collection=type_, data=data, config=config)
  File "C:\Users\eg202\documents\code\electionguard-python\.venv\lib\site-packages\dacite\core.py", line 140, in _build_value_for_collection
    return data_type(_build_value(type_=item_type, data=item, config=config) for item in data)
  File "C:\Users\eg202\documents\code\electionguard-python\.venv\lib\site-packages\dacite\core.py", line 140, in <genexpr>
    return data_type(_build_value(type_=item_type, data=item, config=config) for item in data)
  File "C:\Users\eg202\documents\code\electionguard-python\.venv\lib\site-packages\dacite\core.py", line 92, in _build_value
    return from_dict(data_class=type_, data=data, config=config)
  File "C:\Users\eg202\documents\code\electionguard-python\.venv\lib\site-packages\dacite\core.py", line 63, in from_dict
    value = _build_value(type_=field.type, data=transformed_value, config=config)
  File "C:\Users\eg202\documents\code\electionguard-python\.venv\lib\site-packages\dacite\core.py", line 88, in _build_value
    return _build_value_for_union(union=type_, data=data, config=config)
  File "C:\Users\eg202\documents\code\electionguard-python\.venv\lib\site-packages\dacite\core.py", line 99, in _build_value_for_union
    return _build_value(type_=types[0], data=data, config=config)
  File "C:\Users\eg202\documents\code\electionguard-python\.venv\lib\site-packages\dacite\core.py", line 92, in _build_value
    return from_dict(data_class=type_, data=data, config=config)
  File "C:\Users\eg202\documents\code\electionguard-python\.venv\lib\site-packages\dacite\core.py", line 75, in from_dict
    raise MissingValueError(field.name)
dacite.exceptions.MissingValueError: missing value for field "contests.ballot_selections.proof.proof_one_data"
2022-08-03 16:22:57.093061 DEBUG Watching database
2022-08-03 16:22:59.142694 DEBUG Stopping watch database
2022-08-03 16:22:59.195905 DEBUG watching decryption '62ead908b514c0521b66bd33'
2022-08-03 16:23:02.423777 INFO  S1: 2 decrypting  62ead908b514c0521b66bd33
2022-08-03 16:23:02.516818 DEBUG loading guardian from C:\Users\eg202\documents\code\electionguard-python\gui_private_keys\62ea94cab65249d79ddd6ad0\guardian_2.json
2022-08-03 16:23:04.197407 ERROR missing value for field "contests.ballot_selections.proof.proof_one_pad"
Traceback (most recent call last):
  File "C:\Users\eg202\documents\code\electionguard-python\.venv\lib\site-packages\dacite\core.py", line 59, in from_dict
    field_data = data[field.name]
KeyError: 'proof_one_pad'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\eg202\documents\code\electionguard-python\.venv\lib\site-packages\dacite\core.py", line 71, in from_dict
    value = get_default_value_for_field(field)
  File "C:\Users\eg202\documents\code\electionguard-python\.venv\lib\site-packages\dacite\dataclasses.py", line 21, in get_default_value_for_field
    raise DefaultValueNotFoundError()
dacite.dataclasses.DefaultValueNotFoundError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\eg202\Documents\code\electionguard-python\src\electionguard_gui\components\view_decryption_component.py", line 98, in join_decryption
    self._decryption_s1_join_service.run(db, decryption)
  File "C:\Users\eg202\Documents\code\electionguard-python\src\electionguard_gui\services\decryption_stages\decryption_s1_join_service.py", line 24, in run
    ballots = self._ballot_upload_service.get_ballots(db, election.id)
  File "C:\Users\eg202\Documents\code\electionguard-python\src\electionguard_gui\services\ballot_upload_service.py", line 69, in get_ballots
    ballot = from_raw(SubmittedBallot, ballot_str)
  File "C:\Users\eg202\Documents\code\electionguard-python\src\electionguard\serialize.py", line 71, in from_raw
    return from_dict(type_, json.loads(raw), _config)
  File "C:\Users\eg202\documents\code\electionguard-python\.venv\lib\site-packages\dacite\core.py", line 63, in from_dict
    value = _build_value(type_=field.type, data=transformed_value, config=config)
  File "C:\Users\eg202\documents\code\electionguard-python\.venv\lib\site-packages\dacite\core.py", line 90, in _build_value
    return _build_value_for_collection(collection=type_, data=data, config=config)
  File "C:\Users\eg202\documents\code\electionguard-python\.venv\lib\site-packages\dacite\core.py", line 140, in _build_value_for_collection
    return data_type(_build_value(type_=item_type, data=item, config=config) for item in data)
  File "C:\Users\eg202\documents\code\electionguard-python\.venv\lib\site-packages\dacite\core.py", line 140, in <genexpr>
    return data_type(_build_value(type_=item_type, data=item, config=config) for item in data)
  File "C:\Users\eg202\documents\code\electionguard-python\.venv\lib\site-packages\dacite\core.py", line 92, in _build_value
    return from_dict(data_class=type_, data=data, config=config)
  File "C:\Users\eg202\documents\code\electionguard-python\.venv\lib\site-packages\dacite\core.py", line 63, in from_dict
    value = _build_value(type_=field.type, data=transformed_value, config=config)
  File "C:\Users\eg202\documents\code\electionguard-python\.venv\lib\site-packages\dacite\core.py", line 90, in _build_value
    return _build_value_for_collection(collection=type_, data=data, config=config)
  File "C:\Users\eg202\documents\code\electionguard-python\.venv\lib\site-packages\dacite\core.py", line 140, in _build_value_for_collection
    return data_type(_build_value(type_=item_type, data=item, config=config) for item in data)
  File "C:\Users\eg202\documents\code\electionguard-python\.venv\lib\site-packages\dacite\core.py", line 140, in <genexpr>
    return data_type(_build_value(type_=item_type, data=item, config=config) for item in data)
  File "C:\Users\eg202\documents\code\electionguard-python\.venv\lib\site-packages\dacite\core.py", line 92, in _build_value
    return from_dict(data_class=type_, data=data, config=config)
  File "C:\Users\eg202\documents\code\electionguard-python\.venv\lib\site-packages\dacite\core.py", line 63, in from_dict
    value = _build_value(type_=field.type, data=transformed_value, config=config)
  File "C:\Users\eg202\documents\code\electionguard-python\.venv\lib\site-packages\dacite\core.py", line 88, in _build_value
    return _build_value_for_union(union=type_, data=data, config=config)
  File "C:\Users\eg202\documents\code\electionguard-python\.venv\lib\site-packages\dacite\core.py", line 99, in _build_value_for_union
    return _build_value(type_=types[0], data=data, config=config)
  File "C:\Users\eg202\documents\code\electionguard-python\.venv\lib\site-packages\dacite\core.py", line 92, in _build_value
    return from_dict(data_class=type_, data=data, config=config)
  File "C:\Users\eg202\documents\code\electionguard-python\.venv\lib\site-packages\dacite\core.py", line 75, in from_dict
    raise MissingValueError(field.name)
dacite.exceptions.MissingValueError: missing value for field "contests.ballot_selections.proof.proof_one_pad

Expected Behavior

No response

Steps To Reproduce

No response

Environment

- OS:

Anything else?

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions