8000 Update-index could make other commands not work · Issue #81 · arduino/arduino-cli · GitHub
[go: up one dir, main page]

Skip to content
Update-index could make other commands not work #81
Closed
@brusherru

Description

@brusherru

BUG

Steps to reproduce

  1. Open .cli-config.yml
  2. Add additional URL: http://google.com/package_lalala_index.json. But let's imagine that URL is correct and should contain real package_lalala_index.json, but the server has gone down and returns 500 HTTP error.
  3. Run arduino-cli core update-index — it says all packages downloaded

Expected behavior
On the last step (update-index) we get an HTTP 500 error.
Probably, get an error in the stderr, but download other, available and valid, package indexes.
And then I can run arduino-cli core list and see no errors.

Actual behavior
It says all packages were downloaded:

Updating index: package_index.json downloaded                                     
Updating index: package_esp8266com_index.json downloaded                          
Updating index: package_lalala_index.json downloaded    

But when you run commands like arduino-cli core list or arduino-cli board listall it exits with an error:

Error: loading json index file /Users/MY_USER_NAME/arduino-cli/data/package_lalala_index.json: invalid character '<' looking for beginning of value
Failed to load http://google.com/package_lalala_index.json package index.
Try updating all indexes with `arduino-cli core update-index`.

It occurs, because package_lalala_index.json contains 404 HTML page.

Proposal how to fix
After downloading — check is it valid JSON (just try to parse).
And if not — delete it and add an error into stderr.
And if its possible to verify that is valid package file, it will be awesome.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0