Closed peterellisjones closed 5 years ago
This fix will suppress the error, but in case of fresh deployment - objects will not be actually uploaded.
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?
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.
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.
We need to fix #320 for fresh deployments.
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
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