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

feature: add some specific exit error-codes for daemon startup #2352

Closed
3 tasks done
cmaglie opened this issue Oct 2, 2023 · 2 comments · Fixed by #2400 or #2402
Closed
3 tasks done

feature: add some specific exit error-codes for daemon startup #2352

cmaglie opened this issue Oct 2, 2023 · 2 comments · Fixed by #2400 or #2402
Assignees
Labels
topic: CLI Related to the command line interface type: enhancement Proposed improvement

Comments

@cmaglie
Copy link
Member

cmaglie commented Oct 2, 2023

Describe the request

From @kittaakos comment

Besides the application-level error handling for the services, I would like to get a proper exit code and a terminating daemon process when something went wrong. Now, IDE2 must sniff into the stderr of the process, parse such messages and kill the daemon process because it's not terminating, although the daemon is nonfunctional:

  • To determine a Failed to listen on TCP port. Address already in use. error message:
    failed to listen, address already in use, bind, only one usage of each socket address

  • For invalid address: Failed to listen on TCP port. Unknown address.:
    is unknown name or tcp/ and is an invalid port

  • To provide the Failed to listen on TCP port. Invalid port. to the user:
    is an invalid port and failed to serve

Describe the current behavior

Arduino CLI daemon will fail with no specific exit code.

Arduino CLI version

nightly

Operating system

N/A

Operating system version

N/A

Additional context

No response

Issue checklist

  • I searched for previous requests in the issue tracker
  • I verified the feature was still missing when using the nightly build
  • My request contains all necessary details
@cmaglie cmaglie added the type: enhancement Proposed improvement label Oct 2, 2023
@cmaglie cmaglie added this to the Arduino CLI 1.0 milestone Oct 2, 2023
@cmaglie cmaglie self-assigned this Oct 2, 2023
@cmaglie cmaglie added the topic: CLI Related to the command line interface label Oct 2, 2023
@cmaglie
Copy link
Member Author

cmaglie commented Oct 2, 2023

It also seems to fail if an invalid data-dir config is present:

% ./arduino-cli version                                 
arduino-cli  Version: git-snapshot Commit: c506f6a4 Date: 2023-10-02T15:09:22Z
% cat ./arduino-cli.yaml                                    
directories:
  data: /this/will/fail/on/macon/it/cannot/create/root/folders
% ./arduino-cli daemon --port 0 --config-file ./arduino-cli.yaml
Error: invalid path creating config dir: /this/will/fail/on/macon/it/cannot/create/root/folders error: mkdir /this: read-only file system

@kittaakos
Copy link
Contributor

#2352 (comment) is not yet resolved via #2400.

@kittaakos kittaakos reopened this Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: CLI Related to the command line interface type: enhancement Proposed improvement
Projects
None yet
2 participants