question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] az extension add fails when $ is present in username

See original GitHub issue

az feedback auto-generates most of the information requested below, as of CLI version 2.0.62

Describe the bug

Exception: Traceback (most recent call last): File “C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\distutils\util.py”, line 202, in subst_vars return re.sub(r’$([a-zA-Z_][a-zA-Z_0-9]*)', _subst, s) File “C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\re.py”, line 191, in sub return _compile(pattern, flags).sub(repl, string, count) File “C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\distutils\util.py”, line 199, in _subst return os.environ[var_name] File “C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\os.py”, line 669, in getitem raise KeyError(key) from None KeyError: ‘Dlakin’

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File “C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\pip_internal\basecommand.py”, line 228, in main status = self.run(options, args) File “C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\pip_internal\commands\install.py”, line 335, in run use_user_site=options.use_user_site, File “C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\pip_internal\req_init_.py”, line 49, in install_given_reqs **kwargs File “C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\pip_internal\req\req_install.py”, line 748, in install use_user_site=use_user_site, pycompile=pycompile, File “C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\pip_internal\req\req_install.py”, line 961, in move_wheel_files warn_script_location=warn_script_location, File “C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\pip_internal\wheel.py”, line 216, in move_wheel_files prefix=prefix, File “C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\pip_internal\locations.py”, line 165, in distutils_scheme i.finalize_options() File “C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\distutils\command\install.py”, line 307, in finalize_options self.expand_basedirs() File “C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\distutils\command\install.py”, line 475, in expand_basedirs self._expand_attrs([‘install_base’, ‘install_platbase’, ‘root’]) File “C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\distutils\command\install.py”, line 469, in _expand_attrs val = subst_vars(val, self.config_vars) File “C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\distutils\util.py”, line 204, in subst_vars raise ValueError(“invalid variable ‘$%s’” % var) ValueError: invalid variable ‘$‘Dlakin’’

Command ‘[‘C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe’, ‘-m’, ‘pip’, ‘install’, ‘–target’, ‘C:\Users\$Dlakin\.azure\cliextensions\azure-devops’, ‘C:\Users\$Dlakin\AppData\Local\Temp\tmpbszvr1a1\azure_devops-0.4.0-py2.py3-none-any.whl’, ‘-vv’, ‘–disable-pip-version-check’, ‘–no-cache-dir’]’ returned non-zero exit status 2. Pip failed so deleting anything we might have installed at C:\Users$Dlakin.azure\cliextensions\azure-devops

To Reproduce Try to install the az devops cli extension with $ character in username

Expected behavior The devops cli extension is installed

Environment summary Windows 10 - issue is down to $ in username

Additional context n/a

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
atbaggacommented, Jun 13, 2019

@tjprescott This is not a azure devops extension specific issue. I could repro this for alias extension as well, with the same error. We should move this to the Azure-Cli repository.

0reactions
jsntcycommented, Jun 10, 2020

@haroldrandom, could you please help take a look?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tips for using the Azure CLI successfully
The az command fails because it is missing the required --location parameter. The conditional statement finds that $? is false and writes an ......
Read more >
az login error: Please ensure you have network connection ...
Trying to install the Azure Devops CLI Extension.
Read more >
az ml commands are failing with "ERROR: {'Azure-cli-ml Version'
... 'Error': TypeError(“init() got an unexpected keyword argument 'async_pe”. az login az account set az configure az extension add az ml model download....
Read more >
Troubleshooting | LiveData Migrator for Azure
AZ: command not found#. If you don't have the Azure CLI installed when you try to add the LiveData extension, the command line...
Read more >
Error Messages | Maps JavaScript API
Maps JavaScript API Error Codes for Developers and Site Owners ... expired, or the current address loading the Maps JavaScript API has not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found