ValueError: 'missing' must not be set for required fields.
infa-niksingh opened this issue · comments
I'm getting
ValueError: 'missing' must not be set for required fields.
error message when I'm running
aardvark config
(aardvark) [ec2-user@ip-172-18-0-103 aardvark]$ aardvark config
Traceback (most recent call last):
File "/home/ec2-user/.virtualenvs/aardvark/bin/aardvark", line 11, in <module>
load_entry_point('aardvark', 'console_scripts', 'aardvark')()
└ <function load_entry_point at 0x7fba5d91e048>
File "/home/ec2-user/.virtualenvs/aardvark/lib/python3.7/site-packages/pkg_resources/__init__.py", line 487, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
│ │ │ └ 'aardvark'
│ │ └ 'console_scripts'
│ └ 'aardvark'
└ <function get_distribution at 0x7fba5d911f28>
File "/home/ec2-user/.virtualenvs/aardvark/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2728, in load_entry_point
return ep.load()
└ EntryPoint.parse('aardvark = aardvark.manage:main')
File "/home/ec2-user/.virtualenvs/aardvark/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2346, in load
return self.resolve()
└ EntryPoint.parse('aardvark = aardvark.manage:main')
File "/home/ec2-user/.virtualenvs/aardvark/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2352, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
└ EntryPoint.parse('aardvark = aardvark.manage:main')
File "/home/ec2-user/aardvark/aardvark/manage.py", line 14, in <module>
from swag_client.util import parse_swag_config_options
File "/home/ec2-user/.virtualenvs/aardvark/lib/python3.7/site-packages/swag_client-0.2.10-py3.7.egg/swag_client/util.py", line 8, in <module>
class OptionsSchema(Schema):
File "/home/ec2-user/.virtualenvs/aardvark/lib/python3.7/site-packages/swag_client-0.2.10-py3.7.egg/swag_client/util.py", line 10, in OptionsSchema
namespace = fields.String(required=True, missing='accounts')
└ <module 'marshmallow.fields' from '/home/ec2-user/.virtualenvs/aardvark/lib/python3.7/site-packages/marshmallow-3.0.0rc3-py3.7.e...
File "/home/ec2-user/.virtualenvs/aardvark/lib/python3.7/site-packages/marshmallow-3.0.0rc3-py3.7.egg/marshmallow/fields.py", line 162, in __init__
raise ValueError(''missing' must not be set for required fields.')
ValueError: 'missing' must not be set for required fields.
This error message is in both python 2.7 and 3.7
I'm able to fix it by modifying file /home/ec2-user/.virtualenvs/aardvark/lib/python2.7/site-packages/swag_client-0.2.10-py2.7.egg/swag_client/util.py and changing namespace = fields.String(required=True, missing='accounts') to namespace = fields.String(required=False, missing='accounts')
Though, I'm not sure what might be breaking because of that.
I'm unable to reproduce this:
(aardvark) ➜ aardvark git:(master) aardvark config
No config
Aardvark can use SWAG to look up accounts. See https://github.com/Netflix-Skunkworks/swag-client
Do you use SWAG to track accounts? [yN]: y
SWAG_BUCKET [swag-data]: bla
ROLENAME [Aardvark]:
DATABASE URI [sqlite:////Users/tmcpeak/Documents/projects/aardvark/aardvark.db]:
# THREADS [5]:
>> Writing to config.py
@infa-niksingh @mcpeak I changed setup.py to pull swag-client 0.4.6 and change Queue to queue (using python 3.7.2) and I'm able to get the api_server running.
Huh, I'm still struggling to reproduce this. @foglogle are you seeing the same issue as @infa-niksingh generating config?
yeah, whether I use python 2.7 or 3.7 using swag-client 0.2.10 I get the same issue with missing accounts. Once I updated swag-client 0.4.6 I was able to get up and going just fine.
Interesting, I'll cut an upgrade and deploy to test instance. Thanks for reporting.
If you want to reproduce, I'm able to do it consistently with this Dockerfile
docker build -t aardvark-test -f Dockerfile .
FROM python:2.7
RUN cd /opt && \
git clone https://github.com/Netflix-Skunkworks/aardvark.git && \
cd aardvark && \
python setup.py develop && \
aardvark config