alecthomas / alecthomas/voluptuous

MultipleInvalid error reporting path is unpredictable

Open
#239 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.9k
Forks
237
PR merge metrics
No merged PRs in 30d

Description

I've been trying to debug an unpredictable failure in some of my code, which I'll attach. Sometimes when I run this I get the following traceback:

```
% python3 bug.py
Traceback (most recent call last):
File "bug.py", line 201, in
main()
File "bug.py", line 198, in main
GadgetYAML(yaml)
File "/usr/lib/python3/dist-packages/voluptuous/schema_builder.py", line 192, in __call__
return self._compiled([], data)
File "/usr/lib/python3/dist-packages/voluptuous/schema_builder.py", line 486, in validate_dict
return base_validate(path, iteritems(data), out)
File "/usr/lib/python3/dist-packages/voluptuous/schema_builder.py", line 324, in validate_mapping
raise er.MultipleInvalid(errors)
voluptuous.error.MultipleInvalid: extra keys not allowed @ data['volumes']['first-image']['structure'][0]['content'][0]['offset-write']
```

Other times I get this traceback:

```
% python3 bug.py
Traceback (most recent call last):
File "bug.py", line 201, in
main()
File "bug.py", line 198, in main
GadgetYAML(yaml)
File "/usr/lib/python3/dist-packages/voluptuous/schema_builder.py", line 192, in __call__
return self._compiled([], data)
File "/usr/lib/python3/dist-packages/voluptuous/schema_builder.py", line 486, in validate_dict
return base_validate(path, iteritems(data), out)
File "/usr/lib/python3/dist-packages/voluptuous/schema_builder.py", line 324, in validate_mapping
raise er.MultipleInvalid(errors)
voluptuous.error.MultipleInvalid: extra keys not allowed @ data['volumes']['first-image']['structure'][0]['content'][0]['image']
```

Notice that the path reported is different. You may have to run the script multiple times to see the difference as it appears to be completely random. I don't *think* it's related to PYTHONHASHSEED since the randomness is still present when I explicitly set PYTHONHASHSEED.

Ubuntu 16.10; Python 3.5.2+; voluptuous 0.9.3

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.