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
Dependency Install Failure During Plugin Install Doesn't Fail The Plugin Install #4703
Comments
(I don't have a system info bundle, as this bug report came through a support ticket) |
I've had similar issues recently with my Google Drive plugins due to dependency issues. IIRC when that does happen the lines that show error are in red, but you're right the plugin still shows successful install. |
This is the interesting part, and what makes it a bug in OctoPrint (initially when I was reading I thought this was pip's problem):
From a quick look at the code, OctoPrint is probably picking up the 'Requirement already satisfied' lines (for the first couple of deps) and considering that pip has ignored installing everything, so we need a force-reinstall. But this is of course not the case. |
Yeah, I should have also said, for this user it was a “fresh” install in OctoPrint’s eyes, since the plug-in wasn’t loaded. But the package was on disk and OctoPrint was setup to use it, it just failed to load due to the missing package. |
Errors during install, e.g. due to dependency issues, that happened while a "Requirement already installed" message was present in the output as well, were wrongly read as a "reinstall needed" case if there was no failure line present for some reason. The logic has now been adjusted so that a reinstall will only be triggered if there was no `Error:` line in the output. A test case has been added as well. Closes #4703
This should now be fixed as of the above commit. The code now also checks if a line starting with This is a bit of a weird thing. I've so far only seen pip output neither In the log up there however, there is no result line either. I would have expected a final "Could not install OctoEverywhere" line due to the failure in installing the dependency, but that never happened. So that's a bit weird and unexpected. I really wish there was a well defined programmatic pip API, but there isn't and we are stuck with trying to parse output. Anyhow, I've added this as a test case to the unit test suite. |
That amazing! Thanks! I agree that it’s really strange that pip doesn’t have an api. I have seen a lot of PY projects that talk about how they would love to interface directly with pip, but have to rely on the cli. Anyways, thanks again! |
The problem
I had a community member reachout to me and say my plugin wasn't working after being installed. He sent his OctoPrint logs and it looked like one of the dependency libs OctoEverywehre uses wasn't installed on his system. I asked him to resinstall the plugin and send the install window output, and this is what he got:
What it looks like is, for some reason, the
dnspython
package failed to install from PyPi due to a domain lookup failure (ironic). But when it failed to install, the system didn't stop the plugin install or tell the user of the failure. Upon restart, my plugin fails to load due to the missing import.Ideally, I think if this happens, the plugin should not be installed since it won't be in a good state, with the missing dependency.
Did the issue persist even in safe mode?
Yes, it did persist
If you could not test in safe mode, please state why
No response
Version of OctoPrint
Latest
Operating system running OctoPrint
OctoPi
Printer model & used firmware incl. version
No response
Browser and version of browser, operating system running browser
No response
Checklist of files to include below
Additional information & file uploads
No response
The text was updated successfully, but these errors were encountered: