Skip to content

[grpc] lib list and board details throw incorrect error when directories.data folder does not exist at daemon startup #1262

Closed
@kittaakos

Description

@kittaakos

Bug Report

As a gRPC consumer of the CLI, I receive an incorrect error message from lib list when the directories.data location does not exist before the InitRequest.

Current behavior

I cannot attach code, but this is my workflow:

  • Clean directories.data location (on macOS is it rm -rf ~/Library/Arduino15/),
  • Create a client with the InitRequest.
  • Note: at this point, the Arduino15 folder exists on my filesystem:
Arduino15 % ls -al
total 8
drwxr-xr-x   6 akos.kitta  staff   192 Apr 12 17:02 .
drwx------@ 92 akos.kitta  staff  2944 Apr 12 17:02 ..
-rw-r--r--   1 akos.kitta  staff   104 Apr 12 17:02 inventory.yaml
drwxr-xr-x   3 akos.kitta  staff    96 Apr 12 17:02 packages
drwxr-xr-x   3 akos.kitta  staff    96 Apr 12 17:02 staging
drwxr-xr-x   2 akos.kitta  staff    64 Apr 12 17:02 tmp
  • Run a LibraryListRequest
{
  "instance": { "id": 1 },
  "all": true,
  "updatable": false,
  "name": "",
  "fqbn": "arduino:samd:arduino_zero_edbg"
}
  • It fails, but with an incorrect error message:
2 UNKNOWN: loading board data: unknown package arduino

Expected behavior

  • The LibraryListRequest fails, but with the following error message:
2 UNKNOWN: loading board data: platform arduino:samd is not installed

Environment

  • CLI version (output of arduino-cli version): arduino-cli alpha Version: nightly-20210408 Commit: a4ee670a Date: 2021-04-08T01:26:00Z
  • OS and platform:

Additional context

  • I had my Arduino Zero board attached.
  • I used the default CLI config with two additional 3rd party URLs.
  • I tried to run a RescanRequest right after the InitRequest and before the LibraryListRequest. The RescanResponse was completely broken on my side: it had one library and multiple platform errors.

Metadata

Metadata

Assignees

Labels

topic: codeRelated to content of the project itselftype: imperfectionPerceived defect in any part of project

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions