projectatomic / commissaire-mvp

A lightweight REST interface for upgrading, restarting, and bootstrapping new hosts into an existing Container Management cluster.
http://commissaire.readthedocs.org/en/latest/
GNU General Public License v3.0
15 stars 9 forks source link

error reporting is broken in commissaire/amhm #195

Open jberkus opened 8 years ago

jberkus commented 8 years ago

Failure to start this docker container interactively gives me only this as an error:

2016-08-22 18:49:33,509 - root - 10 -  139807393781504 - CRITICAL - Unable to start server: <type 'str'>

Apparently there's a bug in error logging where it's passing an object instead of a string. Please fix.

ashcrow commented 8 years ago

@mbarnes can you take a look at this one?

mbarnes commented 8 years ago

Looking...

mbarnes commented 8 years ago

Error logging code looks correct to me. It's essentially printing sys.exc_info()[1] which should be an Exception instance. My attempts to reproduce this (by corrupting my config file) produce readable error messages.

@jberkus Would you be able to tweak the code to help debug this? Need to figure out what kind of error you're encountering.

jberkus commented 8 years ago

The underlying error was that it couldn't open the config file at all, due to volume permissions problems.

Try starting it up pointing to a non-existant or locked config file.

ashcrow commented 8 years ago

I believe this is a valid issue, however I wasn't able to reproduce it on Fedora 24. At least not with a non-existent file:

$ commissaire -c asd
usage: commissaire [-h] [--config-file CONFIG_FILE] [--no-config-file]
                   [--listen-interface LISTEN_INTERFACE]
                   [--listen-port LISTEN_PORT] [--tls-keyfile TLS_KEYFILE]
                   [--tls-certfile TLS_CERTFILE]
                   [--tls-clientverifyfile TLS_CLIENTVERIFYFILE]
                   [--authentication-plugin MODULE_NAME]
                   [--authentication-plugin-kwargs KEYWORD_ARGS]
                   [--register-store-handler JSON_OBJECT]
commissaire: error: [Errno 2] No such file or directory: 'asd'

@jberkus which distribution were you running on when the issue cropped up?

jberkus commented 8 years ago

Centos Atomic Host continuous. I'll set up a test case.