FujitsuEnablingSoftwareTechnologyGmbH / fts-keystone

Kibana plugin for Keystone authentication
Other
1 stars 2 forks source link

Plugin install error. #1

Open millerthomasj opened 8 years ago

millerthomasj commented 8 years ago

I work for Time Warner Cable/Charter (c-Thomas.X.Miller@charter.com), I'm trying to get this up and running with our ELK stack. It seems to be a non-starter:

[DEV] root@dev02-kibana-001:/tmp# git clone https://github.com/FujitsuEnablingSoftwareTechnologyGmbH/fts-keystone.git && tar --exclude='.git' -czvf fts-keystone.tar.gz fts-keystone Cloning into 'fts-keystone'... remote: Counting objects: 27, done. remote: Total 27 (delta 0), reused 0 (delta 0), pack-reused 27 Unpacking objects: 100% (27/27), done. Checking connectivity... done. fts-keystone/ fts-keystone/.gitignore fts-keystone/gulpfile.js fts-keystone/server/ fts-keystone/server/session/ fts-keystone/server/session/index.js fts-keystone/server/proxy/ fts-keystone/server/proxy/retrieveToken.js fts-keystone/server/proxy/proxy.js fts-keystone/server/proxy/index.js fts-keystone/server/tests/ fts-keystone/server/tests/proxy.spec.js fts-keystone/server/tests/retrieveToken.spec.js fts-keystone/server/tests/util.spec.js fts-keystone/server/tests/healthcheck.spec.js fts-keystone/server/healthcheck/ fts-keystone/server/healthcheck/index.js fts-keystone/server/util/ fts-keystone/server/util/index.js fts-keystone/LICENSE fts-keystone/.eslintrc fts-keystone/.babelrc fts-keystone/package.json fts-keystone/index.js

[DEV] root@dev02-kibana-001:/tmp# /opt/kibana/bin/kibana plugin --url file:///tmp/fts-keystone.tar.gz -d /opt/kibana/installedPlugins --install fts-keystone Installing fts-keystone Attempting to transfer from file:///tmp/fts-keystone.tar.gz Transferring 8503 bytes.................... Transfer complete Extracting plugin archive Extraction complete Optimizing and caching browser bundles... Plugin installation was unsuccessful due to error "Cannot read property 'error' of undefined"

[DEV] root@dev02-kibana-001:/tmp# /opt/kibana/bin/kibana --version 4.4.2

kornicameister commented 8 years ago

@millerthomasj I think that what you downloaded were source codes - these cannot be installed. After I executed the first command and checked tarball, it looked like that.

Check v0.0.1 release and tell me if the problem is still there.

BTW, after you checkout sources, you'd have to download dependencies npm install and run this command nmp run package that would build you the tarball.

Also installation procedure requires you first to update kibana configuration with something like:

fts-keystone.port: ${keystone_port}
fts-keystone.url: http://${keystone_host}
fts-keystone.enabled: True

After that you can install plugin

$ (cd /tmp; wget https://github.com/FujitsuEnablingSoftwareTechnologyGmbH/fts-keystone/releases/download/v0.0.1/fts-keystone-0.0.1.tar.gz; cd -)

$ bin/kibana plugin --install fts-keystone --url file:///tmp/fts-keystone-0.0.1.tar.gz 
Installing fts-keystone
Attempting to transfer from file:///tmp/fts-keystone-0.0.1.tar.gz
Transferring 7567007 bytes....................
Transfer complete
Extracting plugin archive
Extraction complete
Optimizing and caching browser bundles...
Plugin installation complete

$ bin/kibana plugin --list 
fts-keystone
millerthomasj commented 8 years ago

I put this in my /opt/kibana/config/kibana.yml file:

fts-keystone.port: 5000 fts-keystone.url: http://dev02-keystone-001.os.cloud.twc.net fts-keystone.enabled: True

Made sure I could curl the proper things with these settings:

[DEV] root@dev02-kibana-001:~# curl -I http://dev02-keystone-001.os.cloud.twc.net:5000
HTTP/1.1 300 Multiple Choices
Vary: X-Auth-Token
Content-Type: application/json
Content-Length: 639

[DEV] root@dev02-kibana-001:~# curl -I http://dev02-keystone-001.os.cloud.twc.net:5000/v3
HTTP/1.1 200 OK
Vary: X-Auth-Token
Content-Type: application/json
Content-Length: 274
x-openstack-request-id: req-4070dabf-66e6-48d9-b00d-1c909e49b213

Installed the plugin as above and logged into my Horizon Dashboard but getting:

Courier Fetch Error: unhandled courier request error: You're not logged into the OpenStack. Please login via Horizon Dashboard

Version: 4.4.2
Build: 9732

Error: unhandled courier request error: You're not logged into the OpenStack. Please login via Horizon Dashboard
handleError@http://dev02-kibana-001.os.cloud.twc.net:5601/bundles/kibana.bundle.js?v=9732:89204:23
AbstractReqProvider/AbstractReq.prototype.handleFailure@http://dev02-kibana-001.os.cloud.twc.net:5601/bundles/kibana.bundle.js?v=9732:89124:15
callClient/</<@http://dev02-kibana-001.os.cloud.twc.net:5601/bundles/kibana.bundle.js?v=9732:89018:14
callClient/<@http://dev02-kibana-001.os.cloud.twc.net:5601/bundles/kibana.bundle.js?v=9732:89016:10
processQueue@http://dev02-kibana-001.os.cloud.twc.net:5601/bundles/commons.bundle.js?v=9732:41836:29
scheduleProcessQueue/<@http://dev02-kibana-001.os.cloud.twc.net:5601/bundles/commons.bundle.js?v=9732:41852:28
$RootScopeProvider/this.$get</Scope.prototype.$eval@http://dev02-kibana-001.os.cloud.twc.net:5601/bundles/commons.bundle.js?v=9732:43080:17
$RootScopeProvider/this.$get</Scope.prototype.$digest@http://dev02-kibana-001.os.cloud.twc.net:5601/bundles/commons.bundle.js?v=9732:42891:16
$RootScopeProvider/this.$get</Scope.prototype.$apply@http://dev02-kibana-001.os.cloud.twc.net:5601/bundles/commons.bundle.js?v=9732:43188:14
done@http://dev02-kibana-001.os.cloud.twc.net:5601/bundles/commons.bundle.js?v=9732:37637:37
completeRequest@http://dev02-kibana-001.os.cloud.twc.net:5601/bundles/commons.bundle.js?v=9732:37835:8
requestLoaded@http://dev02-kibana-001.os.cloud.twc.net:5601/bundles/commons.bundle.js?v=9732:37776:1
kornicameister commented 8 years ago

I am not sure if the port is set correctly. I'd have to double checked that in my local set up, but luckily @witekest is working on devstack integration for that right now and there he's using ADMIN (35357) port instead of MEMBER (5000) port.

AFAIK, token authorization (a.k.a. validation) should be performed over 35357 port. That's, according to my limited knowledge about policies in keystone, written here

millerthomasj commented 8 years ago

Changed to that port:

[DEV] root@dev02-kibana-001:~# cat /opt/kibana/config/kibana.yml 
# This file is managed by Puppet, any changes will be overwritten
#
fts-keystone.port: 35357
fts-keystone.url: http://dev02-keystone-001.os.cloud.twc.net
fts-keystone.enabled: True
[DEV] root@dev02-kibana-001:~# curl -I http://dev02-keystone-001.os.cloud.twc.net:35357/v3
HTTP/1.1 200 OK
Vary: X-Auth-Token
Content-Type: application/json
Content-Length: 275
x-openstack-request-id: req-748f2247-d94a-4f8d-88b2-21b62bce6b5f

Same exact error. I tried using Chrome, Firefox, and Safari. I see the communications from my kibana node to the keystone node, but doesn't seem to be picking up my token from my horizon login.

millerthomasj commented 8 years ago

From kibana.log

{"type":"log","@timestamp":"2016-07-13T21:26:10+00:00","tags":["keystone","debug"],"pid":47664,"message":"Call for /elasticsearch/_mget?timeout=0&ignore_unavailable=true&preference=1468445472859 detected, authenticating with keystone"}
{"type":"log","@timestamp":"2016-07-13T21:26:10+00:00","tags":["keystone","error"],"pid":47664,"message":"Token hasn't been located, looked in headers and session"}
{"type":"response","@timestamp":"2016-07-13T21:26:10+00:00","tags":[],"pid":47664,"method":"post","statusCode":401,"req":{"url":"/elasticsearch/_mget?timeout=0&ignore_unavailable=true&preference=1468445472859","method":"post","headers":{"host":"dev02-kibana-001.os.cloud.twc.net:5601","connection":"keep-alive","content-length":"62","accept":"application/json, text/plain, */*","origin":"http://dev02-kibana-001.os.cloud.twc.net:5601","kbn-version":"4.4.2","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36","content-type":"application/json;charset=UTF-8","referer":"http://dev02-kibana-001.os.cloud.twc.net:5601/app/kibana","accept-encoding":"gzip, deflate","accept-language":"en-US,en;q=0.8"},"remoteAddress":"24.26.90.80","userAgent":"24.26.90.80","referer":"http://dev02-kibana-001.os.cloud.twc.net:5601/app/kibana"},"res":{"statusCode":401,"responseTime":12,"contentLength":9},"message":"POST /elasticsearch/_mget?timeout=0&ignore_unavailable=true&preference=1468445472859 401 12ms - 9.0B"}
kornicameister commented 8 years ago

@millerthomasj

To be able to see Kibana you need monasca-ui. Do you access Kibana like this, via Horizon Dashboard ? Currently this one the only way to access that.

We did not implement anything like due to various reasons (lack for requirement in the first place), like for example login_page/logout_page that could be helpful to you. That all, assuming I understand what you're trying to there in your env.

Let me know if that's true.

millerthomasj commented 8 years ago

My environment looks like the following:

I've enabled my horizon to turn on the log management piece in monasca-ui by setting:

ENABLE_KIBANA_BUTTON = True KIBANA_HOST = "http://dev02-kibana-001.os.cloud.twc.net:5601/"

In my local_settings.py file, restarted horizon and i'm seeing the "Log Management" button.

But, when I click that button it is sending me to http://dev02-keystone-001.os.cloud.twc.net/horizon/monitoring/logs_proxy/ which redirects to http://dev02-keystone-001.os.cloud.twc.net/app/kibana

I see some status code 200 messages in my kibana.stdout logs that look good with x-auth-token set, but keystone is showing a 404. Do you have instructions on how you setup the whole environment anywhere? Does my kibana server need to be co-hosted on keystone nodes? I'm not sure how to get this all working.

kornicameister commented 8 years ago

Publicly available instruction is available through the tempest plugin for monasca-log-api. However this is a bit simplified as you may imagine.

There's one variable that I have in mind could be problematic. I am talking about server.basePath variable setting in the kibana.yml. Check here.

Another question is that keystone is assumed to support v3, however i think that this set properly.

If this is nothing that helps, let me know. Also attach some logs here or via gist. Logs from:

The question about should it be installed on the same node. Well it does not need to be, however whether or not it is possible to connect from one host to another is problem of another magnitude (iptables, different subnetes etc). But since the error you have is 404 this means that it is possible to establish connection but URI is not found. Is the 404 an error from keystone error logs ?