Skip to content

Update-index could make other commands not work #81

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
brusherru opened this issue Oct 30, 2018 · 0 comments
Closed

Update-index could make other commands not work #81

brusherru opened this issue Oct 30, 2018 · 0 comments
Assignees
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: enhancement Proposed improvement

Comments

@brusherru
Copy link

brusherru commented Oct 30, 2018

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.

@cmaglie cmaglie added the bug label Oct 31, 2018
@cmaglie cmaglie added this to the next alpha preview milestone Nov 8, 2018
@cmaglie cmaglie self-assigned this Nov 8, 2018
cmaglie added a commit to cmaglie/arduino-cli that referenced this issue Nov 8, 2018
as explained in arduino#81:

  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.
@cmaglie cmaglie closed this as completed in 5a02ce4 Nov 9, 2018
mastrolinux pushed a commit that referenced this issue Jul 16, 2019
as explained in #81:

  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.
per1234 added a commit that referenced this issue Aug 9, 2021
Fix regex for detecting misspelled library.properties
@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself conclusion: resolved Issue was resolved labels Jul 10, 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 type: enhancement Proposed improvement
Projects
None yet
Development

No branches or pull requests

3 participants