Skip to content

Error when calling getBoardUserFields from CLI #1142

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 Jul 4, 2022 · 0 comments · Fixed by #1325
Closed
3 tasks done

Error when calling getBoardUserFields from CLI #1142

kittaakos opened this issue Jul 4, 2022 · 0 comments · Fixed by #1325
Assignees
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@kittaakos
Copy link
Contributor

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
@kittaakos kittaakos added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels Jul 4, 2022
@kittaakos kittaakos self-assigned this Aug 16, 2022
kittaakos pushed a commit that referenced this issue Aug 16, 2022
@per1234 per1234 added the conclusion: resolved Issue was resolved label Aug 18, 2022
kittaakos pushed a commit to kittaakos/arduino-ide that referenced this issue Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved 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.

2 participants