Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

account set: argument of type 'NoneType' is not iterable #5548

Closed
cilerler opened this issue Feb 12, 2018 · 4 comments
Closed

account set: argument of type 'NoneType' is not iterable #5548

cilerler opened this issue Feb 12, 2018 · 4 comments
Assignees
Labels
Account az login/account
Milestone

Comments

@cilerler
Copy link

I have several accounts such as Pay-As-You-Go and Visual Studio Enterprise etc. had to add a new subscription which showed up as "FreeTrial"

When I run command az account set -s "Free Trial" and then az group list it throws

argument of type 'NoneType' is not iterableTraceback (most recent call last):
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\azure\cli\core\adal_authentication.py", line 24, in signed_session
    scheme, token, _ = self._token_retriever()
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\azure\cli\core\_profile.py", line 416, in _retrieve_token
    account[_TENANT_ID], resource)
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\azure\cli\core\_profile.py", line 783, in retrieve_token_for_user    token_entry = context.acquire_token(resource, username, _CLIENT_ID)
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\adal\authentication_context.py", line 131, in acquire_token
    return self._acquire_token(token_func)
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\adal\authentication_context.py", line 114, in _acquire_token
    return token_func(self)
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\adal\authentication_context.py", line 129, in token_func    return token_request.get_token_from_cache_with_refresh(user_id)
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\adal\token_request.py", line 349, in get_token_from_cache_with_refresh
    return self._find_token_from_cache()  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\adal\token_request.py", line 128, in _find_token_from_cache
    return self._cache_driver.find(cache_query)
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\adal\cache_driver.py", line 196, in find    entry, is_resource_tenant_specific = self._load_single_entry_from_cache(query)
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\adal\cache_driver.py", line 124, in _load_single_entry_from_cache
    raise AdalError('More than one token matches the criteria. The result is ambiguous.')adal.adal_error.AdalError: More than one token matches the criteria. The result is ambiguous.

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\knack\cli.py", line 194, in invoke
    cmd_result = self.invocation.execute(args)
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\azure\cli\core\commands\__init__.py", line 318, in execute
    six.reraise(*sys.exc_info())
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\six.py", line 693, in reraise
    raise value
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\azure\cli\core\commands\__init__.py", line 291, in execute
    result = cmd(params)
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\azure\cli\core\commands\__init__.py", line 167, in __call__
    return super(AzCliCommand, self).__call__(*args, **kwargs)
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\knack\commands.py", line 109, in __call__
    return self.handler(*args, **kwargs)
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\azure\cli\core\__init__.py", line 348, in default_command_handler
    result = op(**command_args)
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\azure\cli\command_modules\resource\custom.py", line 436, in list_resource_groups
    return list(groups)
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\msrest\paging.py", line 109, in __next__
    self.advance_page()
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\msrest\paging.py", line 95, in advance_page
    self._response = self._get_next(self.next_link)
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\azure\mgmt\resource\resources\v2017_05_10\operations\resource_groups_operations.py", line 520, in internal_paging
    request, header_parameters, **operation_config)
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\msrest\service_client.py", line 187, in send
    session = self.creds.signed_session()
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\azure\cli\core\adal_authentication.py", line 33, in signed_session
    if 'AADSTS70008:' in (getattr(err, 'error_response', None) or {}).get('error_description') or '':
TypeError: argument of type 'NoneType' is not iterable

If I set to other accounts, they just works fine.


Environment summary

  • Windows 10 Enterprise Version 1709 (OS Build 16299.192)
azure-cli (2.0.26)

acr (2.0.20)
acs (2.0.25)
advisor (0.1.1)
appservice (0.1.25)
backup (1.0.6)
batch (3.1.9)
batchai (0.1.5)
billing (0.1.7)
cdn (0.0.12)
cloud (2.0.12)
cognitiveservices (0.1.10)
command-modules-nspkg (2.0.1)
configure (2.0.13)
consumption (0.2.1)
container (0.1.16)
core (2.0.26)
cosmosdb (0.1.17)
dla (0.0.18)
dls (0.0.19)
eventgrid (0.1.9)
extension (0.0.8)
feedback (2.0.8)
find (0.2.8)
interactive (0.3.15)
iot (0.1.16)
keyvault (2.0.17)
lab (0.0.16)
monitor (0.1.1)
network (2.0.22)
nspkg (3.0.1)
profile (2.0.18)
rdbms (0.0.11)
redis (0.2.11)
reservations (0.1.1)
resource (2.0.22)
role (2.0.17)
servicefabric (0.0.9)
sql (2.0.20)
storage (2.0.24)
vm (2.0.25)

Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory 'C:\Users\<usermame>\.azure\cliextensions'

Python (Windows) 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 17:54:52) [MSC v.1900 32 bit (Intel)]

Legal docs and information: aka.ms/AzureCliLegal
@tjprescott tjprescott added RBAC bug This issue requires a change to an existing behavior in the product in order to be resolved. labels Feb 12, 2018
@tjprescott
Copy link
Member

@yugangw-msft

@tjprescott tjprescott changed the title argument of type 'NoneType' is not iterable account set: argument of type 'NoneType' is not iterable Feb 12, 2018
@yugangw-msft yugangw-msft added Account az login/account and removed RBAC labels Jun 16, 2018
@yugangw-msft
Copy link
Contributor

because it is hard to reproduce, I will consider to emitting out an error for people to recover using az account clear and az login

@haroldrandom haroldrandom added Account az login/account bug This issue requires a change to an existing behavior in the product in order to be resolved. labels Oct 25, 2019
@jiasli jiasli self-assigned this Dec 16, 2019
@yonzhan yonzhan removed the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Dec 26, 2019
@yonzhan yonzhan added this to the S165 milestone Dec 26, 2019
@yonzhan
Copy link
Collaborator

yonzhan commented Dec 26, 2019

add to S165.

@yonzhan yonzhan modified the milestones: S165, S166 Feb 15, 2020
@jiasli
Copy link
Member

jiasli commented Feb 17, 2020

If there is a steady repro, please kindly let us know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Account az login/account
Projects
None yet
Development

No branches or pull requests

6 participants