Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception when changing to process_checks #42

Closed
pkkid opened this issue Jan 7, 2012 · 12 comments
Closed

Exception when changing to process_checks #42

pkkid opened this issue Jan 7, 2012 · 12 comments

Comments

@pkkid
Copy link

pkkid commented Jan 7, 2012

Changing the string "mongo" to "apache" in my amon configuration causes the following stack trace on the Dashboard view:

Error 500 Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/tornado-2.1.1-py2.7.egg/tornado/web.py", line 954, in _execute getattr(self, self.request.method.lower())(_args, *_kwargs) File "/usr/local/lib/python2.7/dist-packages/tornado-2.1.1-py2.7.egg/tornado/web.py", line 1667, in wrapper return method(self, _args, *_kwargs) File "/usr/local/lib/python2.7/dist-packages/amon-0.7.0-py2.7.egg/amon/web/views/app.py", line 46, in get process_check_first=process_check_first, File "/usr/local/lib/python2.7/dist-packages/amon-0.7.0-py2.7.egg/amon/web/views/base.py", line 114, in render rendered_template = jinja_render(template, _args, *_kwargs) File "/usr/local/lib/python2.7/dist-packages/amon-0.7.0-py2.7.egg/amon/web/template.py", line 324, in render return template.render(_args, *_kwargs) File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 894, in render return self.environment.handle_exception(exc_info, True) File "/usr/local/lib/python2.7/dist-packages/amon-0.7.0-py2.7.egg/amon/web/templates/dashboard.html", line 1, in top-level template code {% extends "base.html" %} File "/usr/local/lib/python2.7/dist-packages/amon-0.7.0-py2.7.egg/amon/web/templates/base.html", line 32, in top-level template code {% block content %} File "/usr/local/lib/python2.7/dist-packages/amon-0.7.0-py2.7.egg/amon/web/templates/dashboard.html", line 93, in block "content" File "/usr/local/lib/python2.7/dist-packages/amon-0.7.0-py2.7.egg/amon/web/template.py", line 169, in progress_width value = clean_string(value) File "/usr/local/lib/python2.7/dist-packages/amon-0.7.0-py2.7.egg/amon/web/template.py", line 122, in clean_string extracted_value = value_regex.findall(variable) TypeError: expected string or buffer

@martinrusev
Copy link
Member

Hi @mjs7231

Did you restart amond and amon after changing the string - I am working to remove the restart step, but for now - it has to be restarted after any configuration change.
Also - is the problem persistent or it occurs only in the first minute?

@pkkid
Copy link
Author

pkkid commented Jan 7, 2012

The problem is persistent. I had the server running all night and there is still a stacktrace on the Dashboard page. All other pages appear to work fine. I have been restarting the server on configuration changes. This morning I tried a full stop / start sequence, but the problem is still here.

If I switch process_checks back to only contain "mongo" the problem goes away. Problem is that is not a process I care to monitor. :)

@martinrusev
Copy link
Member

Can you please share your OS environment and if its 64/32 bit

@pkkid
Copy link
Author

pkkid commented Jan 7, 2012

I'm running on Ubuntu 11.04 x64 in Virtualbox on a Win7 host. - Linux vbox-natty 2.6.38-13-generic #53-Ubuntu SMP Mon Nov 28 19:33:45 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux.

@martinrusev
Copy link
Member

Can you please check if the config file is a valid json http://jsonlint.com/
Because if its not Amon tries to provide some reasonable defaults, but the processes are 100% user defined, so it can't do anything about that and just fails :)

@pkkid
Copy link
Author

pkkid commented Jan 7, 2012

I ran it through jslint, and it's valid.

{
    "acl": "False",
    "system_check_period": 60,
    "secret_key": "KQIIHloaREKypDq/cFmRQKAJDwxlokV7v+vPaGhzSAg=",
    "process_checks": [
        "apache"
    ],
    "web_app": {
        "host": "127.0.0.1",
        "port": "2464"
    },
    "backend": {
        "mongo": {
            "host": "127.0.0.1",
            "port": 27017
        }
    }
}

I added the following line just before the exception line:

open('/tmp/foobar.txt', 'w+').write("'%s' (%s)\n" % (variable, type(variable)))

The output of that line is:

'' (<class 'jinja2.runtime.Undefined'>)

@pkkid
Copy link
Author

pkkid commented Jan 7, 2012

You know what. Apache is not running on my dev system. So I thought thta might be it. I switched the process from "apache" to "postgres" in the config posted above. Problem is still there, same output as before as well.

Running "ps aux | grep postgres" on my system yeilds the following output:

postgres   897  0.0  0.1 105452  6724 ?        S    Jan06   0:02 /usr/lib/postgresql/8.4/bin/postgres -D /var/lib/postgresql/8.4/main -c
config_file=/etc/postgresql/8.4/main/postgresql.conf
postgres  1001  0.0  0.0 105452  1668 ?        Ss   Jan06   0:44 postgres: writer process                                                                                                    
postgres  1002  0.0  0.0 105452  1428 ?        Ss   Jan06   0:37 postgres: wal writer process                                                                                                
postgres  1003  0.0  0.0 105760  1968 ?        Ss   Jan06   0:11 postgres: autovacuum launcher process                                                                                       
postgres  1004  0.0  0.0  77140  1636 ?        Ss   Jan06   0:06 postgres: stats collector process                                                                                           
mjs7231  17127  0.0  0.0  13128  1056 pts/1    S+   13:22   0:00 grep --color postgres

@martinrusev
Copy link
Member

Weird, I am running tests and I will update you in the moment I have a solution. Sorry for the troubles

@pkkid
Copy link
Author

pkkid commented Jan 7, 2012

No need to apologize, this is an awesome little webapp. I look forward to deploying it on my site. :)

@micsco
Copy link

micsco commented Jan 8, 2012

mjs7231 - we had the same issue when just configuring ours. Make sure you restart amond as well as amon. Just restarting amon causes this error, restarting both and you're away laughing.

@pkkid
Copy link
Author

pkkid commented Jan 8, 2012

Ahh! -- That does indeed fix it for me a well, thanks alot! :)

EDIT: MUAHAHA!!

@mutewinter
Copy link

Restarting amond also fixed this issue for me.

sudo /etc/init.d/amond restart

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants