Results 1 to 4 of 4

Thread: Thruk won't start - you are not authorized

  1. #1

    Thruk won't start - you are not authorized

    I've tried to install the vanilla thruk directly from the website.

    I have Shinken up and running on the default ports, along with the built-in webpage.

    This on RHEL (Oracle Linux). I did the basic install and added the info in thruk_conf.local as directed by the Shinken docs I changed the port '50000' to match what the broker had as a default.

    So far, thruk won't start. The error is: "You are not authorized."

    I found one hit here, but it didn't work: https://github.com/sni/Thruk/issues/504

    I haven't installed Livestatus or any of that as the docs say it's already built into Shinken.

    I have a big demo tomorrow

    Any ideas?

    Code:
    [Sun Feb  7 22:51:43 2016][DEBUG]                                         '_method' => 'POST'
    [Sun Feb  7 22:51:43 2016][DEBUG]                                       }, 'HTTP::Request' )
    [Sun Feb  7 22:51:43 2016][DEBUG]                }, 'HTTP::Response' );
    [Sun Feb  7 22:51:43 2016][DEBUG] _dummy_c()
    [Sun Feb  7 22:51:43 2016][DEBUG] _dummy_c() done
    [Sun Feb  7 22:51:43 2016][DEBUG] _from_local()
    [Sun Feb  7 22:51:43 2016][DEBUG] _dummy_c()
    [Sun Feb  7 22:51:43 2016][ERROR] You are not authorized.
    [Sun Feb  7 22:51:43 2016][ERROR] It seems like you are not authorized.
    The full error log is quite long but I can post if needed.

    Ok, here's more of it, with some config info snipped

    Code:
    [Sun Feb  7 23:15:43 2016][DEBUG] reading secret file: /var/lib/thruk/secret.key
    [Sun Feb  7 23:15:43 2016][DEBUG] _run(): $VAR1 = {
    [Sun Feb  7 23:15:43 2016][DEBUG]           'yes' => undef,
    [Sun Feb  7 23:15:43 2016][DEBUG]           'quiet' => undef,
    [Sun Feb  7 23:15:43 2016][DEBUG]           'verbose' => 2,
    [Sun Feb  7 23:15:43 2016][DEBUG]           'version' => undef,
    [Sun Feb  7 23:15:43 2016][DEBUG]           'listbackends' => undef,
    [Sun Feb  7 23:15:43 2016][DEBUG]           'remoteurl_specified' => 0,
    [Sun Feb  7 23:15:43 2016][DEBUG]           'local' => undef,
    [Sun Feb  7 23:15:43 2016][DEBUG]           'force' => undef,
    [Sun Feb  7 23:15:43 2016][DEBUG]           'all_inclusive' => undef,
    [Sun Feb  7 23:15:43 2016][DEBUG]           'auth' => undef,
    [Sun Feb  7 23:15:43 2016][DEBUG]           'backends' => [],
    [Sun Feb  7 23:15:43 2016][DEBUG]           'remoteurl' => 'http://localhost/thruk/cgi-bin/remote.cgi',
    [Sun Feb  7 23:15:43 2016][DEBUG]           'action' => undef,
    [Sun Feb  7 23:15:43 2016][DEBUG]           'url' => [
    [Sun Feb  7 23:15:43 2016][DEBUG]                      'start'
    [Sun Feb  7 23:15:43 2016][DEBUG]                    ],
    [Sun Feb  7 23:15:43 2016][DEBUG]           'help' => undef,
    [Sun Feb  7 23:15:43 2016][DEBUG]           'credential' => '652adc2dcda2937db28394c88935f954',
    [Sun Feb  7 23:15:43 2016][DEBUG]           'start' => undef
    [Sun Feb  7 23:15:43 2016][DEBUG]         };
    [Sun Feb  7 23:15:43 2016][DEBUG] _request(http://localhost/thruk/cgi-bin/remote.cgi)
    [Sun Feb  7 23:15:43 2016][DEBUG]  -> failed: $VAR1 = bless( {
    [Sun Feb  7 23:15:43 2016][DEBUG]                  '_content' => 'Can\'t connect to localhost:80 (Connection refused)
    [Sun Feb  7 23:15:43 2016][DEBUG]
    [Sun Feb  7 23:15:43 2016][DEBUG] LWP::Protocol::http::Socket: connect: Connection refused at /usr/lib64/thruk/perl5/LWP/Protocol/http.pm line 47.
    [Sun Feb  7 23:15:43 2016][DEBUG] ',
    [Sun Feb  7 23:15:43 2016][DEBUG]                  '_rc' => 500,
    [Sun Feb  7 23:15:43 2016][DEBUG]                  '_headers' => bless( {
    [Sun Feb  7 23:15:43 2016][DEBUG]                                         'client-warning' => 'Internal response',
    [Sun Feb  7 23:15:43 2016][DEBUG]                                         'client-date' => 'Mon, 08 Feb 2016 07:15:43 GMT',
    [Sun Feb  7 23:15:43 2016][DEBUG]                                         'content-type' => 'text/plain',
    [Sun Feb  7 23:15:43 2016][DEBUG]                                         '::std_case' => {
    [Sun Feb  7 23:15:43 2016][DEBUG]                                                           'client-warning' => 'Client-Warning',
    [Sun Feb  7 23:15:43 2016][DEBUG]                                                           'client-date' => 'Client-Date'
    [Sun Feb  7 23:15:43 2016][DEBUG]                                                         }
    [Sun Feb  7 23:15:43 2016][DEBUG]                                       }, 'HTTP::Headers' ),
    [Sun Feb  7 23:15:43 2016][DEBUG]                  '_msg' => 'Can\'t connect to localhost:80 (Connection refused)',
    [Sun Feb  7 23:15:43 2016][DEBUG]                  '_request' => bless( {
    [Sun Feb  7 23:15:43 2016][DEBUG]                                         '_content' => 'data=%7B%22options%22%3A%7B%22yes%22%3Anull%2C%22quiet%22%3Anull%2C%22verbose%22%3A2%2C%22version%22%3Anull%2C%22listbackends%22%3Anull%2C%22remoteurl_specified%22%3A0%2C%22local%22%3Anull%2C%22force%22%3Anull%2C%22all_inclusive%22%3Anull%2C%22auth%22%3Anull%2C%22backends%22%3A%5B%5D%2C%22remoteurl%22%3A%22http%3A%2F%2Flocalhost%2Fthruk%2Fcgi-bin%2Fremote.cgi%22%2C%22action%22%3Anull%2C%22url%22%3A%5B%22start%22%5D%2C%22help%22%3Anull%2C%22credential%22%3A%22652adc2dcda28394c88935f954%22%2C%22start%22%3Anull%7D%2C%22credential%22%3A%22652adc2dcda2937db28394c88935f954%22%7D',
    [Sun Feb  7 23:15:43 2016][DEBUG]                                         '_uri' => bless( do{\(my $o = 'http://localhost/thruk/cgi-bin/remote.cgi')}, 'URI::http' ),
    [Sun Feb  7 23:15:43 2016][DEBUG]                                         '_headers' => bless( {
    [Sun Feb  7 23:15:43 2016][DEBUG]                                                                'user-agent' => 'thruk_cli',
    [Sun Feb  7 23:15:43 2016][DEBUG]                                                                'content-type' => 'application/x-www-form-urlencoded',
    [Sun Feb  7 23:15:43 2016][DEBUG]                                                                'content-length' => 585
    [Sun Feb  7 23:15:43 2016][DEBUG]                                                              }, 'HTTP::Headers' ),
    [Sun Feb  7 23:15:43 2016][DEBUG]                                         '_method' => 'POST'
    [Sun Feb  7 23:15:43 2016][DEBUG]                                       }, 'HTTP::Request' )
    [Sun Feb  7 23:15:43 2016][DEBUG]                }, 'HTTP::Response' );
    [Sun Feb  7 23:15:43 2016][DEBUG] _dummy_c()
    [Sun Feb  7 23:15:43 2016][DEBUG] _dummy_c() done
    [Sun Feb  7 23:15:43 2016][DEBUG] _from_local()
    [Sun Feb  7 23:15:43 2016][DEBUG] _dummy_c()
    [Sun Feb  7 23:15:43 2016][ERROR] You are not authorized.
    [Sun Feb  7 23:15:43 2016][ERROR] It seems like you are not authorized.
    You are not authorized. at /usr/share/thruk/lib/Thruk/Controller/error.pm line 274
            Thruk::Controller::error::index('Thruk::Context=HASH(0x391cc78)', undef) called at /usr/share/thruk/lib/Thruk/Context.pm line 109
            Thruk::Context::detach('Thruk::Context=HASH(0x391cc78)', '/error/index/10') called at /usr/share/thruk/lib/Thruk/Action/AddDefaults.pm line 207
    Last edited by jgwinner; 02-08-2016 at 07:39 AM. Reason: fixed missing tags

  2. #2
    Ok, I found a big clue ...

    Although the docs say:

    Thruk communicates with Shinken through the LiveStatus module. If you used the sample configuration, everything should be ready already.

    when I include the livestatus module in broker-master:

    Code:
    [1454974204] ERROR: [Shinken] [item::broker-master] Error: the module livestatus is unknown for broker-master
    Also, there's a section in the docs that don't refer to anything;

    Enable Livestatus module
    See enable Livestatus module.

    but no hyperlinks, and I couldn't find that with 'search'.

    More digging ...

    == John ==

  3. #3
    Turns out, there's no livestatus installed, the 10 minute start didn't do it so I used shinken install:

    Code:
    shinken install livestatus
    Then the verify worked fine.

    Now, getting errors from MongoDB.

    Now, what's odd; I'm using MongoDB for both UI elements as well as logs; I do eventually want this HA, and it seems like that's the prefered option. Per the docs:

    Make use of sqlite3 or mongodb to store Livestatus retention data. MongoDB integration with Livestatus is considered somewhat experimental, but can be very beneficial if performance and resiliency are desired. Especially when using a spare broker. MongoDB will ensure historical retention data is available to the spare broker, whereas with SQLite, it will not, and manual syncing is required.
    However, in my broker logs it almost looks like the logging is conflicting with the UI storage:

    Code:
    [1454985729] INFO: [broker-master] [WebUI-MongoDBPreferences] mongo uri: mongodb://localhost
    [1454985729] INFO: [broker-master] [WebUI-MongoDBPreferences] database: shinken, user: None
    [1454985729] INFO: [broker-master] [WebUI-MongoDBPreferences] Trying to open a Mongodb connection to mongodb://localhost, database: shinken
    [1454985729] INFO: [broker-master] Connection OK to the scheduler scheduler-master
    [1454985729] INFO: [broker-master] [WebUI-MongoDBPreferences] connected to mongodb: mongodb://localhost
    [1454985729] INFO: [broker-master] [WebUI-MongoDBPreferences] connected to the database: shinken
    [1454985729] INFO: [broker-master] [WebUI-MongoDBPreferences] searching connection test item in the collection ...
    [1454985729] INFO: [broker-master] [WebUI-MongoDBPreferences] updated connection test item
    [1454985729] INFO: [broker-master] [WebUI-MongoDBPreferences] database connection established
    [1454985729] INFO: [broker-master] Connection OK to the poller poller-master
    [1454985729] INFO: [broker-master] [WebUI-mongo-logs] mongo uri: mongodb://localhost
    [1454985729] INFO: [broker-master] [WebUI-mongo-logs] database: shinken, user: None
    [1454985729] INFO: [broker-master] [WebUI-mongo-logs] shinken logs collection: logs
    [1454985729] INFO: [broker-master] [WebUI-mongo-logs] hosts availability collection: availability
    [1454985729] INFO: [broker-master] [WebUI-mongo-logs] Trying to open a Mongodb connection to mongodb://localhost, database: shinken
    [1454985729] ERROR: [broker-master] [WebUI-mongo-logs] Exception: Unknown option connect
    [1454985729] INFO: [broker-master] Connection OK to the reactionner reactionner-master
    [1454985729] WARNING: [broker-master] [WebUI] Unknown option connect
    Can you use MongoDB for both logging and UI storage?

    == John ==

  4. #4
    Ok, I found the problem.

    Apache wasn't started - apparently starting up Thruk doesn't start it.

    No, that wasn't in the install manuals anyway

    == John ==

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •