Skip to content

Error when calling getBoardUserFields from CLI #1142

Closed
@kittaakos

Description

@kittaakos

Describe the problem

I have the following boards connected:

[
  {
    "port": {
      "address": "/dev/cu.BLTH",
      "label": "/dev/cu.BLTH",
      "protocol": "serial",
      "protocol_label": "Serial Port"
    }
  },
  {
    "port": {
      "address": "/dev/cu.Bluetooth-Incoming-Port",
      "label": "/dev/cu.Bluetooth-Incoming-Port",
      "protocol": "serial",
      "protocol_label": "Serial Port"
    }
  },
  {
    "matching_boards": [
      {
        "name": "Arduino MKR1000",
        "fqbn": "arduino:samd:mkr1000"
      }
    ],
    "port": {
      "address": "/dev/cu.usbmodem14401",
      "label": "/dev/cu.usbmodem14401",
      "protocol": "serial",
      "protocol_label": "Serial Port (USB)",
      "properties": {
        "pid": "0x804E",
        "serialNumber": "94A3397C5150435437202020FF150838",
        "vid": "0x2341"
      }
    }
  },
  {
    "matching_boards": [
      {
        "name": "Arduino Nano RP2040 Connect",
        "fqbn": "arduino:mbed_nano:nanorp2040connect"
      }
    ],
    "port": {
      "address": "/dev/cu.usbmodem14301",
      "label": "/dev/cu.usbmodem14301",
      "protocol": "serial",
      "protocol_label": "Serial Port (USB)",
      "properties": {
        "pid": "0x005E",
        "serialNumber": "FFFFFFFFFFFFFFFF",
        "vid": "0x2341"
      }
    }
  }
]

Screen Shot 2022-07-04 at 15 44 10

Frontend error:

Uncaught (in promise) Error: Request 'getBoardUserFields' failed
    at Proxy.<anonymous> (proxy-factory.ts:237)
    at BoardsServiceProvider.selectedBoardUserFields (boards-service-provider.ts:292)
    at upload-sketch.ts:48
    at event.ts:128
    at CallbackList.invoke (event.ts:136)
    at Emitter.fire (event.ts:279)
    at boards-service-provider.ts:254
    at <anonymous>

Backend error:

root ERROR Request getBoardUserFields failed with error: 9 FAILED_PRECONDITION: Platform 'arduino:mbed_nano' not found: platform arduino:mbed_nano is not installed Error: 9 FAILED_PRECONDITION: Platform 'arduino:mbed_nano' not found: platform arduino:mbed_nano is not installed
    at Object.callErrorFromStatus (/Users/a.kitta/dev/git/arduino-ide/node_modules/@grpc/grpc-js/build/src/call.js:31:26)
    at Object.onReceiveStatus (/Users/a.kitta/dev/git/arduino-ide/node_modules/@grpc/grpc-js/build/src/client.js:189:52)
    at Object.onReceiveStatus (/Users/a.kitta/dev/git/arduino-ide/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:365:141)
    at Object.onReceiveStatus (/Users/a.kitta/dev/git/arduino-ide/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:328:181)
    at /Users/a.kitta/dev/git/arduino-ide/node_modules/@grpc/grpc-js/build/src/call-stream.js:187:78
    at processTicksAndRejections (node:internal/process/task_queues:78:11)

To reproduce

I was in the middle of testing #1130.

  • I wiped my Arduin data folder (rm -rf ~/Library/Arduino15 on macOS)
  • I opened the dev tools and executed localStorage.clear() from the console,
  • Reload the window,
  • See the errors

Expected behavior

When getting the board details, IDE2 gracefully handles when the platform is not installed.

// Required cores are not installed manually: https://github.com/arduino/arduino-cli/issues/954
if (
(err.message.indexOf('missing platform release') !== -1 &&
err.message.indexOf('referenced by board') !== -1) ||
// Platform is not installed.
(err.message.indexOf('platform') !== -1 &&
err.message.indexOf('not installed') !== -1)
) {
resolve(undefined);
return;
}
// It's a hack to handle https://github.com/arduino/arduino-cli/issues/1262 gracefully.
if (err.message.indexOf('unknown package') !== -1) {
resolve(undefined);
return;

This is missing from the user fields.

Arduino IDE version

HEAD

Operating system

macOS

Operating system version

12.3.1

Additional context

No response

Issue checklist

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions