Skip to content

Compilation error: grpc: error while marshaling: proto: Marshal called with nil #1812

Closed
@KurtE

Description

@KurtE

Describe the problem

Sorry there is probably something screwy in this code, that I am hacking up...

I tried to do a verify operation, and the build aborted with an error:

grpc: error while marshaling: proto: Marshal called with nil

Compilation error: grpc: error while marshaling: proto: Marshal called with nil

That was all of the output, all in orangish color.

I have no idea what that error is supposed to imply.

To reproduce

Not sure, but I included the code... Note: this code is not done yet, nor may never be used, but just an experiment on Teensy 3.2, to see if I can use FTM timer to capture pulse widths and maybe generate specific pulses...

I simply clicked on verify with this sketch, which includes a header file, which is part of the sketch.

t3x_test_ftm_pin_capture-220717a.zip

Expected behavior

I am guessing probably lots of error messages.

Arduino IDE version

20220716

Operating system

Windows

Operating system version

Windows 10

Additional context

I am running with yesterdays IDE did not see any updates for today.

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

Activity

KurtE

KurtE commented on Jul 17, 2022

@KurtE
Author

I believe I figured it out what happened.

Before this I had done a SaveAs operation to this new name. The code hung with spinning ... So I closed out the window (and process). Restarted IDE. Browsed to the new saved file and tried to do the compile...

But turned out it had forgotten I was building for T3.1/2 and had the simple chose board... in drop down list.
Going back up and choose T3.1 now it behaves normal...

Side note: Thought maybe had issue with the new sketch name. So I exited the IDE, used browser to rename the directory and sketch to different name. I then restarted the IDE. Looks like it had issue with not finding the last sketch that was last edited, and gave me a blank window... Also the Sketchbook tab area showed as empty, but was able to go up to File ->Sketchbook and open up the sketch with the new name.

per1234

per1234 commented on Jul 17, 2022

@per1234
Contributor

had the simple chose board... in drop down list.

Do you mean the "❌ No board selected" like this?

image

I gave it a try but I only got the expected "Missing FQBN" message rather than the unexpected error you reported.

I exited the IDE, used browser to rename the directory and sketch to different name. I then restarted the IDE. Looks like it had issue with not finding the last sketch that was last edited, and gave me a blank window...

I guess it is the same issue you reported at arduino/arduino-ide#1089. That will be fixed by arduino/arduino-ide#1152

KurtE

KurtE commented on Jul 18, 2022

@KurtE
Author

Maybe, I just reproduced it.

I was verifying fine... Then I decided to program a board, so I turned it on, and tried to compile and it warned that I need to select a board...

I then clicked on the drop down list (select board), which brought up dialog where you can choose the board type..., I then canceled, the dialog.

I then tried to do a verify and got that error.
image

per1234

per1234 commented on Jul 18, 2022

@per1234
Contributor

OK, I am able to reproduce it now. I was using a slightly outdated version of the IDE before.

This was a regression introduced by arduino/arduino-ide@73835ec.

The menu item text was also just changed, but by a different commit unrelated to this new unpleasant error message.

self-assigned this
on Jul 18, 2022
kittaakos

kittaakos commented on Jul 18, 2022

@kittaakos
Contributor

I then clicked on the drop down list (select board), which brought up dialog where you can choose the board type..., I then canceled, the dialog.

It's tracked here: arduino/arduino-ide#1204

per1234

per1234 commented on Jul 22, 2022

@per1234
Contributor

I determined this is a bug in the Arduino CLI codebase, so I have moved the issue to the appropriate repository.

I bisected the issue to a5466d0

In case it will be useful, I will provide instructions for reproducing the issue using the Arduino CLI gRPC interface directly (the issue does not occur when using the Arduino CLI command line interface).

Set up

$ arduino-cli version
arduino-cli.exe  Version: 0.25.1-rc1 Commit: 436f0bb9 Date: 2022-07-22T15:47:42Z

$ arduino-cli sketch new /tmp/FooSketch

$ arduino-cli daemon

Demo

Use grpcurl to run the following commands in another terminal:

$ grpcurl \
  -plaintext \
  -import-path ./rpc \
  -proto cc/arduino/cli/commands/v1/commands.proto \
  127.0.0.1:50051 \
  cc.arduino.cli.commands.v1.ArduinoCoreService.Create

{
  "instance": {
    "id": 1
  }
}

$ grpcurl \
  -plaintext \
  -import-path ./rpc \
  -proto cc/arduino/cli/commands/v1/commands.proto \
  -d '{"instance": {"id": 1}}' \
  127.0.0.1:50051 \
  cc.arduino.cli.commands.v1.ArduinoCoreService.Init

$ grpcurl \
  -plaintext \
  -import-path ./rpc \
  -proto cc/arduino/cli/commands/v1/commands.proto \
  -d '{"instance": {"id": 1}, "sketch_path": "/tmp/FooSketch"}' \
  127.0.0.1:50051 \
  cc.arduino.cli.commands.v1.ArduinoCoreService.Compile

ERROR:
  Code: Internal
  Message: grpc: error while marshaling: proto: Marshal called with nil

Since the fqbn field was omitted from the cc.arduino.cli.commands.v1.ArduinoCoreService.Compile request, an error is expected. However, it should be the slightly more user friendly "Missing FQBN (Fully Qualified Board Name)" error that was returned prior to a5466d0.

added
topic: codeRelated to content of the project itself
topic: gRPCRelated to the gRPC interface
and removed
topic: CLIRelated to the command line interface
on Jul 22, 2022
assigned and unassigned on Jul 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

conclusion: resolvedIssue was resolvedtopic: codeRelated to content of the project itselftopic: gRPCRelated to the gRPC interfacetype: imperfectionPerceived defect in any part of project

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    Participants

    @cmaglie@kittaakos@KurtE@per1234

    Issue actions

      Compilation error: grpc: error while marshaling: proto: Marshal called with nil · Issue #1812 · arduino/arduino-cli