Skip to content

'az iot central device command run' Throws Internal Error #361

@scout208

Description

@scout208

Describe the bug

Trying to run the GetModuleLogs command on an IoT Central device throws an exception. See the trace below.

Command Name
az iot central device command run Extension Name: azure-iot. Version: 0.10.11.

Errors:

[Errno 2] No such file or directory: '\\'
Traceback (most recent call last):
Temp\pip-unpacked-wheel-rpp6y7vh\knack\cli.py, ln 215, in invoke
cli\core\commands\__init__.py, ln 659, in execute
cli\core\commands\__init__.py, ln 722, in _run_jobs_serially
cli\core\commands\__init__.py, ln 715, in _run_job
Local\Temp\pip-unpacked-wheel-igh1xymj\six.py, ln 703, in reraise
cli\core\commands\__init__.py, ln 693, in _run_job
cli\core\commands\__init__.py, ln 330, in __call__
...
    content = read_file_content(content)
azure-iot\azext_iot\common\utility.py, ln 174, in read_file_content
    with codecs_open(file_path, encoding=encoding) as f:
codecs.py, ln 897, in open
FileNotFoundError: [Errno 2] No such file or directory: '\\'

To Reproduce:

  • Run the following command, replacing appid, deviceid, and interfaceid with values for your solution:
az iot central device command run -n {appid} -d {deviceid} -i {interfaceid} --cn 'GetModuleLogs' -k \
'{
  "schemaVersion": "1.0",
   "items": [
     {
       "id": "$edgeAgent",
       "filter": {
         "tail": 10
       }
     }
   ],
   "encoding": "none",
   "contentType": "text"
}'

Expected Behavior

This command should return the logs from the module.

Environment Summary

Windows-10-10.0.19041-SP0
Python 3.6.8
Installer: MSI

azure-cli 2.17.1 *

Extensions:
azure-iot 0.10.11

Additional Context

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions