Skip to content
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

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

Closed
3 tasks done
KurtE opened this issue Jul 17, 2022 · 6 comments · Fixed by #1848
Closed
3 tasks done

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

KurtE opened this issue Jul 17, 2022 · 6 comments · Fixed by #1848
Assignees
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself topic: gRPC Related to the gRPC interface type: imperfection Perceived defect in any part of project

Comments

@KurtE
Copy link

KurtE commented Jul 17, 2022

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
@KurtE KurtE added the type: imperfection Perceived defect in any part of project label Jul 17, 2022
@KurtE
Copy link
Author

KurtE commented Jul 17, 2022

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
Copy link
Contributor

per1234 commented Jul 17, 2022

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

@per1234 per1234 added the topic: CLI Related to the command line interface label Jul 17, 2022
@KurtE
Copy link
Author

KurtE commented Jul 18, 2022

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
Copy link
Contributor

per1234 commented Jul 18, 2022

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.

@per1234 per1234 self-assigned this Jul 18, 2022
@kittaakos
Copy link
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 transferred this issue from arduino/arduino-ide Jul 22, 2022
@per1234
Copy link
Contributor

per1234 commented Jul 22, 2022

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.

@per1234 per1234 added topic: code Related to content of the project itself topic: gRPC Related to the gRPC interface and removed topic: CLI Related to the command line interface labels Jul 22, 2022
@per1234 per1234 assigned cmaglie and unassigned per1234 Jul 22, 2022
@per1234 per1234 added the conclusion: resolved Issue was resolved label Aug 24, 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 topic: gRPC Related to the gRPC interface type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants