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

az fails in multiple threads #8

Open
Sergei-Vorobyov opened this issue Nov 11, 2020 · 0 comments
Open

az fails in multiple threads #8

Sergei-Vorobyov opened this issue Nov 11, 2020 · 0 comments

Comments

@Sergei-Vorobyov
Copy link

Greetings!

az works great in one thread, but fails in 2 and more. I am just executing an innocent command, it always fails in 2, 3 threads.

    cmd = 'ad signed-in-user show --query "userPrincipalName"'
    logger.info(f'will run: {cmd}')
    exit_code, result, logs = az(cmd)
Exception in thread aks-stage-3se:
Traceback (most recent call last):
  File "/usr/local/Cellar/python@3.8/3.8.6/Frameworks/Python.framework/Versions/3.8/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/usr/local/Cellar/python@3.8/3.8.6/Frameworks/Python.framework/Versions/3.8/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "mainA.py", line 211, in process_cluster
    cluster_summary()
  File "mainA.py", line 178, in cluster_summary
    exit_code, result, logs = az(cmd)
  File "/Users/vorobyov001/tre/PycharmProjects/011-key-vault/az-ad/zvenv/lib/python3.8/site-packages/az/cli.py", line 89, in az
    exit_code = _cli.invoke(
  File "/Users/vorobyov001/tre/PycharmProjects/011-key-vault/az-ad/zvenv/lib/python3.8/site-packages/knack/cli.py", line 233, in invoke
    self.raise_event(EVENT_CLI_POST_EXECUTE)
  File "/Users/vorobyov001/tre/PycharmProjects/011-key-vault/az-ad/zvenv/lib/python3.8/site-packages/knack/cli.py", line 164, in raise_event
    func(self, **kwargs)
  File "/Users/vorobyov001/tre/PycharmProjects/011-key-vault/az-ad/zvenv/lib/python3.8/site-packages/azure/cli/core/azlogging.py", line 180, in deinit_cmd_metadata_logging
    cli_ctx.logging.end_cmd_metadata_logging(cli_ctx.result.exit_code if cli_ctx.result else 128)
  File "/Users/vorobyov001/tre/PycharmProjects/011-key-vault/az-ad/zvenv/lib/python3.8/site-packages/azure/cli/core/azlogging.py", line 190, in end_cmd_metadata_logging
    self.command_metadata_logger.removeHandler(self.command_logger_handler)
AttributeError: 'NoneType' object has no attribute 'removeHandler'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant