Skip to content

Make "Error installing: There were errors loading platform indexes" error more informative #792

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
jonathangjertsen opened this issue Jul 6, 2020 · 6 comments
Assignees
Labels
conclusion: resolved Issue was resolved topic: CLI Related to the command line interface type: enhancement Proposed improvement

Comments

@jonathangjertsen
Copy link

Bug Report

Current behavior

I have a Travis CI setup which runs a build script with the following commands

curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh
./bin/arduino-cli core install arduino:avr

The first command succeeds with the following output:

Installing in /home/travis/build/jonathangjertsen/dht11/build/bin
ARCH=64bit
OS=Linux
Using curl as download tool
TAG=0.11.0
CLI_DIST=arduino-cli_0.11.0_Linux_64bit.tar.gz
Downloading https://downloads.arduino.cc/arduino-cli/arduino-cli_0.11.0_Linux_64bit.tar.gz
arduino-cli not found. You might want to add /home/travis/build/jonathangjertsen/dht11/build/bin to your $PATH

The second command fails with the following output:

Downloading missing tool builtin:[email protected]...
builtin:[email protected] downloaded                                          
Installing builtin:[email protected]...
builtin:[email protected] installed
Downloading missing tool builtin:[email protected]...
builtin:[email protected] downloaded                                       
Installing builtin:[email protected]...
builtin:[email protected] installed
Updating index: library_index.json downloaded                                   
Error installing: There were errors loading platform indexes

Expected behavior

I would expect the installation to succeed, or at least to provide an actionable error message

Environment

  • CLI version (output of arduino-cli version): arduino-cli Version: 0.11.0 Commit: 0296f4d
  • OS and platform: Ubuntu 16.04.6 LTS, linux/amd64 (Docker)
@per1234
Copy link
Contributor

per1234 commented Jul 7, 2020

Hi @jonathangjertsen. You forgot to download the platform indexes by running the command:

./bin/arduino-cli core update-index

There is a nice tutorial about using Arduino CLI here:
https://arduino.github.io/arduino-cli/latest/getting-started

@jonathangjertsen
Copy link
Author

How silly of me, thanks!

I would suggest updating the error message to include more information about the error. The code that emits this error message does not seem to print the previous error message(s) that caused the error

return errors.New("There were errors loading platform indexes")

@per1234 per1234 changed the title Error installing: There were errors loading platform indexes Make "Error installing: There were errors loading platform indexes" error more informative Jul 7, 2020
@per1234
Copy link
Contributor

per1234 commented Jul 7, 2020

thanks!

You're welcome. I'm glad if was able to assist you in using Arduino CLI for your CI needs. It's certainly the right tool for the job!

I would suggest updating the error message to include more information about the error.

I updated the title and left the issue open to allow the Arduino CLI team to consider your suggestion.

jonathangjertsen added a commit to jonathangjertsen/dht11 that referenced this issue Jul 9, 2020
@Inc0n
Copy link

Inc0n commented Jul 9, 2020

Hi,

I was using arduino-cli on my mkr-wifi-1010, after successfully compile the sketch, I had this error during the upload it to the board.
I had run the update commands several times

arduino-cli core update-index

The command I ran:

sudo arduino-cli upload --fqbn arduino:samd:mkrwifi1010 -p /dev/ttyACM0 test

The full error message:

Error during Upload: There were errors loading platform indexes

EDIT: I think my issue is because I ran the command as sudo, and without it, my issue is about permission, which is unrelated as this issue

@namlee2
Copy link

namlee2 commented Aug 12, 2020

Hi,

I was using arduino-cli on my mkr-wifi-1010, after successfully compile the sketch, I had this error during the upload it to the board.
I had run the update commands several times

arduino-cli core update-index

The command I ran:

sudo arduino-cli upload --fqbn arduino:samd:mkrwifi1010 -p /dev/ttyACM0 test

The full error message:

Error during Upload: There were errors loading platform indexes

EDIT: I think my issue is because I ran the command as sudo, and without it, my issue is about permission, which is unrelated as this issue

Hi!

I had the same issue as well, and thank god for forums (https://forum.arduino.cc/index.php?topic=495039.0)!
As you said, it's a permission issue, so here's the magic command:
sudo chmod a+rw /dev/ttyACM0
Once you did this, you don't even have to sudo your upload command.

Have a nice day!

@per1234 per1234 reopened this Mar 30, 2021
@rsora rsora removed the topic: CLI label Sep 16, 2021
@rsora rsora added topic: packaging Related to the release distribution package topic: CLI Related to the command line interface labels Sep 22, 2021
@per1234 per1234 removed the topic: packaging Related to the release distribution package label Sep 24, 2021
@umbynos
Copy link
Contributor

umbynos commented Oct 20, 2022

Hi @jonathangjertsen, this has changed a lot, but I think that now the error should be more clear:

feedback.Errorf(tr("Error updating indexes: %v"), err)

Furthermore, the index is downloaded when required #908, feel free to reopen this if needed

@umbynos umbynos closed this as completed Oct 20, 2022
@umbynos umbynos added the conclusion: resolved Issue was resolved label Oct 20, 2022
@umbynos umbynos self-assigned this Oct 20, 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: CLI Related to the command line interface type: enhancement Proposed improvement
Projects
None yet
Development

No branches or pull requests

7 participants