Azure / azure-cli

Azure Command-Line Interface
MIT License
4.03k stars 3.01k forks source link

No az command is working: ValueError: Not a boolean: true. #29754

Open salman2learn opened 3 months ago

salman2learn commented 3 months ago

Describe the bug

az login                                                                                                                   ░▒▓ 1 ✘  AppDev-Sandbox ☁  07:15:10 
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/opt/az/lib/python3.11/site-packages/azure/cli/__main__.py", line 39, in <module>
    az_cli = get_default_cli()
             ^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.11/site-packages/azure/cli/core/__init__.py", line 924, in get_default_cli
    return AzCli(cli_name='az',
           ^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.11/site-packages/azure/cli/core/__init__.py", line 59, in __init__
    super(AzCli, self).__init__(**kwargs)
  File "/opt/az/lib/python3.11/site-packages/knack/cli.py", line 98, in __init__
    self.only_show_errors = self.config.getboolean('core', 'only_show_errors', fallback=False)
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.11/site-packages/knack/config.py", line 147, in getboolean
    raise ValueError('Not a boolean: {}'.format(val))
ValueError: Not a boolean: true.

Related command

az login

Errors

File "/opt/az/lib/python3.11/site-packages/knack/config.py", line 147, in getboolean raise ValueError('Not a boolean: {}'.format(val)) ValueError: Not a boolean: true.

Issue script & Debug output

az login

Expected behavior

az login should start authentication sequence or show subscription list, if authenticated.

Environment Summary

ubuntu 20.04 python 3.11 installed azure cli using: curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash

Additional context

No response

yonzhan commented 3 months ago

Thank you for opening this issue, we will look into it.

github-actions[bot] commented 3 months ago

Here are some similar issues that might help you. Please check if they can solve your problem.

jiasli commented 3 months ago

This is because the config file ~/.azure/config is corrupted: core.only_show_errors is set to true. (notice the trailing period sign). Please fix the invalid value and change it to true.