Error: list index out of range

Very often, when working with Azure CLI, you might get an error like the following one:

ERROR: The command failed with an unexpected error. Here is the traceback:
ERROR: list index out of range
Traceback (most recent call last):
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 233, in invoke
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 588, in execute
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/parser.py", line 261, in parse_args
  File "argparse.py", line 1826, in parse_args
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/parser.py", line 284, in parse_known_args
  File "argparse.py", line 1859, in parse_known_args
  File "argparse.py", line 2050, in _parse_known_args
  File "argparse.py", line 2027, in consume_positionals
  File "argparse.py", line 1936, in take_action
  File "argparse.py", line 1214, in __call__
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/parser.py", line 284, in parse_known_args
  File "argparse.py", line 1859, in parse_known_args
  File "argparse.py", line 2050, in _parse_known_args
  File "argparse.py", line 2027, in consume_positionals
  File "argparse.py", line 1936, in take_action
  File "argparse.py", line 1214, in __call__
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/parser.py", line 284, in parse_known_args
  File "argparse.py", line 1859, in parse_known_args
  File "argparse.py", line 2068, in _parse_known_args
  File "argparse.py", line 2008, in consume_optional
  File "argparse.py", line 1936, in take_action
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/cosmosdb/actions.py", line 43, in __call__
IndexError: list index out of range

This error can mean anything. I do not expect I give here a general workaround but following might be helpful. I have used following command.

az cosmosdb create --subscription "***" --resource-group RG_TEST --name cosmodatabase1 --kind MongoDB --capabilities EnableAggregationPipeline --default-consistency-level "Eventual" --backup-policy-type Continuous  --backup-redundancy Geo --locations regionName="northeurope" failoverPriority=0 isZoneRedundant=False --locations regionName="centralus" failoverPriority=1 isZoneRedundant False

The cause of the error is the argument: isZoneRedundant False

The correct argument is: isZoneRedundant=False


comments powered by Disqus