Discussion:
zenjobs behaving weird in 4.2 under Ubuntu 12.
Tom Uijldert
2013-02-21 15:06:57 UTC
Permalink
Tom Uijldert [http://community.zenoss.org/people/tuijldert] created the discussion

"zenjobs behaving weird in 4.2 under Ubuntu 12."

To view the discussion, visit: http://community.zenoss.org/message/71636#71636

--------------------------------------------------------------
Hi,

The following problem is driving me up the wall, any hints highly appreciated.

+System+: Ubuntu 12.04
+Package+: Zenoss 4.2

When starting a zenoss job like "Add a single device...", I consistently get the dump shown below.

At first I thought that it just chooses the wrong Python environment but that doesn't seem to be the case.
I uncommented the print "searching",stdpath,sys.path statement in site.py so their values are included in the error.
Looks Ok to me...

So, what am I doing wrong here?

TIA,
    Tom.

2013-02-21 15:24:35,734 INFO zen.Job: Job 5166d5f2-23f1-41c8-9ede-c0d8591a80fc (Products.ZenModel.ZDeviceLoader.DeviceCreationJob) received
2013-02-21 15:24:35,752 INFO zen.Job: Beginning job Add Device Products.ZenModel.ZDeviceLoader.DeviceCreationJob
2013-02-21 15:24:36,381 INFO zen.Job: Running Job Add Device Products.ZenModel.ZDeviceLoader.DeviceCreationJob
2013-02-21 15:24:36,382 INFO zen.Job: Spawning subprocess: /usr/local/zenoss/bin/zendisc run --now -d dublin.massxess.net --monitor localhost --deviceclass / --prod_state 1000 --job 5166d5f2-23f1-41c8-9ede-c0d8591a80fc
searching ['/usr/lib/python27.zip', '/usr/lib/python2.7/', '/usr/lib/python2.7/plat-linux3', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload'] ['/usr/local/zenoss/lib/python', '/usr/lib/python27.zip', '/usr/lib/python2.7/', '/usr/lib/python2.7/plat-linux3', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload']
Traceback (most recent call last):
File "/usr/local/zenoss/lib/python/site.py", line 73, in 
__boot()
File "/usr/local/zenoss/lib/python/site.py", line 33, in __boot
imp.load_module('site',stream,path,descr)
File "/usr/lib/python2.7/site.py", line 562, in 
main()
File "/usr/lib/python2.7/site.py", line 544, in main
known_paths = addusersitepackages(known_paths)
File "/usr/lib/python2.7/site.py", line 271, in addusersitepackages
user_site = getusersitepackages()
File "/usr/lib/python2.7/site.py", line 246, in getusersitepackages
user_base = getuserbase() # this will also set USER_BASE
File "/usr/lib/python2.7/site.py", line 236, in getuserbase
USER_BASE = get_config_var('userbase')
File "/usr/lib/python2.7/sysconfig.py", line 577, in get_config_var
return get_config_vars().get(name)
File "/usr/lib/python2.7/sysconfig.py", line 476, in get_config_vars
_init_posix(_CONFIG_VARS)
File "/usr/lib/python2.7/sysconfig.py", line 337, in _init_posix
makefile = _get_makefile_filename()
File "/usr/lib/python2.7/sysconfig.py", line 331, in _get_makefile_filename
return os.path.join(get_path('platstdlib').replace("/usr/local","/usr",1), "config" + (sys.pydebug and "_d" or ""), "Makefile")
AttributeError: 'module' object has no attribute 'pydebug'
2013-02-21 15:24:36,601 ERROR zen.Job: Job 5166d5f2-23f1-41c8-9ede-c0d8591a80fc raised exception
2013-02-21 15:24:36,602 ERROR zen.Job: 
Traceback (most recent call last):
File "/usr/local/zenoss/Products/Jobber/zenjobs.py", line 23, in 
from celery.concurrency.processes.forking import freeze_support
ImportError: No module named forking
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/71636#71636]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
todor_k
2014-01-02 19:32:31 UTC
Permalink
todor_k [http://community.zenoss.org/people/todor_k] created the discussion

"Re: zenjobs behaving weird in 4.2 under Ubuntu 12."

To view the discussion, visit: http://community.zenoss.org/message/75575#75575

--------------------------------------------------------------
Hi,

I had similar issue for zenoss-4.2.4 installed on Ubuntu-13.10 via http://hydruid-blog.com/?p=343 http://hydruid-blog.com/?p=343 procedure.
After small digging if was found that when starting "/etc/init./zenoss start" the script does not call the correct python executable namely /usr/local/zenoss/bin/python but /usr/bin/python which is the standard python for Ubuntu-13.10.
When putting in the path the zenoss python executable this issue disappeared.


#!/usr/bin/env bash
#
# zenoss        This shell script takes care of starting and stopping zenmon.
#
# chkconfig: 2345 80 30
# description: Zenoss is a monitoring program written by Zenoss, Inc.
#
##############################################################################
#
# Copyright (C) Zenoss, Inc. 2007, all rights reserved.
#
# This content is made available according to terms specified in
# License.zenoss under the directory where your Zenoss product is installed.
#
#Custom Ubuntu Variables
export ZENHOME=/usr/local/zenoss
export RRDCACHED=/usr/local/zenoss/bin/rrdcached
*export PATH="/usr/local/zenoss/bin:$PATH"*
#
##############################################################################


set_deamon_list() {
    WEBSERVERCTL=$(${ZENHOME}/bin/zenglobalconf -p webserverctl)
.................................
.................................
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/75575#75575]

Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
hydruid
2014-01-02 19:45:43 UTC
Permalink
hydruid [http://community.zenoss.org/people/hydruid] created the discussion

"Re: zenjobs behaving weird in 4.2 under Ubuntu 12."

To view the discussion, visit: http://community.zenoss.org/message/75625#75625

--------------------------------------------------------------
Hmmm did that fix it?
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/75625#75625]

Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
todor_k
2014-01-02 21:32:45 UTC
Permalink
todor_k [http://community.zenoss.org/people/todor_k] created the discussion

"Re: zenjobs behaving weird in 4.2 under Ubuntu 12."

To view the discussion, visit: http://community.zenoss.org/message/75576#75576

--------------------------------------------------------------
In my case yes.

Take a look on the logs

2014-01-02 18:48:51,320 INFO celery.worker.consumer: Got task from broker: Products.Jobber.jobs.SubprocessJob[f043232e-2ca5-4e99-b8c8-bb8ecf97af84]
2014-01-02 18:48:57,399 INFO zen.Job: Job f043232e-2ca5-4e99-b8c8-bb8ecf97af84 (Products.Jobber.jobs.SubprocessJob) received
2014-01-02 18:48:57,464 INFO zen.Job: Beginning job Shell Command Products.Jobber.jobs.SubprocessJob
2014-01-02 18:48:57,465 INFO zen.Job: Running Job Shell Command Products.Jobber.jobs.SubprocessJob
2014-01-02 18:48:57,469 INFO zen.Job: Spawning subprocess: /usr/local/zenoss/bin/zendisc run --net 195.230.8.64/29
2014-01-02 18:48:57,614 INFO zen.Job: Traceback (most recent call last):
2014-01-02 18:48:57,615 INFO zen.Job: File "/usr/local/zenoss/lib/python/site.py", line 78, in <module>
2014-01-02 18:48:57,615 INFO zen.Job: __boot()
2014-01-02 18:48:57,616 INFO zen.Job: File "/usr/local/zenoss/lib/python/site.py", line 38, in __boot
2014-01-02 18:48:57,616 INFO zen.Job: imp.load_module('site',stream,path,descr)
2014-01-02 18:48:57,617 INFO zen.Job: File "/usr/lib/python2.7/site.py", line 563, in <module>
2014-01-02 18:48:57,617 INFO zen.Job: main()
2014-01-02 18:48:57,618 INFO zen.Job: File "/usr/lib/python2.7/site.py", line 545, in main
2014-01-02 18:48:57,618 INFO zen.Job: known_paths = addusersitepackages(known_paths)
2014-01-02 18:48:57,619 INFO zen.Job: File "/usr/lib/python2.7/site.py", line 272, in addusersitepackages
2014-01-02 18:48:57,619 INFO zen.Job: user_site = getusersitepackages()
2014-01-02 18:48:57,620 INFO zen.Job: File "/usr/lib/python2.7/site.py", line 247, in getusersitepackages
2014-01-02 18:48:57,620 INFO zen.Job: user_base = getuserbase() # this will also set USER_BASE
2014-01-02 18:48:57,621 INFO zen.Job: File "/usr/lib/python2.7/site.py", line 237, in getuserbase
2014-01-02 18:48:57,621 INFO zen.Job: USER_BASE = get_config_var('userbase')
2014-01-02 18:48:57,621 INFO zen.Job: File "/usr/lib/python2.7/sysconfig.py", line 578, in get_config_var
2014-01-02 18:48:57,622 INFO zen.Job: return get_config_vars().get(name)
2014-01-02 18:48:57,622 INFO zen.Job: File "/usr/lib/python2.7/sysconfig.py", line 505, in get_config_vars
2014-01-02 18:48:57,622 INFO zen.Job: import re
2014-01-02 18:48:57,622 INFO zen.Job: File "/usr/lib/python2.7/re.py", line 105, in <module>
2014-01-02 18:48:57,623 INFO zen.Job: import sre_compile
2014-01-02 18:48:57,623 INFO zen.Job: File "/usr/lib/python2.7/sre_compile.py", line 14, in <module>
2014-01-02 18:48:57,623 INFO zen.Job: import sre_parse
2014-01-02 18:48:57,623 INFO zen.Job: File "/usr/lib/python2.7/sre_parse.py", line 17, in <module>
2014-01-02 18:48:57,624 INFO zen.Job: from sre_constants import *
2014-01-02 18:48:57,624 INFO zen.Job: File "/usr/lib/python2.7/sre_constants.py", line 18, in <module>
2014-01-02 18:48:57,624 INFO zen.Job: from _sre import MAXREPEAT
2014-01-02 18:48:57,624 INFO zen.Job: ImportError: cannot import name MAXREPEAT
2014-01-02 18:48:57,728 ERROR zen.Job: Job f043232e-2ca5-4e99-b8c8-bb8ecf97af84 raised exception
2014-01-02 18:48:57,729 ERROR zen.Job: <traceback object at 0x6800128>
2014-01-02 18:48:57,809 ERROR celery.worker.job: Task Products.Jobber.jobs.SubprocessJob[f043232e-2ca5-4e99-b8c8-bb8ecf97af84] raised exception: UnpickleableExceptionWrapper('Products.Jobber.exceptions', 'SubprocessJobFailed', (), 'SubprocessJobFailed()')
Traceback (most recent call last):
  File "/usr/local/zenoss/lib/python/celery/task/trace.py", line 186, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/usr/local/zenoss/Products/Jobber/jobs.py", line 185, in _do_run
    result = _runjob()
  File "/usr/local/zenoss/lib/python/ZODB/transact.py", line 44, in g
    r = f(*args, **kwargs)
  File "/usr/local/zenoss/Products/Jobber/jobs.py", line 175, in _runjob
    result = self._run(*args, **kwargs)
  File "/usr/local/zenoss/Products/Jobber/jobs.py", line 379, in _run
    raise SubprocessJobFailed(exitcode)
SubprocessJobFailed: SubprocessJobFailed()

if print "searching",stdpath,sys.path is uncommented the wrong paths are seen.
Including /usr/local/zenoss/bin in the PATH variable results in starting the correct python in my case.
But may be there is a better way to do it.

Regards,
Todor
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/75576#75576]

Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
Loading...