shinken-solutions / shinken

Flexible and scalable monitoring framework
http://www.shinken-monitoring.org
GNU Affero General Public License v3.0
1.13k stars 336 forks source link

error after upgrade from v2.0.3 #1497

Closed Finkregh closed 9 years ago

Finkregh commented 9 years ago

i did upgrade from v2.0.3 via pip.

When i try to start shinken i get the following error in /tmp/bad_start_for_arbiter:

[1423224572] DEBUG: [Shinken] Opening local log file
[1423224572] INFO: [Shinken] And arbiter is launched with the hostname:monitoring from an arbiter point of view of addr:monitoring.x.y
[1423224572] INFO: [Shinken] I am the master Arbiter: arbiter-master
[1423224572] INFO: [Shinken] My own modules:
[1423224572] INFO: [Shinken] Modules directory: /var/lib/shinken/modules
[1423224572] INFO: [Shinken] Modules directory: /var/lib/shinken/modules
[1423224572] WARNING: [Shinken] Cannot load status_dat_broker as a package (No module named module), trying as module..
[1423224572] WARNING: [Shinken] Cannot import livestatus as a package (cannot import name MODATTR_NONE) ; trying as bare module..
[1423224572] WARNING: [Shinken] Cannot load logstore-sqlite as a package (cannot import name MODATTR_NONE), trying as module..
[1423224572] WARNING: [Shinken] Cannot load livestatus as a package (cannot import name MODATTR_NONE), trying as module..
[1423224572] WARNING: [Shinken] Cannot import livestatus as a package (cannot import name MODATTR_NONE) ; trying as bare module..
[1423224572] WARNING: [Shinken] Cannot load logstore-mongodb as a package (cannot import name MODATTR_NONE), trying as module..
[1423224572] WARNING: [Shinken] Cannot load couchdb_broker as a package (No module named module), trying as module..
[1423224572] WARNING: [Shinken] Cannot load service_perfdata_broker as a package (No module named module), trying as module..
[1423224572] WARNING: [Shinken] Cannot load ip_tag_arbiter as a package (No module named module), trying as module..
[1423224572] WARNING: [Shinken] Cannot load glpidb_broker as a package (No module named module), trying as module..
[1423224572] WARNING: [Shinken] Cannot load ndodb_oracle_broker as a package (No module named module), trying as module..
[1423224572] WARNING: [Shinken] Cannot load webui_broker as a package (No module named module), trying as module..
[1423224572] WARNING: [Shinken] Cannot load host_perfdata_broker as a package (No module named module), trying as module..
[1423224572] WARNING: [Shinken] Cannot load livestatus_broker as a package (cannot import name MODATTR_NONE), trying as module..
[1423224572] WARNING: [Shinken] Cannot load tsca as a package (No module named module), trying as module..
[1423224572] WARNING: [Shinken] Cannot load merlindb_broker as a package (No module named module), trying as module..
[1423224572] WARNING: [Shinken] Cannot load glances_ui as a package (No module named module), trying as module..
[1423224572] WARNING: [Shinken] Cannot load ndodb_mysql_broker as a package (No module named module), trying as module..
[1423224572] INFO: [Shinken] I correctly loaded the modules: []
[1423224572] CRITICAL: [Shinken] I got an unrecoverable error. I have to exit.
[1423224572] CRITICAL: [Shinken] You can get help at https://github.com/naparuba/shinken
[1423224572] CRITICAL: [Shinken] If you think this is a bug, create a new ticket including details mentioned in the README
[1423224572] CRITICAL: [Shinken] Back trace of the error: Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/shinken/daemons/arbiterdaemon.py", line 594, in main
    self.load_config_file()
  File "/usr/local/lib/python2.7/dist-packages/shinken/daemons/arbiterdaemon.py", line 365, in load_config_file
    self.conf.create_objects(raw_objects)
  File "/usr/local/lib/python2.7/dist-packages/shinken/objects/config.py", line 717, in create_objects
    self.create_objects_for_type(raw_objects, t)
  File "/usr/local/lib/python2.7/dist-packages/shinken/objects/config.py", line 741, in create_objects_for_type
    setattr(self, prop, clss(lst, initial_index))
  File "/usr/local/lib/python2.7/dist-packages/shinken/objects/item.py", line 721, in __init__
    self.add_items(items, index_items)
  File "/usr/local/lib/python2.7/dist-packages/shinken/objects/item.py", line 743, in add_items
    self.add_item(i, index_items)
  File "/usr/local/lib/python2.7/dist-packages/shinken/objects/item.py", line 855, in add_item
    item = self.index_item(item)
  File "/usr/local/lib/python2.7/dist-packages/shinken/objects/item.py", line 880, in index_item
    item = self.manage_conflict(item, name)
  File "/usr/local/lib/python2.7/dist-packages/shinken/objects/item.py", line 788, in manage_conflict
    item.configuration_warnings.append(mesg)
AttributeError: 'Discoveryrule' object has no attribute 'configuration_warnings'
halbertos commented 9 years ago

Same error for me using version 2.0.3.

[1424885385] INFO: [Shinken] I correctly loaded the modules: [] [1424885385] CRITICAL: [Shinken] I got an unrecoverable error. I have to exit. [1424885385] CRITICAL: [Shinken] You can get help at https://github.com/naparuba/shinken [1424885385] CRITICAL: [Shinken] If you think this is a bug, create a new ticket including details mentioned in the README [1424885385] CRITICAL: [Shinken] Back trace of the error: Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/shinken/daemons/arbiterdaemon.py", line 594, in main self.load_config_file() File "/usr/local/lib/python2.7/dist-packages/shinken/daemons/arbiterdaemon.py", line 365, in load_config_file self.conf.create_objects(raw_objects) File "/usr/local/lib/python2.7/dist-packages/shinken/objects/config.py", line 717, in create_objects self.create_objects_for_type(raw_objects, t) File "/usr/local/lib/python2.7/dist-packages/shinken/objects/config.py", line 741, in create_objects_for_type setattr(self, prop, clss(lst, initial_index)) File "/usr/local/lib/python2.7/dist-packages/shinken/objects/item.py", line 721, in init self.add_items(items, index_items) File "/usr/local/lib/python2.7/dist-packages/shinken/objects/item.py", line 743, in add_items self.add_item(i, index_items) File "/usr/local/lib/python2.7/dist-packages/shinken/objects/item.py", line 855, in add_item item = self.index_item(item) File "/usr/local/lib/python2.7/dist-packages/shinken/objects/item.py", line 880, in index_item item = self.manage_conflict(item, name) File "/usr/local/lib/python2.7/dist-packages/shinken/objects/item.py", line 788, in manage_conflict item.configuration_warnings.append(mesg) AttributeError: 'Discoveryrule' object has no attribute 'configuration_warnings'

Traceback (most recent call last): File "/usr/bin/shinken-arbiter", line 116, in daemon.main() File "/usr/local/lib/python2.7/dist-packages/shinken/daemons/arbiterdaemon.py", line 594, in main self.load_config_file() File "/usr/local/lib/python2.7/dist-packages/shinken/daemons/arbiterdaemon.py", line 365, in load_config_file self.conf.create_objects(raw_objects) File "/usr/local/lib/python2.7/dist-packages/shinken/objects/config.py", line 717, in create_objects self.create_objects_for_type(raw_objects, t) File "/usr/local/lib/python2.7/dist-packages/shinken/objects/config.py", line 741, in create_objects_for_type setattr(self, prop, clss(lst, initial_index)) File "/usr/local/lib/python2.7/dist-packages/shinken/objects/item.py", line 721, in init self.add_items(items, index_items) File "/usr/local/lib/python2.7/dist-packages/shinken/objects/item.py", line 743, in add_items self.add_item(i, index_items) File "/usr/local/lib/python2.7/dist-packages/shinken/objects/item.py", line 855, in add_item item = self.index_item(item) File "/usr/local/lib/python2.7/dist-packages/shinken/objects/item.py", line 880, in index_item item = self.manage_conflict(item, name) File "/usr/local/lib/python2.7/dist-packages/shinken/objects/item.py", line 788, in manage_conflict item.configuration_warnings.append(mesg) AttributeError: 'Discoveryrule' object has no attribute 'configuration_warnings'

Seb-Solon commented 9 years ago

Please upgrade your shinken version. I' pretty sure it's fixed in 2.2 and if not we will have to try upstream.

Thanks!

Finkregh commented 9 years ago

i did try to upgrade to v2.2 ;)

halbertos commented 9 years ago

Upgraded to Shinken v.2.2 and same error. Removed all configuration files (Hosts, Services, Hostgroups), shinken services starts as expected.

When added a host file wirtten as part of previous version discovery process, seems to fails system... Any idea?.

Seb-Solon commented 9 years ago

I cannot reproduce this in the upstream version. I tried to setup packs including discovery rules but without success. If you can provide some conf to reproduce that would be great

titilambert commented 9 years ago

Hello ! This bug should be fixed with shinken 2.4-BETA1. So, I close this issue. Fell free to reopen it, if you still have this error ;)

Finkregh commented 9 years ago

i'd like to upgrade to 2.4-BETA1, but i get the following error:

# pip install --upgrade -e git+https://github.com/naparuba/shinken.git@2.4-BETA1#egg=shinken
Obtaining shinken from git+https://github.com/naparuba/shinken.git@2.4-BETA1#egg=shinken
  Cloning https://github.com/naparuba/shinken.git (to 2.4-BETA1) to ./src/shinken
  Running setup.py egg_info for package shinken

    Installed /root/src/shinken/pbr-0.10.8-py2.7.egg
    [pbr] Processing SOURCES.txt
    warning: LocalManifestMaker: standard file '-c' not found

    [pbr] In git context, generating filelist from git
    warning: no files found matching 'AUTHORS'
    warning: no files found matching 'ChangeLog'
    warning: no previously-included files found matching '.gitreview'
    warning: no previously-included files matching '*.pyc' found anywhere in distribution
    warning: no files found matching '.bat' under directory 'windows'
    warning: no files found matching '.reg' under directory 'windows'
    warning: no files found matching 'test'
    warning: no previously-included files matching '.git' found anywhere in distribution
    warning: no previously-included files matching '*.pyc' found anywhere in distribution
    warning: no previously-included files matching '*.pyo' found anywhere in distribution
    warning: no previously-included files matching '.debug' found anywhere in distribution
    warning: no previously-included files matching '.pid' found anywhere in distribution
    warning: no previously-included files matching '.exe' found anywhere in distribution
    warning: no previously-included files matching '*~' found anywhere in distribution
    warning: no files found matching 'var/void_for_git'
Downloading/unpacking CherryPy (from shinken)
  Downloading CherryPy-3.6.0.tar.gz (432Kb): 432Kb downloaded
  Running setup.py egg_info for package CherryPy

Downloading/unpacking pycurl from https://pypi.python.org/packages/source/p/pycurl/pycurl-7.19.5.1.tar.gz#md5=f44cd54256d7a643ab7b16e3f409b26b (from shinken)
  Downloading pycurl-7.19.5.1.tar.gz (142Kb): 142Kb downloaded
  Running setup.py egg_info for package pycurl
    Traceback (most recent call last):
      File "<string>", line 14, in <module>
      File "/root/build/pycurl/setup.py", line 634, in <module>
        ext = get_extension(split_extension_source=split_extension_source)
      File "/root/build/pycurl/setup.py", line 392, in get_extension
        ext_config = ExtensionConfiguration()
      File "/root/build/pycurl/setup.py", line 65, in __init__
        self.configure()
      File "/root/build/pycurl/setup.py", line 100, in configure_unix
        raise ConfigurationError(msg)
    __main__.ConfigurationError: Could not run curl-config: [Errno 2] No such file or directory
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 14, in <module>

  File "/root/build/pycurl/setup.py", line 634, in <module>

    ext = get_extension(split_extension_source=split_extension_source)

  File "/root/build/pycurl/setup.py", line 392, in get_extension

    ext_config = ExtensionConfiguration()

  File "/root/build/pycurl/setup.py", line 65, in __init__

    self.configure()

  File "/root/build/pycurl/setup.py", line 100, in configure_unix

    raise ConfigurationError(msg)

__main__.ConfigurationError: Could not run curl-config: [Errno 2] No such file or directory

pycurl is already installed (v7.19.0-5)

Finkregh commented 9 years ago

upgrading via setup.py does also not work:

# git checkout 2.4-BETA1 -b 2.4-BETA1-local
Switched to a new branch '2.4-BETA1-local'

# python setup.py update
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: setup.py --help [cmd1 cmd2 ...]
   or: setup.py --help-commands
   or: setup.py cmd --help

error: invalid command 'update'
titilambert commented 9 years ago

Hello ! Do you use a virtualenv ?

Finkregh commented 9 years ago

nope, directly on the system :)

titilambert commented 9 years ago

Oki, this is strange ... pip doesn't see you pycurl on your system ...

titilambert commented 9 years ago

Are you installing shinken with pip with the root user ?

titilambert commented 9 years ago

and could you try : pip freeze |grep -i pycurl

titilambert commented 9 years ago

Also, to upgrade, you can try: git checkout 2.4-BETA1 -b 2.4-BETA1-local cd 2.4-BETA1-local python setup.py install

Finkregh commented 9 years ago
# pip freeze |grep -i pycurl
pycurl==7.19.0

the last one did work, but installed itself into /usr/local instead of / :( Should i switch the install-root to / via --install-base? I thought, that this would be the new default?

Finkregh commented 9 years ago

after upgrading and not minding any config changes i got this starting shinken (installed via --prefix '/'):

FAILED: did not find reactionner file (/bin/shinken-reactionner) ; are you sure shinken-reactionner is installed? ... [ FAILED ] ... [ FAILED ]
# whereis shinken-reactionner
shinken-reactionner: /usr/bin/shinken-reactionner /usr/bin/X11/shinken-reactionner
# whereis shinken-reactioner
shinken-reactioner: /bin/shinken-reactioner /usr/local/bin/shinken-reactioner

is it possible that there is a bug in the install-script?

./shinken.egg-info/entry_points.txt:shinken-reactioner = shinken.bin.shinken_reactioner:main
./setup.cfg:    shinken-reactioner = shinken.bin.shinken_reactioner:main
Finkregh commented 9 years ago

after fixing the setup.cfg and the import in /bin/shinken-reactionner i got the following:

[] ERROR: [Shinken] Could not import bare 'module.py' from /var/lib/shinken/modules/livestatus_broker : No module named module
[] ERROR: [Shinken] [item::broker-master] Error: the module tondodb-mysql is unknown for broker-master

Is that module gone?

Seb-Solon commented 9 years ago

I fixed the setup.cfg one. Thanks.

How did you setup you module? There are two things here : the livestatus and the tondodb-mysql. It seems like the ndodb-mysql is not installed. How did you setup your modules?

Finkregh commented 9 years ago

aehm, i do not know anymore :fearful: i suppose i did use shinken install xxx; am i missing a logstore-mysql?

Seb-Solon commented 9 years ago

there is no such module. The 2.4B version of shinken is working with the upstream version of livestatus, not sur it is working with the shinken.io one.

Finkregh commented 9 years ago

so what is the suggested path? i could just remove the mysql-logger for the moment, as i dont know if some other thing actually uses the data ;)

Seb-Solon commented 9 years ago

What is you issue there? Is the livestatus working or not? You can check if the 50000 port is listening. For the mysql, I don'tknow what you are expecting from it but it's an old module used for centreon integration. It has nothing to deal with logs.

Finkregh commented 9 years ago

Ah, okay. Livestatus has no issue at the moment... :hushed:

How/Where to am i supposed to install shinken? I'd like to install it fitting to my config from 2.0.3:

#/etc/default/shinken

ETC=/etc/shinken
VAR=/var/lib/shinken/
BIN=/usr/bin
RUN=/var/run/shinken
LOG=/var/log/shinken
Seb-Solon commented 9 years ago

Should be fine now I guess. reopen anoth ticket if necessary