aws / aws-cli

Universal Command Line Interface for Amazon Web Services
Other
15.55k stars 4.13k forks source link

aws dynamodb put-item dies with `No module names _parseaddr` #1726

Closed foretspaisibles closed 8 years ago

foretspaisibles commented 8 years ago

I am populating to DynamoDB table for testing purposes. In a local instance, I prepared a table Music as in the tutorial. Inserting item with aws dynamodb put-item dies unexpectedly with the message No module names _parseaddr after 433 succesful insertions.


Full traceback

          Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/aws", line 19, in <module>
    import awscli.clidriver
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/awscli/clidriver.py", line 17, in <module>
    import botocore.session
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/botocore/session.py", line 25, in <module>
    import botocore.config
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/botocore/config.py", line 18, in <module>
    from botocore.compat import six
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/botocore/compat.py", line 21, in <module>
    from botocore.vendored.requests.packages.urllib3 import exceptions
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/botocore/vendored/requests/__init__.py", line 58, in <module>
    from . import utils
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/botocore/vendored/requests/utils.py", line 26, in <module>
    from .compat import parse_http_list as _parse_list_header
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/botocore/vendored/requests/compat.py", line 7, in <module>
    from .packages import chardet
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/botocore/vendored/requests/packages/__init__.py", line 3, in <module>
    from . import urllib3
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/botocore/vendored/requests/packages/urllib3/__init__.py", line 10, in <module>
    from .connectionpool import (
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/botocore/vendored/requests/packages/urllib3/connectionpool.py", line 37, in <module>
    from .request import RequestMethods
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/botocore/vendored/requests/packages/urllib3/request.py", line 6, in <module>
    from .filepost import encode_multipart_formdata
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/botocore/vendored/requests/packages/urllib3/filepost.py", line 8, in <module>
    from .fields import RequestField
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/botocore/vendored/requests/packages/urllib3/fields.py", line 1, in <module>
    import email.utils
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/email/utils.py", line 32, in <module>
    from email._parseaddr import quote
ImportError: No module named _parseaddr

Command line that triggered the error

"aws"; "--endpoint-url";
                                  "http://localhost:8000"; "dynamodb";
                                  "put-item"; "--cli-input-json";
                                  "{\"TableName\":\"Music\",\"Item\":{\"Artist\":{\"S\":\"Boiling Little Schoolgirl\"},\"SongTitle\":{\"S\":\"One Million Last Dance in the Forest you once called Home\"},\"AlbumTitle\":{\"S\":\"Do you remember the Garden of your Dreams\"},\"Year\":{\"N\":\"1992\"},\"Genre\":{\"S\":\"Random Noise\"}},\"ReturnValues\":\"ALL_OLD\",\"ReturnConsumedCapacity\":\"TOTAL\",\"ReturnItemCollectionMetrics\":\"SIZE\"}"

Versions

foretspaisibles commented 8 years ago

This is, by the way, not reliably reproductible. I had it again after 716 insertions.

JordonPhillips commented 8 years ago

@michipili Do you have an email module installed somewhere on your system? This appears to be a relatively common issue with requests (the http library we use), though it's strange that it is so intermittent.

foretspaisibles commented 8 years ago

Superficial research shows that it is common issue for many Python products. The oldest reference I could find refers to Python 2.4. It seems that this is not related to aws cli itself bu rather with Python, so we can close this issue.