Skip to content

SSL root certificate upload fails: "Error during firmware flashing: missing board address" #2179

Closed
@per1234

Description

@per1234

Describe the problem

Arduino IDE includes a tool for uploading SSL root certificates to the network connectivity module of certain Arduino boards.

🐛 A spurious failure occurs whenever attempting to use the tool.

To reproduce

Equipment

One of the boards supported by the "Upload SSL Root Certificates" feature:

Steps

  1. Connect the certificate upload target board to your computer with a USB cable if it is not already.
  2. Select Tools > Upload SSL Root Certificates from the Arduino IDE menus.
  3. Check the box to the right of "arduino.cc:443" in the "1. Select certificate to upload" field.
  4. Select the board from the "2. Select destination board and upload certificate" menu.
  5. Click the "UPLOAD" button.

🐛 The process fails unexpectedly:

⚠ Upload failed. Please try again.

If you check the logs, you see it was caused by an "Error during firmware flashing: missing board address" error:

2023-08-19T21:25:17.060Z fwuploader ERROR Error: Error executing C:\arduino-tools\214-69ae38e\resources\app\lib\backend\resources\arduino-fwuploader.exe certificates flash -b arduino:samd:nano_33_iot -a COM5 -u arduino.cc:443: Error during firmware flashing: missing board address
    at ChildProcess.<anonymous> (C:\arduino-tools\214-69ae38e\resources\app\lib\backend\main.js:2:603367)
    at ChildProcess.emit (node:events:513:28)
    at ChildProcess._handle.onexit (node:internal/child_process:291:12)
2023-08-19T21:25:17.060Z root ERROR Request uploadCertificates failed with error: Error executing C:\arduino-tools\214-69ae38e\resources\app\lib\backend\resources\arduino-fwuploader.exe certificates flash -b arduino:samd:nano_33_iot -a COM5 -u arduino.cc:443: Error during firmware flashing: missing board address Error: Error executing C:\arduino-tools\214-69ae38e\resources\app\lib\backend\resources\arduino-fwuploader.exe certificates flash -b arduino:samd:nano_33_iot -a COM5 -u arduino.cc:443: Error during firmware flashing: missing board address
    at ChildProcess.<anonymous> (C:\arduino-tools\214-69ae38e\resources\app\lib\backend\main.js:2:603367)
    at ChildProcess.emit (node:events:513:28)
    at ChildProcess._handle.onexit (node:internal/child_process:291:12)

Expected behavior

"Upload SSL Root Certificates" tool is functional.

Arduino IDE version

69ae38e

Operating system

Windows

Operating system version

11

Additional context

I bisected the regression to 9d2297c (does not occur when using the build for the previous commit e47fb2e).

I see that an array of arguments is used for the arduino-fwuploader firmware invocations, which did not experience a regression:

const output = await this.runCommand([
'firmware',
'flash',
'--fqbn',
firmware.board_fqbn,
'--address',
port.address,
'--module',
`${firmware.module}@${firmware.firmware_version}`,
]);

while the flag arguments are passed as a string in the arduino-fwuploader certificates flash invocation:

return this.arduinoFirmwareUploader.uploadCertificates(
`-b ${fqbn} -a ${address} ${urls
.map((url: string) => `-u ${url}`)
.join(' ')}`
);


Confusingly, the command line shown in the error message in the logs does correctly contain the -a address flag it claims is missing:

C:\arduino-tools\214-69ae38e\resources\app\lib\backend\resources\arduino-fwuploader.exe certificates flash -b arduino:samd:nano_33_iot -a COM5 -u arduino.cc:443

You can produce the "Error during firmware flashing: missing board address" error when invoking the command directly by wrapping the set of flags in a single set of quotes:

$ "C:\arduino-tools\214-69ae38e\resources\app\lib\backend\resources\arduino-fwuploader.exe" certificates flash "-b arduino:samd:nano_33_iot -a COM5 -u arduino.cc:443"
Error during firmware flashing: missing board address

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