question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

cannot load service without specifying cf.libdir

See original GitHub issue

On FreeBSD, I’m running with this patch:

--- mqttwarn/core.py.orig       2020-08-07 20:15:24 UTC
+++ mqttwarn/core.py
@@ -531,7 +531,7 @@ def load_services(services):
         modulefile = resource_filename('mqttwarn.services', module + '.py')
 
         try:
-            service_plugins[service]['module'] = load_module(modulefile)
+            service_plugins[service]['module'] = load_module(cf.libdir + '/' + modulefile)
             logger.info('Successfully loaded service "{}"'.format(service))
         except Exception as ex:
             logger.exception('Unable to load service "{}" from file "{}": {}'.format(service, modulefile, ex))

FYI, on FreeBSD, core.py gets installed to:

$ pkg info -l py37-mqttwarn | grep core.py
	/usr/local/lib/python3.7/site-packages/mqttwarn/core.py

and the libraries to:

[dan@mqtt01:/usr/local/etc/mqttwarn] $ pkg info -l py37-mqttwarn | grep pushover
	/usr/local/lib/python3.7/site-packages/mqttwarn/services/__pycache__/pushover.cpython-37.opt-1.pyc
	/usr/local/lib/python3.7/site-packages/mqttwarn/services/__pycache__/pushover.cpython-37.pyc
	/usr/local/lib/python3.7/site-packages/mqttwarn/services/pushover.py

Does this make sense?

What is self.libdir you might ask?

--- mqttwarn/configuration.py.orig      2020-08-07 20:14:30 UTC
+++ mqttwarn/configuration.py
@@ -45,6 +45,7 @@ class Config(RawConfigParser):
         self.skipretained = False
         self.cleansession = False
         self.protocol     = 3
+        self.libdir       = ''
 
         self.logformat    = '%(asctime)-15s %(levelname)-8s [%(name)-25s] %(message)s'
         self.logfile      = None

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
dlangillecommented, Aug 8, 2020

On an unrelated note, because of the versions now in the FreeBSD ports tree, I’m running with this patch:

--- setup.py.orig       2020-08-08 00:11:28 UTC
+++ setup.py
@@ -7,14 +7,14 @@ here = os.path.abspath(os.path.dirname(__file__))
 README = open(os.path.join(here, 'README.rst')).read()

 requires = [
-    'six==1.13.0',
-    'paho-mqtt==1.5.0',
-    'jinja2==2.10.3',
+    'six>=1.13.0',
+    'paho-mqtt>=1.4.0',
+    'jinja2>=2.10.1',
     'attrs==19.3.0',
     'docopt==0.6.2',
     'requests==2.22.0',
     'future==0.18.2',
-    'configparser==4.0.2',
+    'configparser>=3.5.3',
 ]
 
 extras = {

0reactions
dlangillecommented, Aug 9, 2020

The original issue is not an issue any more. I can’t recall the origins now. The patch originated months ago and the cause is now lost.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Upgrading PostgreSQL with broken PostGIS installation ...
The problem is apparently that the PostGIS releases are specific to a PostgreSQL database release as discussed here.
Read more >
FAQ: Building Open MPI
If --with-<FOO> is specified with no optional directory, Open MPI's configure script will abort if it cannot find support for the FOO ...
Read more >
Error: Cannot install in Homebrew on ARM processor in Intel ...
After this command : /usr/sbin/softwareupdate --install-rosetta --agree-to-license I get Installing Rosetta 2 on this system is not supported. – ...
Read more >
Fedora Packaging Guidelines
Installing an application that depends on a library or service should not ... on a secondary architecture (such as an architecture-specific boot utility, ......
Read more >
PHP Buildpack Configuration | Cloud Foundry Docs
The web server to use, such as HTTPD, Nginx, or no server. The PHP extensions that are enabled. The buildpack overrides the default ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found