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

Library Manager install fails ~silently if dependency not available #621

Closed
3 tasks done
butor32 opened this issue Nov 18, 2021 · 5 comments · Fixed by #2061
Closed
3 tasks done

Library Manager install fails ~silently if dependency not available #621

butor32 opened this issue Nov 18, 2021 · 5 comments · Fixed by #2061
Assignees
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@butor32
Copy link

butor32 commented Nov 18, 2021

Describe the problem

Installation of version 3.0.0 of the "Forced-BME280" by Jocchem van Kranenburg via Library Manager fails silently.

To reproduce

  1. Open the "LIBRARY MANAGER" view.
  2. Type forced-bme280 in the "Filter your search..." field.
  3. Select "3.0.0" from the dropdown version menu in the "Forced-BME280" library entry.
  4. Click the "INSTALL" button.

🐛 The library installation fails silently.

Expected behavior

The cause of the problem is clearly communicated to the user when it is not possible to install a library.

Arduino IDE version

Original report

2.0.0-beta.12

Last verified with

964ea3b

Operating system

  • Windows
  • Linux

Operating system version

  • Windows 11
  • Debian Blueseye

Additional context

An error is shown in the terminal window:

root ERROR Request listDependencies failed with error: 9 FAILED_PRECONDITION: No valid dependencies solution found: dependency 'stdint' is not available

However, the message only flashes for an instant in the Arduino IDE window; so fast that the user could never read it.

Additional reports

Workaround

Use the "Add .ZIP Library..." method to install the problematic library:

https://docs.arduino.cc/software/ide-v1/tutorials/installing-libraries#importing-a-zip-library

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
@butor32 butor32 added the type: imperfection Perceived defect in any part of project label Nov 18, 2021
@per1234 per1234 self-assigned this Nov 18, 2021
@per1234
Copy link
Contributor

per1234 commented Nov 18, 2021

Hi @butor32. Thanks for your report. This error is caused by the "Forced-BME280" having invalid metadata. I have submitted a pull request to correct this problem in the library:

JVKran/Forced-BME280#9

That will only fix one specific instance of this problem, and even then the previous versions of the library will still have it. Arduino does not control the metadata of the thousands of Library Manager libraries, so it is inevitable that some will have minor problems in their metadata such as this one. It could even happen through no fault of the library author in the event the name of one of its dependencies is changed.

So it is essential for the Arduino IDE to be designed to function even in the face of problematic external data. At the very minimum, the problem should be clearly communicated to the user. But the better approach is to handle it gracefully, as is done by the classic Arduino IDE. Even with Arduino CLI, although the standard installation fails, it does so with a clear error message and the user can still install the library via the use of the --no-deps flag.

We can use this issue to track that need to improve the user experience when this happens.

Related

@per1234 per1234 assigned giannicolab and unassigned per1234 Nov 18, 2021
@per1234 per1234 added the topic: code Related to content of the project itself label Nov 18, 2021
@per1234 per1234 changed the title Library Manager error Library Manager install fails ~silently if dependency not available Nov 19, 2021
@butor32
Copy link
Author

butor32 commented Nov 19, 2021

Hi @per1234,
For me you have a second bug, when a user add a library you must control metadata before you add library into your base.
Best regard

butor32

@per1234
Copy link
Contributor

per1234 commented Nov 19, 2021

Thanks for your suggestion! We do check the validity of the metadata before accepting the library into Library Manager. We do detect this condition and warn the library submitter about it (example). However it is only treated as a warning. The reason for that is multiple interdependent libraries may be submitted simultaneously, which results in a spurious failure of the check.

We also check the metadata before adding each release of the library once accepted. However, the specific contents of this field has not historically been validated because the original system did not have that capability. That means there is a tricky situation where we have a legacy of library releases such as those of the "Forced-BME280" library in the database and those could be affected retroactively if we made this check more strict.

@kittaakos
Copy link
Contributor

It's still happening with 2.1.0.

I tried to install OpenMV Arduino RPC, and nothing happened. The problem is clearly outside the context of IDE2, but IDE2 must print the error to the user.

The error is unhandled in IDE2's frontend:

Uncaught (in promise) Error: 9 FAILED_PRECONDITION: No valid dependencies solution found: dependency 'SoftwareSerial' is not available
    at y.<computed> (bundle.js:2)
    at B (bundle.js:2)
    at Array.n [as read] (bundle.js:2)
    at J (bundle.js:2)
    at B (bundle.js:2)
    at I (bundle.js:2)
    at Te.unpack (bundle.js:2)
    at Te.decode (bundle.js:2)
    at t.MsgPackMessageDecoder.decode (bundle.js:2)
    at t.MsgPackMessageDecoder.parse (bundle.js:2)

The problem is clearly outside the context of IDE2

% /Applications/Arduino\ IDE\ 2.1.0.app/Contents/Resources/app/node_modules/arduino-ide-extension/build/arduino-cli version                    
arduino-cli  Version: 0.32.2 Commit: 2661f5d9 Date: 2023-04-12T09:41:48Z
% /Applications/Arduino\ IDE\ 2.1.0.app/Contents/Resources/app/node_modules/arduino-ide-extension/build/arduino-cli lib install "OpenMV Arduino RPC"
Error installing OpenMV Arduino RPC: No valid dependencies solution found: dependency 'SoftwareSerial' is not available
  • Open IDE2, and
  • Install OpenMV Arduino RPC
install_openmv_arduino_rpc.mp4

IDE2 shows an error notification with Error installing OpenMV Arduino RPC: No valid dependencies solution found: dependency 'SoftwareSerial' is not available.

I am adding myself as the assignee, fixing the problem to show the error as a notification or output message, and @91volt can help polish the UX.

@kittaakos kittaakos self-assigned this May 10, 2023
@kittaakos
Copy link
Contributor

It turned out that the problematic part was listing the dependencies before installing it. I will add a quick fix.

kittaakos pushed a commit that referenced this issue May 10, 2023
Closes #621

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
kittaakos pushed a commit that referenced this issue May 11, 2023
Closes #621

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
@per1234 per1234 added the conclusion: resolved Issue was resolved label May 11, 2023
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: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants