MeetMe / newrelic-plugin-agent

Multi-Plugin python-based Agent for NewRelic's Platform
BSD 3-Clause "New" or "Revised" License
425 stars 265 forks source link

AttributeError: 'module' object has no attribute 'Controller' #564

Open niralatuladhar opened 3 years ago

niralatuladhar commented 3 years ago

Getting this error while starting the newrelic-plugin-agent. What could you possible reason?

newrelic-plugin-agent -c /etc/newrelic/newrelic-plugin-agent.cfg -f
Traceback (most recent call last):
  File "/usr/bin/newrelic-plugin-agent", line 9, in <module>
    load_entry_point('newrelic-plugin-agent==1.3.0', 'console_scripts', 'newrelic-plugin-agent')()
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 378, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2566, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2260, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/usr/lib/python2.7/site-packages/newrelic_plugin_agent/agent.py", line 23, in <module>
    class NewRelicPluginAgent(helper.Controller):
AttributeError: 'module' object has no attribute 'Controller'
t49tran commented 3 years ago

It's because of the recent release of helper on 2nd February. I have made a PR and hopefully the library owner will merge it.

Otherwise the solution is to fork this repo and lock the helper package version in setup.py.

lnapolillo commented 3 years ago

Another workaround I've found was to reinstall and tell pip which version of helper to download with the -c option: pip install -c constraints.txt newrelic-plugin-agent

Where constraints.txt is a file that contains this line:

helper==2.4.2