"aws ec2 describe-images" runs into "KeyError: 'next-token'"

Bug #2001718 reported by Thomas Bechtold
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
awscli (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Using awscli 2.9.9-2 from lunar and trying to list available images, I get:

$ aws --debug ec2 describe-images
2023-01-04 20:23:22,750 - MainThread - awscli.clidriver - DEBUG - CLI version: aws-cli/2.9.9 Python/3.10.9 Linux/5.19.0-26-generic source/x86_64.ubuntu.23
2023-01-04 20:23:22,750 - MainThread - awscli.clidriver - DEBUG - Arguments entered to CLI: ['--debug', 'ec2', 'describe-images']
2023-01-04 20:23:22,759 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function add_s3 at 0x7f94745e3d00>
2023-01-04 20:23:22,759 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function add_ddb at 0x7f9474833370>
2023-01-04 20:23:22,759 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <bound method BasicCommand.add_command of <class 'awscli.customizations.configure.configure.ConfigureCommand'>>
2023-01-04 20:23:22,759 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function change_name at 0x7f94747aae60>
2023-01-04 20:23:22,759 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function change_name at 0x7f94747c8040>
2023-01-04 20:23:22,759 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function alias_opsworks_cm at 0x7f94745ee9e0>
2023-01-04 20:23:22,759 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function add_history_commands at 0x7f9474879240>
2023-01-04 20:23:22,759 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <bound method BasicCommand.add_command of <class 'awscli.customizations.devcommands.CLIDevCommand'>>
2023-01-04 20:23:22,759 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function add_waiters at 0x7f94745edbd0>
2023-01-04 20:23:22,759 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <bound method AliasSubCommandInjector.on_building_command_table of <awscli.alias.AliasSubCommandInjector object at 0x7f94746722c0>>
2023-01-04 20:23:22,759 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/lib/python3/dist-packages/awscli/data/cli.json
2023-01-04 20:23:22,760 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <function resolve_types at 0x7f947473a440>
2023-01-04 20:23:22,760 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <function no_sign_request at 0x7f947473a710>
2023-01-04 20:23:22,761 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <function resolve_verify_ssl at 0x7f947473a680>
2023-01-04 20:23:22,761 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <function resolve_cli_read_timeout at 0x7f947473a830>
2023-01-04 20:23:22,761 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <function resolve_cli_connect_timeout at 0x7f947473a7a0>
2023-01-04 20:23:22,761 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <built-in method update of dict object at 0x7f9474499e00>
2023-01-04 20:23:22,761 - MainThread - awscli.clidriver - DEBUG - CLI version: aws-cli/2.9.9 Python/3.10.9 Linux/5.19.0-26-generic source/x86_64.ubuntu.23 prompt/off
2023-01-04 20:23:22,761 - MainThread - awscli.clidriver - DEBUG - Arguments entered to CLI: ['--debug', 'ec2', 'describe-images']
2023-01-04 20:23:22,761 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function add_timestamp_parser at 0x7f94745ec430>
2023-01-04 20:23:22,761 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function register_uri_param_handler at 0x7f9474c4b640>
2023-01-04 20:23:22,761 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function add_binary_formatter at 0x7f947465d990>
2023-01-04 20:23:22,761 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function no_pager_handler at 0x7f9474ace3b0>
2023-01-04 20:23:22,761 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function inject_assume_role_provider_cache at 0x7f9474b55e10>
2023-01-04 20:23:22,762 - MainThread - botocore.utils - DEBUG - IMDS ENDPOINT: http://169.254.169.254/
2023-01-04 20:23:22,763 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function attach_history_handler at 0x7f9474879120>
2023-01-04 20:23:22,763 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function inject_json_file_cache at 0x7f9474830160>
2023-01-04 20:23:22,772 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /home/tom/.aws/models/ec2/2016-11-15/service-2.json
2023-01-04 20:23:22,813 - MainThread - botocore.hooks - DEBUG - Event building-command-table.ec2: calling handler functools.partial(<function _remove_commands at 0x7f94747567a0>, commands_to_remove=['import-instance', 'import-volume'])
2023-01-04 20:23:22,813 - MainThread - awscli.customizations.removals - DEBUG - Removing operation: import-instance
2023-01-04 20:23:22,813 - MainThread - awscli.customizations.removals - DEBUG - Removing operation: import-volume
2023-01-04 20:23:22,813 - MainThread - botocore.hooks - DEBUG - Event building-command-table.ec2: calling handler <function add_waiters at 0x7f94745edbd0>
2023-01-04 20:23:22,821 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/lib/python3/dist-packages/awscli/botocore/data/ec2/2016-11-15/waiters-2.json
2023-01-04 20:23:22,822 - MainThread - botocore.hooks - DEBUG - Event building-command-table.ec2: calling handler <bound method AliasSubCommandInjector.on_building_command_table of <awscli.alias.AliasSubCommandInjector object at 0x7f94746722c0>>
2023-01-04 20:23:22,822 - MainThread - awscli.clidriver - DEBUG - OrderedDict([('executable-users', <awscli.arguments.ListArgument object at 0x7f9473137b20>), ('filters', <awscli.arguments.ListArgument object at 0x7f9473137af0>), ('image-ids', <awscli.arguments.ListArgument object at 0x7f9473137a90>), ('owners', <awscli.arguments.ListArgument object at 0x7f9473137a60>), ('include-deprecated', <awscli.arguments.BooleanArgument object at 0x7f9473137a30>), ('no-include-deprecated', <awscli.arguments.BooleanArgument object at 0x7f9473137c40>), ('dry-run', <awscli.arguments.BooleanArgument object at 0x7f9473137c70>), ('no-dry-run', <awscli.arguments.BooleanArgument object at 0x7f9473137cd0>)])
2023-01-04 20:23:22,822 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.ec2.describe-images: calling handler <function add_streaming_output_arg at 0x7f94745ec790>
2023-01-04 20:23:22,823 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.ec2.describe-images: calling handler <function rename_arg.<locals>._rename_arg at 0x7f947465e7a0>
2023-01-04 20:23:22,823 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.ec2.describe-images: calling handler <function rename_arg.<locals>._rename_arg at 0x7f947465e830>
2023-01-04 20:23:22,823 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.ec2.describe-images: calling handler functools.partial(<function pull_up_bool at 0x7f94745ed5a0>, event_handler=<botocore.hooks.HierarchicalEmitter object at 0x7f9474ae45b0>)
2023-01-04 20:23:22,823 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.ec2.describe-images: calling handler <function add_cli_input_json at 0x7f9474b56830>
2023-01-04 20:23:22,823 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.ec2.describe-images: calling handler <function add_cli_input_yaml at 0x7f9474b569e0>
2023-01-04 20:23:22,823 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.ec2.describe-images: calling handler <function unify_paging_params at 0x7f94748339a0>
2023-01-04 20:23:22,832 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/lib/python3/dist-packages/awscli/botocore/data/ec2/2016-11-15/paginators-1.json
2023-01-04 20:23:22,832 - MainThread - awscli.customizations.paginate - DEBUG - Modifying paging parameters for operation: DescribeImages
2023-01-04 20:23:22,832 - MainThread - awscli.clidriver - DEBUG - Exception caught in main()
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/awscli/clidriver.py", line 460, in main
    return command_table[parsed_args.command](remaining, parsed_args)
  File "/usr/lib/python3/dist-packages/awscli/clidriver.py", line 595, in __call__
    return command_table[parsed_args.operation](remaining, parsed_globals)
  File "/usr/lib/python3/dist-packages/awscli/clidriver.py", line 746, in __call__
    self._emit(event, argument_table=self.arg_table, args=args,
  File "/usr/lib/python3/dist-packages/awscli/clidriver.py", line 732, in arg_table
    self._arg_table = self._create_argument_table()
  File "/usr/lib/python3/dist-packages/awscli/clidriver.py", line 865, in _create_argument_table
    self._emit('building-argument-table.%s.%s' % (self._parent_name,
  File "/usr/lib/python3/dist-packages/awscli/clidriver.py", line 874, in _emit
    return self._session.emit(name, **kwargs)
  File "/usr/lib/python3/dist-packages/awscli/botocore/session.py", line 699, in emit
    return self._events.emit(event_name, **kwargs)
  File "/usr/lib/python3/dist-packages/awscli/botocore/hooks.py", line 228, in emit
    return self._emit(event_name, kwargs)
  File "/usr/lib/python3/dist-packages/awscli/botocore/hooks.py", line 211, in _emit
    response = handler(**kwargs)
  File "/usr/lib/python3/dist-packages/awscli/customizations/paginate.py", line 134, in unify_paging_params
    _remove_existing_paging_arguments(argument_table, paginator_config)
  File "/usr/lib/python3/dist-packages/awscli/customizations/paginate.py", line 245, in _remove_existing_paging_arguments
    argument_table[cli_name]._UNDOCUMENTED = True
KeyError: 'next-token'

ProblemType: Bug
DistroRelease: Ubuntu 23.04
Package: awscli 2.9.9-2
ProcVersionSignature: Ubuntu 5.19.0-26.27-generic 5.19.7
Uname: Linux 5.19.0-26-generic x86_64
NonfreeKernelModules: zfs zunicode zavl icp zcommon znvpair
ApportVersion: 2.24.0-0ubuntu1
Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: ubuntu:GNOME
Date: Wed Jan 4 20:20:31 2023
InstallationDate: Installed on 2022-03-21 (288 days ago)
InstallationMedia: Ubuntu 21.10 "Impish Indri" - Release amd64 (20211012)
PackageArchitecture: all
SourcePackage: awscli
UpgradeStatus: Upgraded to lunar on 2022-12-19 (16 days ago)

Revision history for this message
Thomas Bechtold (toabctl) wrote :
Revision history for this message
Thomas Bechtold (toabctl) wrote :

I had a custom model installed into ~/.aws/models/ . Deleting that directory solved the problem

Changed in awscli (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.