Skip to content

[gRPC]: Error object contains insufficient info when upload fails due to the busy serial port #1767

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

Closed
3 tasks done
kittaakos opened this issue Jun 15, 2022 · 1 comment · Fixed by #2183
Closed
3 tasks done
Assignees
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@kittaakos
Copy link
Contributor

kittaakos commented Jun 15, 2022

Describe the problem

If the upload failed due to the busy serial port, I would love to see that on the error object. Currently, the ServiceError object contains the following info:

{
    "code": 13,
    "details": "Failed uploading: uploading error: exit status 1",
    "metadata": {}
}

During the upload, the UploadResponse's out_stream contains ...... and the err_stream is empty.

However, I can see the following messages logged by the CLI daemon process:

{"level":"info","msg":"Performing 1200-bps touch reset on serial port /dev/cu.usbmodem14301","phase":"board reset","time":"2022-06-15T15:19:37+02:00"}
TOUCH: error during reset: opening port at 1200bps: Serial port busy

The CLI knows what went wrong, but with the current errors, it's impossible to show the real cause to the users.

To reproduce

  • Build the IDE2 from the sources,
  • Open the Java IDE, connect a board, upload, and start the serial monitor so that the serial port will be busy,
  • Start the IDE2 and debug the IDE2 backend code,
  • Start an upload from IDE2,
  • See the error object
{
    "code": 13,
    "details": "Failed uploading: uploading error: exit status 1",
    "metadata": {}
}

Expected behavior

The error object contains what is logged by the daemon process.

Arduino CLI version

arduino-cli Version: 0.23.0 Commit: 899dc91 Date: 2022-06-06T14:23:44Z

Operating system

macOS

Operating system version

12.3.1

Additional context

Maybe related: #1762

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the nightly build
  • My report contains all necessary details
@cmaglie
Copy link
Member

cmaglie commented Mar 17, 2023

May be related to #1762

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants