awslabs / awslabs/aws-shell

Bad jmespath expression: Unknown character

Open
#228 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
7.3k
Forks
780
PR merge metrics
No merged PRs in 30d

Description

I am unable to run `aws-shell`. After `pip install aws-shell` and `aws-shell` I get the following.

```
First run, creating autocomplete index...
Traceback (most recent call last):
File "/home/stibbons/.local/bin/aws-shell", line 10, in
sys.exit(main())
File "/home/stibbons/.local/lib/python2.7/site-packages/awsshell/__init__.py", line 47, in main
write_index(index_file)
File "/home/stibbons/.local/lib/python2.7/site-packages/awsshell/makeindex.py", line 67, in write_index
index_command(current, help_command)
File "/home/stibbons/.local/lib/python2.7/site-packages/awsshell/makeindex.py", line 59, in index_command
index_command(child, sub_help_command)
File "/home/stibbons/.local/lib/python2.7/site-packages/awsshell/makeindex.py", line 58, in index_command
sub_help_command = sub_command.create_help_command()
File "/home/stibbons/.local/lib/python2.7/site-packages/awscli/customizations/waiters.py", line 81, in create_help_command
command_table=self.subcommand_table,
File "/home/stibbons/.local/lib/python2.7/site-packages/awscli/customizations/commands.py", line 278, in subcommand_table
self._subcommand_table = self._build_subcommand_table()
File "/home/stibbons/.local/lib/python2.7/site-packages/awscli/customizations/waiters.py", line 75, in _build_subcommand_table
self.waiter_cmd_builder.build_all_waiter_state_cmds(subcommand_table)
File "/home/stibbons/.local/lib/python2.7/site-packages/awscli/customizations/waiters.py", line 102, in build_all_waiter_state_cmds
self._build_waiter_state_cmd(waiter_name)
File "/home/stibbons/.local/lib/python2.7/site-packages/awscli/customizations/waiters.py", line 130, in _build_waiter_state_cmd
description = waiter_state_doc_builder.build_waiter_state_description()
File "/home/stibbons/.local/lib/python2.7/site-packages/awscli/customizations/waiters.py", line 156, in build_waiter_state_description
for acceptor in self._waiter_config.acceptors:
File "/home/stibbons/.local/lib/python2.7/site-packages/botocore/waiter.py", line 153, in acceptors
acceptor = AcceptorConfig(acceptor_config)
File "/home/stibbons/.local/lib/python2.7/site-packages/botocore/waiter.py", line 164, in __init__
self.matcher_func = self._create_matcher_func()
File "/home/stibbons/.local/lib/python2.7/site-packages/botocore/waiter.py", line 176, in _create_matcher_func
return self._create_path_matcher()
File "/home/stibbons/.local/lib/python2.7/site-packages/botocore/waiter.py", line 190, in _create_path_matcher
expression = jmespath.compile(self.argument)
File "/home/stibbons/.local/lib/python2.7/site-packages/jmespath/__init__.py", line 7, in compile
return parser.Parser().parse(expression)
File "/home/stibbons/.local/lib/python2.7/site-packages/jmespath/parser.py", line 81, in parse
parsed_result = self._do_parse(expression)
File "/home/stibbons/.local/lib/python2.7/site-packages/jmespath/parser.py", line 89, in _do_parse
return self._parse(expression)
File "/home/stibbons/.local/lib/python2.7/site-packages/jmespath/parser.py", line 102, in _parse
self._tokens = list(self.tokenizer)
File "/home/stibbons/.local/lib/python2.7/site-packages/jmespath/lexer.py", line 67, in tokenize
expression=expression)
jmespath.exceptions.LexerError: Bad jmespath expression: Unknown character:
length(services[?!(length(deployments) == `1` && runningCount == desiredCount)]) == `0`
```

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure by launching aws-shell after installation, then trace the index-building path through awsshell/makeindex.py and the waiter handling in awscli/customizations/waiters.py and botocore/waiter.py. Inspect the reported JMESPath expression and dependency behavior first; done means the initial autocomplete index is created without the LexerError.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, python
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.