mhn-celery-worker not running

125 views
Skip to first unread message

Scott Keoseyan

unread,
Jul 15, 2016, 12:42:26 AM7/15/16
to Modern Honey Network
Hi,

Did some cleanup on my mongodb and afterwards noted that after a restart my mhn-celery-worker is failing to start with the following error:

root@host:/etc/supervisor/conf.d# /opt/mhn/env/bin/celery worker -A mhn.tasks --loglevel=DEBUG
Traceback (most recent call last):
File "/opt/mhn/env/bin/celery", line 11, in <module>
sys.exit(main())
File "/opt/mhn/env/local/lib/python2.7/site-packages/celery/__main__.py", line 30, in main
main()
File "/opt/mhn/env/local/lib/python2.7/site-packages/celery/bin/celery.py", line 81, in main
cmd.execute_from_commandline(argv)
File "/opt/mhn/env/local/lib/python2.7/site-packages/celery/bin/celery.py", line 769, in execute_from_commandline
super(CeleryCommand, self).execute_from_commandline(argv)))
File "/opt/mhn/env/local/lib/python2.7/site-packages/celery/bin/base.py", line 305, in execute_from_commandline
argv = self.setup_app_from_commandline(argv)
File "/opt/mhn/env/local/lib/python2.7/site-packages/celery/bin/base.py", line 465, in setup_app_from_commandline
self.app = self.find_app(app)
File "/opt/mhn/env/local/lib/python2.7/site-packages/celery/bin/base.py", line 485, in find_app
return find_app(app, symbol_by_name=self.symbol_by_name)
File "/opt/mhn/env/local/lib/python2.7/site-packages/celery/app/utils.py", line 229, in find_app
sym = symbol_by_name(app, imp=imp)
File "/opt/mhn/env/local/lib/python2.7/site-packages/celery/bin/base.py", line 488, in symbol_by_name
return symbol_by_name(name, imp=imp)
File "/opt/mhn/env/local/lib/python2.7/site-packages/kombu/utils/__init__.py", line 92, in symbol_by_name
module = imp(module_name, package=package, **kwargs)
File "/opt/mhn/env/local/lib/python2.7/site-packages/celery/utils/imports.py", line 101, in import_from_cwd
return imp(module, package=package)
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
ImportError: No module named mhn

It appears that it cannot find the python module mhn. Sure enough when I launch python and try to import mhn, I get the following:

root@host:/etc/supervisor/conf.d# python
Python 2.7.6 (default, Jun 22 2015, 17:58:13)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import mhn
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named mhn
>>>

This system has been up and running for months just fine - I never saw this issue before. Is there a quick fix? Upgrade?

thanks,

—Scott


Jason Trost

unread,
Jul 15, 2016, 8:52:35 AM7/15/16
to Scott Keoseyan, Modern Honey Network
Can you try this?

cd /opt/mhn/server/
/opt/mhn/env/bin/celery worker -A mhn.tasks --loglevel=INFO

Still error out?



--
You received this message because you are subscribed to the Google Groups "Modern Honey Network" group.
To unsubscribe from this group and stop receiving emails from it, send an email to modern-honey-net...@googlegroups.com.
To post to this group, send email to modern-hon...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/modern-honey-network/429521C5-906E-4BA1-8F57-C22CCA0327A2%40gmail.com.
For more options, visit https://groups.google.com/d/optout.



--
Jason Trost | VP of Threat Research | www.anomali.com 
2317 Broadway, 3rd Floor| Redwood City, CA 94063
Phone:  386.235.0078 | Twitter:  @jason_trost 

Scott Keoseyan

unread,
Jul 15, 2016, 3:36:07 PM7/15/16
to Jason Trost, Modern Honey Network
It did not…

root@host:/opt/mhn/server# /opt/mhn/env/bin/celery worker -A mhn.tasks --loglevel=INFO
Running a worker with superuser privileges when the
worker accepts messages serialized with pickle is a very bad idea!

If you really want to continue then you have to set the C_FORCE_ROOT
environment variable (but please think about this before you do).

User information: uid=0 euid=0 gid=0 egid=0

Obviously in the supervisor config file the job runs as www-user (stock per MHN build) but I don’t actually have a user in passwd named www-data.  Could this be the problem?

Jason Trost

unread,
Jul 15, 2016, 4:18:23 PM7/15/16
to Scott Keoseyan, Modern Honey Network
Yes this could be the problem.  Did you perform a major upgrade to MHN?  I believe this has been like this for a while now.
Reply all
Reply to author
Forward
0 new messages