cloudfoundry-community / logsearch-for-cloudfoundry

A Logsearch addon that customises Logsearch to work with Cloud Foundry data
Apache License 2.0
49 stars 58 forks source link

Uploading Kibana objects does not work for newly deployed clusters #320

Closed axelaris closed 4 years ago

axelaris commented 5 years ago

The issue is related to recently added script for uploading Kibana objects by Kibana's own API. The error is:

Stderr     Traceback (most recent call last):  
             File "/var/vcap/jobs/upload-kibana-objects/bin/import-objects", line 25, in <module>  
               assert login.url == 'https://logs.{}/'.format(os.environ['CF_SYSTEM_DOMAIN'])  
           AssertionError  

But when I login to Kibana in a browser at least once - scripts starts working. I believe the issue is related to authorization to kibana_oauth2_client which can be done in a browser, but not being performed by the script.

peterellisjones commented 5 years ago

We're getting the same error. It works fine if we comment out the assertion. This is because we are using Cloud Foundry as an oauth provider so login url is

https://login.<system domain>/oauth/authorize?lient_id=kibana_oauth2_client&response_type=code&redirect_uri=https%3A%2F%2F<logs domain>%2Flogin&state=<state>&scope=openid%20oauth.approvals%20scim.userids%20cloud_controller.read

and not

https://logs.<system domain>

As the assertion expects