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

Error: "gather() got an unexpected keyword argument 'loop' " using the Azure CLI on MacOS to monitor events #350

Closed
marty-optum opened this issue Nov 26, 2021 · 8 comments
Assignees

Comments

@marty-optum
Copy link
Contributor

marty-optum commented Nov 26, 2021

I am going through the Migrate your plant to the cloud lesson. I am using the Azure CLI ver 2.30.0 on macOS 11.6 (Big Sur).

I have successfully connected my Raspberry Pi to Azure IoT Hub and have confirmed the ability to send moisture-sensor telemetry to the IoT Hub, and to call direct methods for relay_on and relay_off from the IoT Hub by invoking these methods within Azure Portal.

However, when I try to execute the steps in Task - monitor events to use the Azure CLI to monitor events that are sent from my Pi to the Azure IoT Hub, things break down. Specifically, when I run the command az iot hub monitor-events --hub-name <hub_name>, I get the following error message returned:

gather() got an unexpected keyword argument 'loop'

Here is a screenshot with further detail:

image

The value I am using for <hub_name> is mjh-IoT-Hub-20211122. I also tried surrounding this value with single and double quotation marks, but that didn't matter.

[UPDATE 11/29/21]: I ran the az iot hub monitor-events --hub-name <hub_name> command from a windows 10 device and it worked fine, so the issue appears to be limited to the macOS implementation of the Azure CLI azure-iot extension. Just for ha ha's, I verified that I was running the latest version of the azure-iot extension (0.11.0) on my mac . I then removed it and installed an earlier version (0.10.11). Same error :-( . I'm at the latest version again in case further troubleshooting needs to occur.

Any suggestions @jimbobbennett ? Has anyone else experienced this issue on macOS?

@jimbobbennett jimbobbennett self-assigned this Dec 1, 2021
@jimbobbennett
Copy link
Contributor

Hmmm. I'd love to help here but it looks like they've broken Apple Silicon support so I can't run this.

Azure/azure-iot-cli-extension#468

It worked before - I wrote all this from my M1 Mac, so I'm guessing the az cli was running under rosetta 2 before, but now has a universal binary, hence the error.

@jimbobbennett
Copy link
Contributor

As for your issue, I haven't seen it before. Can you raise this on the Azure IoT extension repo?

https://github.com/Azure/azure-iot-cli-extension/issues

For now though, maybe stick to Windows or use the Azure Cloud Shell?

@jimbobbennett
Copy link
Contributor

OK - managed to get the az cli running under rosetta 2, and it seems this is because the loop function was deprecated as of Python 3.8, and removed in Python 3.10.

What Python version are you using on Windows? I'm guessing one less than 3.10

@jimbobbennett
Copy link
Contributor

Issue raised against the IoT extension:

Azure/azure-iot-cli-extension#469

@marty-optum
Copy link
Contributor Author

marty-optum commented Dec 1, 2021

@jimbobbennett, the version of python on my windows machine is 3.9.9.

Also, the Mac where I am receiving the loop error has the following attributes:

  • python 2.7.16
  • python3 3.8.2
  • Intel processor
  • Homebrew 3.5.5

Looking at the error messages that are output, it appears that the azure cli is using a version of Python that is packaged with homebrew, and that python version is 3.10.

File "/usr/local/Cellar/azure-cli/2.30.0_1/libexec/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
    return op(**command_args)

@jimbobbennett
Copy link
Contributor

Interesting. I've updated the iot extension bug, and will keep this open till that one is resolved.

@marty-optum
Copy link
Contributor Author

Update: I can confirm that the soft release of the azure-iot CLI extension 0.12.1 fixed the error I previously experienced on an Intel Mac for my test use case.

I also provided this update to [bug] Cannot run on macOS due to incompatibilities with the Python version shipped with the Azure CLI #469

I do not have the means to test on Apple Silicon.

@jimbobbennett
Copy link
Contributor

Closing this as the az iot extension issue has been resolved for Intel Macs

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

2 participants