Getting this error while starting up my ElasticSearch (5.5.2) Instance after configuring ROR for the first time on my EC2. My ElasticSearch YML is Unchanged. . I looked at a few other forum posts (esp around YML indentation). No matter what I try, I keep getting this error. I have correct Indentation - for some reason this post is not showing the indendation correctly in readonlyrest.ym. What am I missing?
PS : I noticed my elasticsearch.yml and readonlyrest.yml have different yml configuration pattern.
Another Update : By changing permissions to give full access to /etc/elasticsearch/readonlyrest.yml
Iām beginning to get this message: but it runs into hundreds of thousands of lines in the log and then errors out
[2018-03-14T19:04:57,772][INFO ][t.b.r.e.SettingsObservableImpl] Loaded good settings from /etc/elasticsearch/readonlyrest.yml
[2018-03-14T19:04:57,859][INFO ][t.b.r.e.SettingsObservableImpl] Loaded good settings from /etc/elasticsearch/readonlyrest.yml
[2018-03-14T19:04:57,869][INFO ][t.b.r.e.SettingsObservableImpl] Loaded good settings from /etc/elasticsearch/readonlyrest.yml
[2018-03-14T19:04:57,875][INFO ][t.b.r.e.SettingsObservableImpl] Loaded good settings from /etc/elasticsearch/readonlyrest.yml
[2018-03-14T19:04:57,882][INFO ][t.b.r.e.SettingsObservableImpl] Loaded good settings from /etc/elasticsearch/readonlyrest.yml
ā¦
[2018-03-14T19:05:00,320][ERROR][o.e.b.Bootstrap ] Guice Exception: tech.beshu.ror.commons.settings.SettingsMalformedException: Could not find required attribute āreadonlyrestā
_ at tech.beshu.ror.commons.settings.RawSettings.req(RawSettings.java:84)_
_ at tech.beshu.ror.commons.settings.RawSettings.inner(RawSettings.java:191)_
@sscarduzio Thanks - It looks like it resolved - I missed adding the enable: true in the elasticsearch yml.
I might not have caught on initially - from the documentation - it felt like I had to add this in the ROR yml and not elastic yml.
Might make some sense to inform a user of this? IE The developer missed adding this property in the elastic ylm instead of this cryptic error stack?
When I do that - I get this error when starting up ES.If I add the readonlyrest.enable: true in elasticsearch.yml then readonlyrest.yml loads (but ive posted another issue on this forums that occurs after this step)
readonlyrest.yml
readonlyrest:
enable: true
response_if_req_forbidden: Forbidden by ReadonlyREST ES plugin
access_control_rules:
- name: "just that action from localhost"
type: allow
actions: ["cluster:monitor/main"]
hosts: ["127.0.0.1"]
- name: "Global Access"
auth_key: "elastic:changeme"
verbosity: "error"
- name: "My Index Access"
auth_key: "elastic:writeme"
type: allow
actions: ["indices:data/read/*","indices:data/write/*","indices:admin/template/*","indices:admin/create"]
indices: ["myindex-*", "<no_index>]
error
[2018-03-15T17:47:12,818][INFO ][t.b.r.e.SSLTransportNetty4] Loaded good settings from /etc/elasticsearch/readonlyrest.yml
[2018-03-15T17:47:12,944][ERROR][o.e.b.Bootstrap ] Exception
tech.beshu.ror.commons.settings.SettingsMalformedException: Could not find required attribute āreadonlyrestā
at tech.beshu.ror.commons.settings.RawSettings.req(RawSettings.java:84) ~[?:?]
at tech.beshu.ror.commons.settings.RawSettings.inner(RawSettings.java:191) ~[?:?]
at tech.beshu.ror.commons.settings.BasicSettings.(BasicSettings.java:84) ~[?:?]
@sscarduzio Another thing I noticed - in this forum which you have replied to - the original posters have indicated they were setting readonlyrest.enable: true in their elasticsearch.yml (generated by puppet)
Iāve been REALLY struggling to get the ROR going and the only way I could pull it off was by doing the exact same thing in my elasticsearch.yml (without using the nett4 configuration you mentioned). Iāve spent close to 2 days on this and without changing the elasticsearch.yml to add the readonlyrest.enable: true - i KEEP getting this error. Its a blackbox to me - would really like to know between the forum answer where they too were putting the readonlyrest.enable setting in their elasticsearch.yml - if I am doing something wrong?
UPDATE: Confirmed! Even though my consoles says readonlyrest.yml is āloadedā - none of its configurations are being picked up. But If I start modifying the elasticsearch.yml and add those settings directly in there - i can start seeing the changes slowly take effect. Why wont the readonlyrest.yml DESPITE being detected by console - its configurations being ignored?
@sscarduzio Thanks - Feel a bit foolish - there was a COLON ( : ) missing between the in the name attribute in the readonlyrest.yml. Do you think the bootstrapping can be enhanced to explicetly throw an error when this happens (ie syntax parsing exception?) - currently the console gave false postive by saying āLoaded Good settingsā¦ā. This would immensely help newbies who have no clue whats going on - especially helpful considering silly mistakes like these can take up unnecessary lost hours.
Your sacrifice was not useless, I just fixed the error message āloaded good settingsā with āloaded data from fileā, as it didnāt yet parse the YAML at that stage, and made sure we print the error message from the YAML parser
[2018-03-16T11:49:22,933][ERROR][t.b.r.e.SettingsObservableImpl] Cannot parse YAML: ScannerException:mapping values are not allowed here
in 'string', line 4, column 12:
enabled: true
^
readonlyrest:
audit_collector true
enabled: true
....