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

Remove assertion in upload-kibana-objects that fails when using OAuth to authenticate Kibana fixes #320 #322

Closed peterellisjones closed 5 years ago

peterellisjones commented 5 years ago

The next assertion still checks the response is 200 which should still provide a reasonable level of security.

I've verified that this code works by manually updating /var/vcap/jobs/upload-kibana-objects/bin/import-objects and then triggering the errand via /var/vcap/jobs/upload-kibana-objects/bin/run and verifying that the errand completes successfully.

Fixes #320

axelaris commented 5 years ago

This fix will suppress the error, but in case of fresh deployment - objects will not be actually uploaded.

peterellisjones commented 5 years ago

This fix will suppress the error, but in case of fresh deployment - objects will not be actually uploaded.

Interesting. If you comment out the assertion, what error do you get? Or does the next assertion assert login.status_code == 200 fail?

peterellisjones commented 5 years ago

Just to clarify: we are getting this error with a non-fresh deployment, and removing the assertion allows the script to upload the objects successfully.

axelaris commented 5 years ago

I got plenty of INFO:root:Object /var/vcap/jobs/upload-kibana-objects/kibana-objects/....json Uploaded Successfully messages. But when I checking in UI - there are no objects actually. But this start to work after first login thru UI.

axelaris commented 5 years ago

We need to fix #320 for fresh deployments.

peterellisjones commented 5 years ago

Ah I see — yes I was just looking at the INFO:root:Object ... Uploaded Successfully logs. I've verified that we don't see the saved objects either — either in the GUI or using the api/saved_objects/_find API. It's odd because https://github.com/cloudfoundry-community/logsearch-for-cloudfoundry/blob/develop/jobs/upload-kibana-objects/templates/bin/import-objects#L41 suggests that the object actually is uploaded