Error in list device for iothub
See original GitHub issueDescription
Outline the issue here:
When running az iot device list --hub-name <hub name>, error occurs. 'ServiceConnect, DeviceConnect, RegistryWrite' is not valid value for enum <enum 'AccessRights'>
Environment summary
Install Method: How did you install the CLI? (e.g. pip, interactive script, apt-get, Docker, MSI, nightly)
Answer here:
MSI
CLI Version: What version of the CLI and modules are installed? (Use az --version
)
Answer here:
azure-cli (2.0.19)
acr (2.0.13)
acs (2.0.17)
appservice (0.1.18)
backup (1.0.1)
batch (3.1.5)
batchai (0.1.1)
billing (0.1.5)
cdn (0.0.9)
cloud (2.0.8)
cognitiveservices (0.1.8)
command-modules-nspkg (2.0.1)
component (2.0.7)
configure (2.0.11)
consumption (0.1.5)
container (0.1.11)
core (2.0.18)
cosmosdb (0.1.13)
dla (0.0.12)
dls (0.0.15)
eventgrid (0.1.4)
extension (0.0.4)
feedback (2.0.6)
find (0.2.7)
interactive (0.3.10)
iot (0.1.12)
keyvault (2.0.12)
lab (0.0.11)
monitor (0.0.10)
network (2.0.16)
nspkg (3.0.1)
profile (2.0.14)
rdbms (0.0.7)
redis (0.2.9)
resource (2.0.16)
role (2.0.13)
servicefabric (0.0.4)
sql (2.0.13)
storage (2.0.17)
vm (2.0.16)
Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory 'C:\Users\zlhe\.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
OS Version: What OS and version are you using?
Answer here:
Microsoft Windows [Version 10.0.15063]
Shell Type: What shell are you using? (e.g. bash, cmd.exe, Bash on Windows)
Answer here:
cmd.exe
Full logs
'ServiceConnect, DeviceConnect, RegistryWrite' is not valid value for enum <enum 'AccessRights'>
Traceback (most recent call last):
File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\msrest\serialization.py", line 1280, in deserialize_enum
return enum_obj(str(data))
File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\enum.py", line 291, in __call__
return cls.__new__(cls, value)
File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\enum.py", line 533, in __new__
return cls._missing_(value)
File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\enum.py", line 546, in _missing_
raise ValueError("%r is not a valid %s" % (value, cls.__name__))
ValueError: 'ServiceConnect, DeviceConnect, RegistryWrite' is not a valid AccessRights
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\azure\cli\main.py", line 36, in main
cmd_result = APPLICATION.execute(args)
File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\azure\cli\core\application.py", line 212, in execute
result = expanded_arg.func(params)
File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\azure\cli\core\commands\__init__.py", line 377, in __call__
return self.handler(*args, **kwargs)
File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\azure\cli\core\commands\__init__.py", line 630, in _execute_command
raise client_exception
File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\azure\cli\core\commands\__init__.py", line 620, in _execute_command
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 602, in _execute_command
result = op(client, **kwargs) if client else op(**kwargs)
File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\azure\cli\command_modules\iot\custom.py", line 236, in iot_device_list
device_client = _get_device_client(client, resource_group_name, hub_name, '')
File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\azure\cli\command_modules\iot\custom.py", line 332, in _get_device_client
access_policy = iot_hub_policy_get(client, hub_name, 'iothubowner', resource_group_name)
File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\azure\cli\command_modules\iot\custom.py", line 135, in iot_hub_policy_get
return client.get_keys_for_key_name(resource_group_name, hub_name, policy_name)
File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\azure\mgmt\iothub\operations\iot_hub_resource_operations.py", line 1257, in get_keys_for_key_name
deserialized = self._deserialize('SharedAccessSignatureAuthorizationRule', response)
File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\msrest\serialization.py", line 992, in __call__
value = self.deserialize_data(raw_value, attr_desc['type'])
File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\msrest\serialization.py", line 1136, in deserialize_data
return self.deserialize_enum(data, obj_type)
File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\msrest\serialization.py", line 1286, in deserialize_enum
raise DeserializationError(error.format(data, enum_obj))
msrest.exceptions.DeserializationError: 'ServiceConnect, DeviceConnect, RegistryWrite' is not valid value for enum <enum 'AccessRights'>
Issue Analytics
- State:
- Created 6 years ago
- Comments:18 (14 by maintainers)
Top Results From Across the Web
Troubleshooting Azure IoT Hub error codes | Microsoft Learn
You may see requests to IoT Hub fail with the error 403002 IoTHubQuotaExceeded. And in Azure portal, the IoT hub device list doesn't...
Read more >[BUG] Failed to retrieve device list. It is possibly due to an ...
IoT.explorer.0.10.7.msi; Provide the IoT hub connection string and click on Connect; See error popup saying "Failed to retrieve device list.
Read more >What is the expected error code returned if the IoTHub device ...
IOTHUB_CLIENT_CONNECTION_DEVICE_DISABLED ->Device could not be authenticated because it is disabled by the user on the Azure IoT Hub (see field ...
Read more >Azure IoT Hub | Dev Center - Electric Imp
Registry class is used to manage IoT Hub devices. This class allows you to create, remove, update, delete and list the IoT Hub...
Read more >azure-iothub - npm
npm install azure-iothub to get the latest version. Features. Create/remove/update/list device identities in your IoT hub; Send messages to your ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It seems like the (de)serialization should not be this brittle. While many language specifications say that enum.value() calls will return an array in declared order … it seems overly brittle to push this stance from either the server or client side of an API.
Hi All, Thank you for reporting the issue. We identified an issue in our backend service. We are actively working on a fix. ETA: end of the day. Sorry for the inconvenience it caused.