Closed funkyfuture closed 5 years ago
This one is already addressed. Mistake comes from creating own index by CURL command instead of creating by click Create Mapping button in the application. You can read more here: https://github.com/kitodo/kitodo-production/pull/1834
neither did i create an index w/ curl, nor would i know something about that button. is the patch you linked to included in the beta 1?
Yes, it is in the beta 1.
How did you create index if not by the button on the indexing page nor by CURL command?
How did you create index […] ?
not at all. it seems that the software did it, which is reasonable.
1) start up a fresh stack of the components
2) curl http://elasticsearch:9200/kitodo
yields an index_not_found_exception
3) request the top level page
4) as 2)
5) login as testAdmin
6) as 2)
7) create a 'Mandant'
8) curl …
yields {"kitodo":{"aliases":{},"mappings":{"client":{"properties":{"clientName":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}}}}},"settings":{"index":{"creation_date":"1542032508035","number_of_shards":"5","number_of_replicas":"1","uuid":"NPERN3oCQsWGU8t4Ys1zDA","version":{"created":"5061199"},"provided_name":"kitodo"}}}}
9) try to create a user
10) curl …
yields {"kitodo":{"aliases":{},"mappings":{"client":{"properties":{"clientName":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}}}},"user":{"properties":{"active":{"type":"boolean"},"clients":{"properties":{"id":{"type":"long"}}},"ldapLogin":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},"location":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},"login":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},"metadataLanguage":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},"name":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},"surname":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}}}}},"settings":{"index":{"creation_date":"1542032508035","number_of_shards":"5","number_of_replicas":"1","uuid":"NPERN3oCQsWGU8t4Ys1zDA","version":{"created":"5061199"},"provided_name":"kitodo"}}}}
at this point, the button to create the ES mapping is disabled.
now that i learned about that button, and apply it as very first action, i come to wonder why this action has to be invoked manually. (user creation works by this path.)
So here is the answer. You use automatic creation of index, what in the most of the cases is wrong. It is necessary first to create correct mapping. We can't depend on automatic creation, as you can see, it causes errors.
the software could prevent this by setting up the mapping itself.
We had a similar discussion on https://github.com/kitodo/kitodo-production/pull/1834. I agree that the user should not worry about mapping creation at all. If you want to add data and there's no mapping in the index yet it should be created automatically as Kitodo.Production sees it fit.
In case we don't want that we should at least create an explicit documentation like First Steps with a new Installation
or something to highlight all the things necessary to get it up and running the way we suggest.
What do you think @Kathrin-Huber?
As this issue is no longer related to the initial problem I am going to close it. If you have any concerns about the handling of the index, please feel free to open a new issue.
i get the following error logged when a user is created, yet there's no error message in the client.
the first messages that log a
404
are weird, as i get a200
when usingcurl
:these are the logged messages: