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 webpubsub client start errors with TypeError: As of 3.10, the *loop* parameter was removed from Lock() since it is no longer necessary #4910

Closed
asottile opened this issue May 29, 2022 · 2 comments · Fixed by #4911
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. CXP Attention This issue is handled by CXP team. WebPubSub

Comments

@asottile
Copy link
Contributor

  • If the issue is to do with Azure CLI 2.0 in-particular, create an issue here at Azure/azure-cli

Related command

$ az webpubsub client start --name twitch-pubsub --resource-group twitchRG --user user1 --hub-name hub1
The command failed with an unexpected error. Here is the traceback:
As of 3.10, the *loop* parameter was removed from Lock() since it is no longer necessary
Traceback (most recent call last):
  File "/opt/az/lib/python3.10/site-packages/knack/cli.py", line 231, in invoke
    cmd_result = self.invocation.execute(args)
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute
    raise ex
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 726, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 697, in _run_job
    result = cmd_copy(params)
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 333, in __call__
    return self.handler(*args, **kwargs)
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
    return op(**command_args)
  File "/home/anthony/.azure/cliextensions/webpubsub/azext_webpubsub/client.py", line 58, in start_client
    asyncio.get_event_loop().run_until_complete(connect(token['url']))
  File "/opt/az/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
    return future.result()
  File "/home/anthony/.azure/cliextensions/webpubsub/azext_webpubsub/client.py", line 43, in connect
    async with websockets.connect(url, subprotocols=['json.webpubsub.azure.v1']) as ws:
  File "/home/anthony/.azure/cliextensions/webpubsub/websockets/client.py", line 517, in __aenter__
    return await self
  File "/home/anthony/.azure/cliextensions/webpubsub/websockets/client.py", line 535, in __await_impl__
    transport, protocol = await self._create_connection()
  File "/opt/az/lib/python3.10/asyncio/base_events.py", line 1089, in create_connection
    transport, protocol = await self._create_connection_transport(
  File "/opt/az/lib/python3.10/asyncio/base_events.py", line 1107, in _create_connection_transport
    protocol = protocol_factory()
  File "/home/anthony/.azure/cliextensions/webpubsub/websockets/client.py", line 69, in __init__
    super().__init__(**kwargs)
  File "/home/anthony/.azure/cliextensions/webpubsub/websockets/protocol.py", line 235, in __init__
    self._drain_lock = asyncio.Lock(
  File "/opt/az/lib/python3.10/asyncio/locks.py", line 78, in __init__
    super().__init__(loop=loop)
  File "/opt/az/lib/python3.10/asyncio/mixins.py", line 17, in __init__
    raise TypeError(
TypeError: As of 3.10, the *loop* parameter was removed from Lock() since it is no longer necessary

Extension name (the extension in question)

webpubsub

Description of issue (in as much detail as possible)

appears this just needs an upgrade

I was able to work around by running (I'm in azure cloud shell):

/opt/az/bin/python3.10 -m pip install websockets --upgrade --target ~/.azure/cliextensions/webpubsub/
@ghost ghost added question The issue doesn't require a change to the product in order to be resolved. Most issues start as that customer-reported Issues that are reported by GitHub users external to the Azure organization. labels May 29, 2022
@yonzhan yonzhan added WebPubSub CXP Attention This issue is handled by CXP team. and removed question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels May 29, 2022
@ghost
Copy link

ghost commented May 29, 2022

Thank you for your feedback. This has been routed to the support team for assistance.

@yonzhan
Copy link
Collaborator

yonzhan commented May 29, 2022

route to CXP team

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. CXP Attention This issue is handled by CXP team. WebPubSub
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants