-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
Apache plugin does not seem to be working after update #5108
Comments
It seems your system has very old Can you update it? |
@raimov-uptime |
@ilyam8 Upgrading |
@raimov-uptime what version was the package? |
https://pypi.org/project/urllib3/1.12/#history Current is 1.24.1 (November 2018) I checked 1.12 (September 2015) and it has Retry object |
It was version 1.8.2. |
Oh man, 1.8.2 is April 2014 😄 Maybe it's a good idea to not merge the fix and force people to upgrade. @Ferroin what do you think? |
@cakrit same question |
Force upgrade is fine, but I think that the installer/updater should be checking for the required version. |
I'm with @cakrit on this one, it makes no sense to support such ancient versions, but the installer should check versions for everything we depend on and issue appropriate errors or warnings if the version requirement isn't met. |
We are vendoring urllib3 package so there is no need to do such checks: https://github.com/netdata/netdata/tree/master/collectors/python.d.plugin/python_modules/urllib3 |
append |
But why?! We are vendoring libraries which we need, so why we even use system ones? |
I am not sure the Actually it will. Netdata's urllib3 version is 1.21 I see from the change log they drop support for py2.6 only in 1.24 |
The problem is that we kind of need to supplement the system libraries. There are a lot of our python.d modules that depend on specific third-party Python libraries which need to be installed on the system, and those need to find the versions of modules they expect to. So, we either need to support using the system libraries, or we need to vendor everything. This goes double for |
Also, when we move to actual packaging, we should be moving away from vendoring things like this and switch to using proper package dependencies (because we'll be able to properly leverage the package manager at that point). |
@paulfantom is talking about import order, we can do insert instead of append. |
Rename |
But that still runs the risk of breaking third-party libraries that our modules depend on which in turn depend on urllib3. Actually breaking anything that way is probably not very likely, but it's still worth considering.
Yes, but that will run the risk of increasing memory usage. That, and ISTR that Python does some form of caching of imports, which might complicate this (though i can't recall if it's by computed path to the import, or by the requested module name). |
I completely agree with those:
This way we would ensure that we are using what we are shipping.
It should be done in the beginning, but sadly it couldn't be 😞 I kinda hope we won't merge go.d.plugin into netdata/netdata repository as this would pave a path to move python module to separate repo where we could maintain library dependencies with pip. |
As mentioned above, it still runs the risk of breaking other libraries we depend on that we don't vendor (and shouldn't, if we vendored everything we'd be spending more time keeping things up to date and punting bugs upstream that we'd get no new development done) . At minimum, we would need to namespace our usage of urllib3 and reset the import paths before we load the modules. |
try:
import nurllib3 as urllib3
except ImportError:
import urllib3
|
please give an example |
Same exact type of thing happening here, just for a third-party library instead of us. If any of the third-party libraries a module depends on depend on a newer version of urllib3 than what we're shipping, changing our |
@Ferroin what do you propose? |
I think the rename approach is fine, but we should only be searching in our module directory for our own imports when stuff is vendored. This issue pretty much demonstrates that we want to explicitly avoid using the system libraries, so it looks like we should be using a custom |
No. Look at debian/ubuntu netdata package. They don't include our |
Rename or move vendored stuff to a separate package will do try:
from our import urllib3
except ImportError:
...
or
try:
import nurllib3 as urllib3
except ImportError:
... |
I like the first approach a bit better, but we still need to make sure we're not polluting things for third-party libraries our modules are using. I'd propose instead: try:
from netdata import urllib3 as nd_urllib3
except ImportError:
... Using |
not needed if
Actually using system package is OK. The OP problem that we don't check version. |
Hello.
I had apache plugin installed and working correctly but after an update it does not work. When I debug the plugin I get:
python.d ERROR: apache: apache: Url: http://localhost/server-status?auto. Error: 'module' object has no attribute 'Retry'
That url is working if I try it manually. I used kickstart.sh for installation and it runs on amazon ec2.
The text was updated successfully, but these errors were encountered: