awslabs / aws-shell

An integrated shell for working with the AWS CLI.
Apache License 2.0
7.19k stars 773 forks source link

KeyError: 'input_token' on startup #127

Closed kaitea closed 7 years ago

kaitea commented 8 years ago

After running: aws-shell

I get the following error:

First run, creating autocomplete index...
Traceback (most recent call last):
  File "/usr/local/bin/aws-shell", line 9, in <module>
    load_entry_point('aws-shell==0.1.1', 'console_scripts', 'aws-shell')()
  File "/Library/Python/2.7/site-packages/awsshell/__init__.py", line 47, in main
    write_index(index_file)
  File "/Library/Python/2.7/site-packages/awsshell/makeindex.py", line 67, in write_index
    index_command(current, help_command)
  File "/Library/Python/2.7/site-packages/awsshell/makeindex.py", line 59, in index_command
    index_command(child, sub_help_command)
  File "/Library/Python/2.7/site-packages/awsshell/makeindex.py", line 58, in index_command
    sub_help_command = sub_command.create_help_command()
  File "/Library/Python/2.7/site-packages/awscli/clidriver.py", line 555, in create_help_command
    arg_table=self.arg_table,
  File "/Library/Python/2.7/site-packages/awscli/clidriver.py", line 494, in arg_table
    self._arg_table = self._create_argument_table()
  File "/Library/Python/2.7/site-packages/awscli/clidriver.py", line 617, in _create_argument_table
    argument_table=argument_table)
  File "/Library/Python/2.7/site-packages/awscli/clidriver.py", line 621, in _emit
    return self._session.emit(name, **kwargs)
  File "/Library/Python/2.7/site-packages/botocore/session.py", line 684, in emit
    return self._events.emit(event_name, **kwargs)
  File "/Library/Python/2.7/site-packages/botocore/hooks.py", line 227, in emit
    return self._emit(event_name, kwargs)
  File "/Library/Python/2.7/site-packages/botocore/hooks.py", line 210, in _emit
    response = handler(**kwargs)
  File "/Library/Python/2.7/site-packages/awscli/customizations/paginate.py", line 115, in unify_paging_params
    _remove_existing_paging_arguments(argument_table, paginator_config)
  File "/Library/Python/2.7/site-packages/awscli/customizations/paginate.py", line 207, in _remove_existing_paging_arguments
    for cli_name in _get_all_cli_input_tokens(pagination_config):
  File "/Library/Python/2.7/site-packages/awscli/customizations/paginate.py", line 214, in _get_all_cli_input_tokens
    tokens = _get_input_tokens(pagination_config)
  File "/Library/Python/2.7/site-packages/awscli/customizations/paginate.py", line 225, in _get_input_tokens
    tokens = pagination_config['input_token']
donnemartin commented 8 years ago

Hi @kaitea,

I'm not seeing this error on a fresh virtualenv install on Python 2.7 on OS X. Can you provide the output of:

$ pip freeze

Also, what OS are you running?

eefylin commented 8 years ago

Hello @donnemartin,

I'm facing the same problem and same output as @kaitea. I'm using Mac EI Capitan 10.11.6.

I've done aws-sdk-paython install and boto3 install. After that I done $ pip install --upgrade aws-shell

$ pip freeze output is as followed

altgraph==0.10.2 aws-shell==0.1.1 awscli==1.10.27 bdist-mpkg==0.5.0 bonjour-py==0.3 boto3==1.4.0 botocore==1.4.59 colorama==0.3.7 configobj==5.0.6 docutils==0.12 futures==3.0.5 jmespath==0.9.0 macholib==1.5.1 matplotlib==1.3.1 modulegraph==0.10.4 numpy==1.8.0rc1 prompt-toolkit==1.0.7 py2app==0.7.3 pyasn1==0.1.9 Pygments==2.1.3 pyobjc-core==2.5.1 pyobjc-framework-Accounts==2.5.1 pyobjc-framework-AddressBook==2.5.1 pyobjc-framework-AppleScriptKit==2.5.1 pyobjc-framework-AppleScriptObjC==2.5.1 pyobjc-framework-Automator==2.5.1 pyobjc-framework-CFNetwork==2.5.1 pyobjc-framework-Cocoa==2.5.1 pyobjc-framework-Collaboration==2.5.1 pyobjc-framework-CoreData==2.5.1 pyobjc-framework-CoreLocation==2.5.1 pyobjc-framework-CoreText==2.5.1 pyobjc-framework-DictionaryServices==2.5.1 pyobjc-framework-EventKit==2.5.1 pyobjc-framework-ExceptionHandling==2.5.1 pyobjc-framework-FSEvents==2.5.1 pyobjc-framework-InputMethodKit==2.5.1 pyobjc-framework-InstallerPlugins==2.5.1 pyobjc-framework-InstantMessage==2.5.1 pyobjc-framework-LatentSemanticMapping==2.5.1 pyobjc-framework-LaunchServices==2.5.1 pyobjc-framework-Message==2.5.1 pyobjc-framework-OpenDirectory==2.5.1 pyobjc-framework-PreferencePanes==2.5.1 pyobjc-framework-PubSub==2.5.1 pyobjc-framework-QTKit==2.5.1 pyobjc-framework-Quartz==2.5.1 pyobjc-framework-ScreenSaver==2.5.1 pyobjc-framework-ScriptingBridge==2.5.1 pyobjc-framework-SearchKit==2.5.1 pyobjc-framework-ServiceManagement==2.5.1 pyobjc-framework-Social==2.5.1 pyobjc-framework-SyncServices==2.5.1 pyobjc-framework-SystemConfiguration==2.5.1 pyobjc-framework-WebKit==2.5.1 pyOpenSSL==0.13.1 pyparsing==2.0.1 python-dateutil==2.5.3 python-magic==0.4.11 pytz==2013.7 rsa==3.4.2 s3cmd==1.6.1 s3transfer==0.1.6 scipy==0.13.0b1 six==1.10.0 wcwidth==0.1.7 xattr==0.6.4 zope.interface==4.1.1

donnemartin commented 7 years ago

Hi @eefylin, thanks for the pip freeze output.

I think there's an issue with the dependencies installed on your system. For example on my system, I cannot get aws-shell to start up at all with your combination of installed packages of aws-shell==0.1.1 and awscli==1.10.27:

donnemartin at Donnes-MBP in ~/Dev/github/forks/aws-shell on master [!?]
$ aws-shell
First run, creating autocomplete index...
Traceback (most recent call last):
  File "/Users/donnemartin/.virtualenvs/aws-shell-test/bin/aws-shell", line 11, in <module>
    sys.exit(main())
  File "/Users/donnemartin/.virtualenvs/aws-shell-test/lib/python2.7/site-packages/awsshell/__init__.py", line 47, in main
    write_index(index_file)
  File "/Users/donnemartin/.virtualenvs/aws-shell-test/lib/python2.7/site-packages/awsshell/makeindex.py", line 67, in write_index
    index_command(current, help_command)
  File "/Users/donnemartin/.virtualenvs/aws-shell-test/lib/python2.7/site-packages/awsshell/makeindex.py", line 59, in index_command
    index_command(child, sub_help_command)
  File "/Users/donnemartin/.virtualenvs/aws-shell-test/lib/python2.7/site-packages/awsshell/makeindex.py", line 59, in index_command
    index_command(child, sub_help_command)
  File "/Users/donnemartin/.virtualenvs/aws-shell-test/lib/python2.7/site-packages/awsshell/makeindex.py", line 46, in index_command
    operation_name=op_name,
TypeError: generate_shorthand_example() got an unexpected keyword argument 'cli_argument'

On my system a fresh install of aws-shell results in the following installed packages and versions:

donnemartin at Donnes-MBP in ~/Dev/github/forks/aws-shell on master [!?]
$ pip freeze
aws-shell==0.1.1
awscli==1.11.5
boto3==1.4.1
botocore==1.4.62
colorama==0.3.7
configobj==5.0.6
docutils==0.12
futures==3.0.5
jmespath==0.9.0
prompt-toolkit==1.0.7
pyasn1==0.1.9
Pygments==2.1.3
python-dateutil==2.5.3
rsa==3.4.2
s3transfer==0.1.8
six==1.10.0
wcwidth==0.1.7
wheel==0.24.0

Does upgrading awscli on your end fix the issue?

pip install --upgrade awscli
eefylin commented 7 years ago

Hello @donnemartin, I tried upgrade the awscli, but didn't really help.

pip install --upgrade awscli

Here is the result of pip freeze after the upgrade.

altgraph==0.10.2 aws-shell==0.1.1 awscli==1.11.14 awsebcli==3.8.3 bdist-mpkg==0.5.0 blessed==1.9.5 bonjour-py==0.3 boto3==1.4.1 botocore==1.4.71 cement==2.8.2 colorama==0.3.7 configobj==5.0.6 docker-py==1.7.2 dockerpty==0.4.1 docopt==0.6.2 docutils==0.12 futures==3.0.5 jmespath==0.9.0 macholib==1.5.1 matplotlib==1.3.1 modulegraph==0.10.4 numpy==1.8.0rc1 pathspec==0.3.4 prompt-toolkit==1.0.9 py2app==0.7.3 pyasn1==0.1.9 Pygments==2.1.3 pyobjc-core==2.5.1 pyobjc-framework-Accounts==2.5.1 pyobjc-framework-AddressBook==2.5.1 pyobjc-framework-AppleScriptKit==2.5.1 pyobjc-framework-AppleScriptObjC==2.5.1 pyobjc-framework-Automator==2.5.1 pyobjc-framework-CFNetwork==2.5.1 pyobjc-framework-Cocoa==2.5.1 pyobjc-framework-Collaboration==2.5.1 pyobjc-framework-CoreData==2.5.1 pyobjc-framework-CoreLocation==2.5.1 pyobjc-framework-CoreText==2.5.1 pyobjc-framework-DictionaryServices==2.5.1 pyobjc-framework-EventKit==2.5.1 pyobjc-framework-ExceptionHandling==2.5.1 pyobjc-framework-FSEvents==2.5.1 pyobjc-framework-InputMethodKit==2.5.1 pyobjc-framework-InstallerPlugins==2.5.1 pyobjc-framework-InstantMessage==2.5.1 pyobjc-framework-LatentSemanticMapping==2.5.1 pyobjc-framework-LaunchServices==2.5.1 pyobjc-framework-Message==2.5.1 pyobjc-framework-OpenDirectory==2.5.1 pyobjc-framework-PreferencePanes==2.5.1 pyobjc-framework-PubSub==2.5.1 pyobjc-framework-QTKit==2.5.1 pyobjc-framework-Quartz==2.5.1 pyobjc-framework-ScreenSaver==2.5.1 pyobjc-framework-ScriptingBridge==2.5.1 pyobjc-framework-SearchKit==2.5.1 pyobjc-framework-ServiceManagement==2.5.1 pyobjc-framework-Social==2.5.1 pyobjc-framework-SyncServices==2.5.1 pyobjc-framework-SystemConfiguration==2.5.1 pyobjc-framework-WebKit==2.5.1 pyOpenSSL==0.13.1 pyparsing==2.0.1 python-dateutil==2.6.0 python-magic==0.4.11 pytz==2013.7 PyYAML==3.12 requests==2.9.1 rsa==3.4.2 s3cmd==1.6.1 s3transfer==0.1.9 scipy==0.13.0b1 semantic-version==2.5.0 six==1.10.0 texttable==0.8.5 wcwidth==0.1.7 websocket-client==0.37.0 xattr==0.6.4 zope.interface==4.1.1

joguSD commented 7 years ago

Are you still having troubles with this? Might be worth trying pip install -I aws-shell to reinstall all dependencies.