Bug 2092910

Summary: [abrt] esptool: open(): serialposix.py:268:open:serial.serialutil.SerialException: [Errno 2] could not open port /dev/ttyUSB0: [Errno 2] No such file or directory: '/dev/ttyUSB0'
Product: [Fedora] Fedora Reporter: Chipeng Li <chplee>
Component: esptoolAssignee: Karolina Surma <ksurma>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 36CC: ksurma, mhroncok, python-sig
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
URL: https://retrace.fedoraproject.org/faf/reports/bthash/6575528a9e5f66e05544c2d6ac9415b56ed19620
Whiteboard: abrt_hash:f78f0d3857025df84accc3dceaba79b4ce0f61cf;VARIANT_ID=workstation;
Fixed In Version: esptool-4.1-3.fc37 esptool-3.3.1-1.fc35 esptool-3.3.1-1.fc36 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-06-22 12:49:24 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
File: backtrace
none
File: cpuinfo
none
File: environ
none
File: mountinfo
none
File: namespaces
none
File: open_fds none

Description Chipeng Li 2022-06-02 14:16:39 UTC
Description of problem:
"could not open port" error has not handled.

Version-Release number of selected component:
esptool-3.2-2.fc36

Additional info:
reporter:       libreport-2.17.1
cgroup:         0::/user.slice/user-1000.slice/user/app.slice/app-org.gnome.Terminal.slice/vte-spawn-a8be372b-bc99-4c60-ae91-3a3ccca15680.scope
cmdline:        /usr/bin/python3 -s /usr/bin/esptool --chip esp32c3 --port /dev/ttyUSB0 --baud 921600 flash_id
crash_function: open
exception_type: FileNotFoundError
executable:     /usr/bin/esptool
interpreter:    python3-3.10.4-1.fc36.x86_64
kernel:         5.17.11-300.fc36.x86_64
runlevel:       N 5
type:           Python3
uid:            1000

Truncated backtrace:
serialposix.py:268:open:serial.serialutil.SerialException: [Errno 2] could not open port /dev/ttyUSB0: [Errno 2] No such file or directory: '/dev/ttyUSB0'

Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/serial/serialposix.py", line 265, in open
    self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)
FileNotFoundError: [Errno 2] No such file or directory: '/dev/ttyUSB0'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/esptool", line 5143, in <module>
    _main()
  File "/usr/bin/esptool", line 5136, in _main
    main()
  File "/usr/bin/esptool", line 4541, in main
    esp = esp or get_default_connected_device(ser_list, port=args.port, connect_attempts=args.connect_attempts,
  File "/usr/bin/esptool", line 125, in get_default_connected_device
    _esp = chip_class(each_port, initial_baud, trace)
  File "/usr/bin/esptool", line 329, in __init__
    self._port = serial.serial_for_url(port)
  File "/usr/lib/python3.10/site-packages/serial/__init__.py", line 88, in serial_for_url
    instance.open()
  File "/usr/lib/python3.10/site-packages/serial/serialposix.py", line 268, in open
    raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
serial.serialutil.SerialException: [Errno 2] could not open port /dev/ttyUSB0: [Errno 2] No such file or directory: '/dev/ttyUSB0'

Local variables in innermost frame:
self: Serial<id=0x7f8bb7f0d4b0, open=False>(port='/dev/ttyUSB0', baudrate=9600, bytesize=8, parity='N', stopbits=1, timeout=None, xonxoff=False, rtscts=False, dsrdtr=False)

Potential duplicate: bug 1925968

Comment 1 Chipeng Li 2022-06-02 14:16:43 UTC
Created attachment 1886103 [details]
File: backtrace

Comment 2 Chipeng Li 2022-06-02 14:16:44 UTC
Created attachment 1886104 [details]
File: cpuinfo

Comment 3 Chipeng Li 2022-06-02 14:16:45 UTC
Created attachment 1886105 [details]
File: environ

Comment 4 Chipeng Li 2022-06-02 14:16:47 UTC
Created attachment 1886106 [details]
File: mountinfo

Comment 5 Chipeng Li 2022-06-02 14:16:48 UTC
Created attachment 1886107 [details]
File: namespaces

Comment 6 Chipeng Li 2022-06-02 14:16:49 UTC
Created attachment 1886108 [details]
File: open_fds

Comment 7 Karolina Surma 2022-06-06 14:07:02 UTC
Does /dev/ttyUSB0 exist on your system?

Comment 8 Chipeng Li 2022-06-08 20:17:15 UTC
no ttyUSB0 in there.

maybe you can put a try-except block in esptool? to avoid triggering abrt.

Comment 9 Karolina Surma 2022-06-09 12:52:18 UTC
Thank you for the report. I wasn't aware this problem triggers abrt.
See upstream PR: https://github.com/espressif/esptool/pull/751.
We will backport it to esptool in Fedora 36.

Comment 11 Fedora Update System 2022-06-22 12:46:27 UTC
FEDORA-2022-16e68a849a has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2022-16e68a849a

Comment 12 Fedora Update System 2022-06-22 12:49:24 UTC
FEDORA-2022-16e68a849a has been pushed to the Fedora 37 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 13 Fedora Update System 2022-06-23 06:50:33 UTC
FEDORA-2022-6e23de3038 has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-6e23de3038

Comment 14 Fedora Update System 2022-06-23 06:51:06 UTC
FEDORA-2022-4c59060b08 has been submitted as an update to Fedora 35. https://bodhi.fedoraproject.org/updates/FEDORA-2022-4c59060b08

Comment 15 Fedora Update System 2022-06-24 00:50:00 UTC
FEDORA-2022-6e23de3038 has been pushed to the Fedora 36 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2022-6e23de3038`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-6e23de3038

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 16 Fedora Update System 2022-06-24 02:22:13 UTC
FEDORA-2022-4c59060b08 has been pushed to the Fedora 35 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2022-4c59060b08`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-4c59060b08

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 17 Fedora Update System 2022-07-02 01:19:53 UTC
FEDORA-2022-4c59060b08 has been pushed to the Fedora 35 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 18 Fedora Update System 2022-07-02 01:47:39 UTC
FEDORA-2022-6e23de3038 has been pushed to the Fedora 36 stable repository.
If problem still persists, please make note of it in this bug report.